当前位置: 首页>>代码示例>>Java>>正文


Java IWorkingSet.isAggregateWorkingSet方法代码示例

本文整理汇总了Java中org.eclipse.ui.IWorkingSet.isAggregateWorkingSet方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkingSet.isAggregateWorkingSet方法的具体用法?Java IWorkingSet.isAggregateWorkingSet怎么用?Java IWorkingSet.isAggregateWorkingSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.IWorkingSet的用法示例。


在下文中一共展示了IWorkingSet.isAggregateWorkingSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFromSelection

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private String getFromSelection(ParameterDescriptor descriptor) {
	if (selection == null) {
		return null;
	}

	if (descriptor.getType() == ParameterType.WORKINGSET) {
		for (Object selected : selection.toArray()) {
			if (selected instanceof IWorkingSet) {
				IWorkingSet workingSet = (IWorkingSet) selected;
				if (!workingSet.isAggregateWorkingSet() && IWorkingSetIDs.JAVA.equals(workingSet.getId())) {
					ParameterMapping mapping = descriptor.getDisplayMapping();
					Pattern labelPattern = Pattern.compile(mapping.getPattern());
					Matcher matcher = labelPattern.matcher(workingSet.getName());
					return matcher.replaceAll(mapping.getReplacement());
				}
			}
		}
	}

	return null;
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:22,代码来源:TemplateOptionFactory.java

示例2: run

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
@Override
public void run() {
	Shell shell= getShell();
	IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSet workingSet= fActionGroup.getWorkingSet();
	if (workingSet == null || workingSet.isAggregateWorkingSet()) {
		setEnabled(false);
		return;
	}
	IWorkingSetEditWizard wizard= manager.createWorkingSetEditWizard(workingSet);
	if (wizard == null) {
		String title= WorkingSetMessages.EditWorkingSetAction_error_nowizard_title;
		String message= WorkingSetMessages.EditWorkingSetAction_error_nowizard_message;
		MessageDialog.openError(shell, title, message);
		return;
	}
	WizardDialog dialog= new WizardDialog(shell, wizard);
 	dialog.create();
	if (dialog.open() == Window.OK)
		fActionGroup.setWorkingSet(wizard.getSelection(), true);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:22,代码来源:EditWorkingSetAction.java

示例3: isValidWorkingSet

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private static boolean isValidWorkingSet(IWorkingSet set) {
	if (set.isAggregateWorkingSet() || !set.isSelfUpdating())
		return false;

	if (!set.isVisible())
		return false;

	if (!set.isEditable())
		return false;

	for (int i= 0; i < VALID_WORKING_SET_IDS.length; i++) {
		if (VALID_WORKING_SET_IDS[i].equals(set.getId()))
			return true;
	}

	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:ConfigureWorkingSetAssignementAction.java

示例4: 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

示例5: getResources

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
/**
 * @param wset
 *            non null working set
 * @return non null set with work items, which may be empty
 */
public static Set<WorkItem> getResources(IWorkingSet wset) {
    Set<WorkItem> set = new HashSet<WorkItem>();
    boolean aggregateWorkingSet = wset.isAggregateWorkingSet();
    //TODO: Understand whats happening...
    // IAggregateWorkingSet was introduced in Eclipse 3.5
    //if (aggregateWorkingSet && wset instanceof IAggregateWorkingSet) {
    //    IAggregateWorkingSet aggr = (IAggregateWorkingSet) wset;
    //    IWorkingSet[] sets = aggr.getComponents();
    //    for (IWorkingSet iWorkingSet : sets) {
    //        set.addAll(getResources(iWorkingSet));
    //    }
    //} else {
        IAdaptable[] elements = wset.getElements();
        for (IAdaptable iAdaptable : elements) {
            WorkItem item = getWorkItem(iAdaptable);
            if (item != null) {
                set.add(item);
            }
        }
    //}
    return set;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:28,代码来源:ResourceUtils.java

示例6: createJavaSearchScope

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, int includeMask) {
  if (workingSets == null || workingSets.length < 1) return EMPTY_SCOPE;

  Set<IJavaElement> javaElements = new HashSet<IJavaElement>(workingSets.length * 10);
  for (int i = 0; i < workingSets.length; i++) {
    IWorkingSet workingSet = workingSets[i];
    if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) {
      return createWorkspaceScope(includeMask);
    }
    addJavaElements(javaElements, workingSet);
  }
  return createJavaSearchScope(javaElements, includeMask);
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaSearchScopeFactory.java

示例7: addJavaElements

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private void addJavaElements(Set<IJavaElement> javaElements, IWorkingSet workingSet) {
  if (workingSet == null) return;

  if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) {
    try {
      IJavaProject[] projects =
          JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
      javaElements.addAll(Arrays.asList(projects));
    } catch (JavaModelException e) {
      JavaPlugin.log(e);
    }
    return;
  }

  IAdaptable[] elements = workingSet.getElements();
  for (int i = 0; i < elements.length; i++) {
    IJavaElement javaElement = (IJavaElement) elements[i].getAdapter(IJavaElement.class);
    if (javaElement != null) {
      addJavaElements(javaElements, javaElement);
      continue;
    }
    IResource resource = (IResource) elements[i].getAdapter(IResource.class);
    if (resource != null) {
      addJavaElements(javaElements, resource);
    }

    // else we don't know what to do with it, ignore.
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:JavaSearchScopeFactory.java

示例8: 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

示例9: createJavaSearchScope

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, int includeMask) {
	if (workingSets == null || workingSets.length < 1)
		return EMPTY_SCOPE;

	Set<IJavaElement> javaElements= new HashSet<IJavaElement>(workingSets.length * 10);
	for (int i= 0; i < workingSets.length; i++) {
		IWorkingSet workingSet= workingSets[i];
		if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) {
			return createWorkspaceScope(includeMask);
		}
		addJavaElements(javaElements, workingSet);
	}
	return createJavaSearchScope(javaElements, includeMask);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavaSearchScopeFactory.java

示例10: addJavaElements

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private void addJavaElements(Set<IJavaElement> javaElements, IWorkingSet workingSet) {
	if (workingSet == null)
		return;

	if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) {
		try {
			IJavaProject[] projects= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
			javaElements.addAll(Arrays.asList(projects));
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return;
	}

	IAdaptable[] elements= workingSet.getElements();
	for (int i= 0; i < elements.length; i++) {
		IJavaElement javaElement=(IJavaElement) elements[i].getAdapter(IJavaElement.class);
		if (javaElement != null) {
			addJavaElements(javaElements, javaElement);
			continue;
		}
		IResource resource= (IResource)elements[i].getAdapter(IResource.class);
		if (resource != null) {
			addJavaElements(javaElements, resource);
		}

		// else we don't know what to do with it, ignore.
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:JavaSearchScopeFactory.java

示例11: restoreDialog

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
@Override
protected void restoreDialog(IDialogSettings settings) {
	super.restoreDialog(settings);

	if (! BUG_184693) {
		boolean showContainer= settings.getBoolean(SHOW_CONTAINER_FOR_DUPLICATES);
		fShowContainerForDuplicatesAction.setChecked(showContainer);
		fTypeInfoLabelProvider.setContainerInfo(showContainer);
	} else {
		fTypeInfoLabelProvider.setContainerInfo(true);
	}

	if (fAllowScopeSwitching) {
		String setting= settings.get(WORKINGS_SET_SETTINGS);
		if (setting != null) {
			try {
				IMemento memento= XMLMemento.createReadRoot(new StringReader(setting));
				fFilterActionGroup.restoreState(memento);
			} catch (WorkbenchException e) {
				// don't do anything. Simply don't restore the settings
				JavaPlugin.log(e);
			}
		}
		IWorkingSet ws= fFilterActionGroup.getWorkingSet();
		if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
			setSearchScope(SearchEngine.createWorkspaceScope());
			setSubtitle(null);
		} else {
			setSearchScope(JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true));
			setSubtitle(ws.getLabel());
		}
	}

	// TypeNameMatch[] types = OpenTypeHistory.getInstance().getTypeInfos();
	//
	// for (int i = 0; i < types.length; i++) {
	// TypeNameMatch type = types[i];
	// accessedHistoryItem(type);
	// }
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:FilteredTypesSelectionDialog.java

示例12: propertyChange

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent event) {
	
	if (ignoreFilterChangeEvents)
		return;
	
	IWorkingSet newWorkingSet = (IWorkingSet) event.getNewValue();

	setWorkingSet(newWorkingSet);
	if (newWorkingSet != null) {
		if (!contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) {
			contentService.getActivationService().activateExtensions(
					new String[] { WorkingSetsContentProvider.EXTENSION_ID }, false);
			contentService.getActivationService().persistExtensionActivations();
		}
		if (newWorkingSet.isAggregateWorkingSet()) {
			IAggregateWorkingSet agWs = (IAggregateWorkingSet) newWorkingSet;
			IWorkingSet[] comps = agWs.getComponents();
			if (comps.length > 1) {
				viewer.getCommonNavigator().setWorkingSetLabel(
						WorkbenchNavigatorMessages.actions_WorkingSetActionProvider_multipleWorkingSets);
			} else if (comps.length > 0) {
				viewer.getCommonNavigator().setWorkingSetLabel(comps[0].getLabel());
			} else {
				viewer.getCommonNavigator().setWorkingSetLabel(null);
			}
		} else
			viewer.getCommonNavigator().setWorkingSetLabel(workingSet.getLabel());
	} else {
		viewer.getCommonNavigator().setWorkingSetLabel(null);
	}

	viewer.getFrameList().reset();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:34,代码来源:WorkingSetActionProvider.java

示例13: setWorkingSet

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
/**
 * Set current active working set.
 * 
 * @param workingSet
 *            working set to be activated, may be <code>null</code>
 */
protected void setWorkingSet(IWorkingSet workingSet) {
	this.workingSet = workingSet;
	emptyWorkingSet = workingSet != null && workingSet.isAggregateWorkingSet() && workingSet.isEmpty();

       ignoreFilterChangeEvents = true;
       try {
       	workingSetActionGroup.setWorkingSet(workingSet);
       } finally {
       	ignoreFilterChangeEvents = false;
      	}		
	
	if (viewer != null) {
		setWorkingSetFilter(workingSet);
		if (workingSet == null || emptyWorkingSet
				|| !extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS)) {
			if (viewer.getInput() != originalViewerInput) {
				viewer.setInput(originalViewerInput);
			} else {
				viewer.refresh();
			}
		} else {
			if (!workingSet.isAggregateWorkingSet()) {
				IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
				viewer.setInput(workingSetManager.createAggregateWorkingSet(
						"", "", new IWorkingSet[] { workingSet })); //$NON-NLS-1$ //$NON-NLS-2$
			} else {
				viewer.setInput(workingSet);
			}
		}
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:38,代码来源:WorkingSetActionProvider.java

示例14: getChildren

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public Object[] getChildren(Object parentElement) {
	if (parentElement instanceof IWorkingSet) {
		IWorkingSet workingSet = (IWorkingSet) parentElement;
		if (workingSet.isAggregateWorkingSet() && projectExplorer != null) {
			switch (projectExplorer.getRootMode()) {
				case ProjectExplorer.WORKING_SETS :
					return ((IAggregateWorkingSet) workingSet).getComponents();
				case ProjectExplorer.PROJECTS :
					return getWorkingSetElements(workingSet);
			}
		}
		return getWorkingSetElements(workingSet);
	}
	return NO_CHILDREN;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:16,代码来源:WorkingSetsContentProvider.java

示例15: createJavaSearchScope

import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public IJavaSearchScope createJavaSearchScope(IWorkingSet workingSet, int includeMask) {
	Set<IJavaElement> javaElements= new HashSet<IJavaElement>(10);
	if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) {
		return createWorkspaceScope(includeMask);
	}
	addJavaElements(javaElements, workingSet);
	return createJavaSearchScope(javaElements, includeMask);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:9,代码来源:JavaSearchScopeFactory.java


注:本文中的org.eclipse.ui.IWorkingSet.isAggregateWorkingSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。