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


Java IWorkingSet.getId方法代碼示例

本文整理匯總了Java中org.eclipse.ui.IWorkingSet.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java IWorkingSet.getId方法的具體用法?Java IWorkingSet.getId怎麽用?Java IWorkingSet.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.IWorkingSet的用法示例。


在下文中一共展示了IWorkingSet.getId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GpsProject

import org.eclipse.ui.IWorkingSet; //導入方法依賴的package包/類
private GpsProject(IProject project) throws GpsFileException {
	name = project.getName();
	for (IWorkingSet ws: PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets()) {
		if (ws.getId() != null &&  ws.getId().equals("org.eclipse.jdt.ui.JavaWorkingSetPage")) { //$NON-NLS-1$
			for (IAdaptable element: ws.getElements()) {
				if (project.equals(element.getAdapter(IProject.class))) {
					workingSets.add(ws.getName());
					break;
				}
			}
		}
	}
	try {
		repositoryHandler = GpsRepositoryFactory.createHandler(project, this);
	} catch (Throwable t) {
		throw new GpsFileException("Cannot serialize project {0}", t, project.getName());
	}
}
 
開發者ID:Genuitec,項目名稱:gerrit-tools,代碼行數:19,代碼來源:GpsProject.java

示例2: isSupportedAsTopLevelElement

import org.eclipse.ui.IWorkingSet; //導入方法依賴的package包/類
/**
 * Tells whether the given working set is supported as top-level element
 * 
 * @param workingSet the working set to test
 * @return <code>true</code> if the given working set is supported as top-level element
 * @since 3.6
 */
public static boolean isSupportedAsTopLevelElement(IWorkingSet workingSet) {
	Object id= workingSet.getId();
	if (IWorkingSetIDs.OTHERS.equals(id) || IWorkingSetIDs.JAVA.equals(id) || IWorkingSetIDs.RESOURCE.equals(id))
		return true;

	if (!workingSet.isSelfUpdating() || workingSet.isAggregateWorkingSet())
		return false;

	IAdaptable[] elements= workingSet.getElements();
	for (int i= 0; i < elements.length; i++) {
		IAdaptable element= elements[i];
		IProject p= (IProject)element.getAdapter(IProject.class);
		if (p != null && p.exists())
			return true;
	}
	return false;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:25,代碼來源:WorkingSetModel.java

示例3: isValidWorkingSet

import org.eclipse.ui.IWorkingSet; //導入方法依賴的package包/類
private static boolean isValidWorkingSet(IWorkingSet workingSet) {
	String id= workingSet.getId();
	if (!IWorkingSetIDs.JAVA.equals(id) && !IWorkingSetIDs.RESOURCE.equals(id))
		return false;

	if (workingSet.isAggregateWorkingSet())
		return false;

	return true;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:11,代碼來源:NewJavaProjectWizardPageOne.java


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