本文整理匯總了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);
}
}