當前位置: 首頁>>代碼示例>>Java>>正文


Java JavaUI.getLibraryJavadocLocation方法代碼示例

本文整理匯總了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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:34,代碼來源:BuildPathDialogAccess.java

示例2: getURL

import org.eclipse.jdt.ui.JavaUI; //導入方法依賴的package包/類
public URL getURL() {
	if (isProjectRef()) {
		return JavaUI.getProjectJavadocLocation(fProject);
	} else {
		return JavaUI.getLibraryJavadocLocation(fClasspathEntry);
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:8,代碼來源:JavadocLinkRef.java


注:本文中的org.eclipse.jdt.ui.JavaUI.getLibraryJavadocLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。