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