本文整理汇总了Java中org.eclipse.jdt.ui.JavaUI.getLibraryJavadocLocation方法的典型用法代码示例。如果您正苦于以下问题:Java JavaUI.getLibraryJavadocLocation方法的具体用法?Java JavaUI.getLibraryJavadocLocation怎么用?Java JavaUI.getLibraryJavadocLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.ui.JavaUI
的用法示例。
在下文中一共展示了JavaUI.getLibraryJavadocLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureJavadocLocation
import org.eclipse.jdt.ui.JavaUI; //导入方法依赖的package包/类
/**
* Shows the UI for configuring a javadoc location attribute of the classpath entry. <code>null</code> is returned
* if the user cancels the dialog. The dialog does not apply any changes.
*
* @param shell The parent shell for the dialog.
* @param initialEntry The entry to edit. The kind of the classpath entry must be either
* <code>IClasspathEntry.CPE_LIBRARY</code> or <code>IClasspathEntry.CPE_VARIABLE</code>.
* @return Returns the resulting classpath entry containing a potentially modified javadoc location attribute
* The resulting entry can be used to replace the original entry on the classpath.
* Note that the dialog does not make any changes on the passed entry nor on the classpath that
* contains it.
*
* @since 3.1
*/
public static IClasspathEntry configureJavadocLocation(Shell shell, IClasspathEntry initialEntry) {
if (initialEntry == null) {
throw new IllegalArgumentException();
}
int entryKind= initialEntry.getEntryKind();
if (entryKind != IClasspathEntry.CPE_LIBRARY && entryKind != IClasspathEntry.CPE_VARIABLE) {
throw new IllegalArgumentException();
}
URL location= JavaUI.getLibraryJavadocLocation(initialEntry);
JavadocLocationDialog dialog= new JavadocLocationDialog(shell, BasicElementLabels.getPathLabel(initialEntry.getPath(), false), location);
if (dialog.open() == Window.OK) {
CPListElement element= CPListElement.createFromExisting(initialEntry, null);
URL res= dialog.getResult();
element.setAttribute(CPListElement.JAVADOC, res != null ? res.toExternalForm() : null);
return element.getClasspathEntry();
}
return null;
}
示例2: getURL
import org.eclipse.jdt.ui.JavaUI; //导入方法依赖的package包/类
public URL getURL() {
if (isProjectRef()) {
return JavaUI.getProjectJavadocLocation(fProject);
} else {
return JavaUI.getLibraryJavadocLocation(fClasspathEntry);
}
}