Java Code Examples for org.eclipse.ui.IWorkingSet

The following examples show how to use org.eclipse.ui.IWorkingSet. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private static GrayedCheckedModel createGrayedCheckedModel(IAdaptable[] elements, IWorkingSet[] workingSets, Set<IWorkingSet> checkedWorkingSets) {
	GrayedCheckedModelElement[] result= new GrayedCheckedModelElement[workingSets.length];

	for (int i= 0; i < workingSets.length; i++) {
		IWorkingSet workingSet= workingSets[i];
		
		int checkCount= 0;
		for (int j= 0; j < elements.length; j++) {
			if (checkedWorkingSets == null) {
				IAdaptable adapted= adapt(workingSet, elements[j]);
				if (adapted != null && contains(workingSet, adapted))
					checkCount++;
			} else {
				if (checkedWorkingSets.contains(workingSet))
					checkCount++;
			}
		}

		result[i]= new GrayedCheckedModelElement(workingSet, checkCount, elements.length);
	}

	return new GrayedCheckedModel(result);
}
 
Example 2
@Override
public boolean performFinish() {
	boolean res= super.performFinish();
	if (res) {
		final IJavaElement newElement= getCreatedElement();

		IWorkingSet[] workingSets= fFirstPage.getWorkingSets();
		if (workingSets.length > 0) {
			PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(newElement, workingSets);
		}

		BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
		selectAndReveal(fSecondPage.getJavaProject().getProject());

		Display.getDefault().asyncExec(new Runnable() {
			public void run() {
				IWorkbenchPart activePart= getActivePart();
				if (activePart instanceof IPackagesViewPart) {
					PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
					view.tryToReveal(newElement);
				}
			}
		});
	}
	return res;
}
 
Example 3
/**
 * Returns with the strategy for the given property change even argument,
 *
 * @param event
 *            a property change argument.
 * @return a strategy encapsulating an actual working set manager modification.
 */
public WorkingSetManagerModificationStrategy getStrategy(final PropertyChangeEvent event) {

	if (event == null) {
		return NOOP;
	}

	final String property = event.getProperty();
	switch (property) {
	case CHANGE_WORKING_SET_ADD:
		return new AddWorkingSetModificationStrategy((IWorkingSet) event.getNewValue());
	case CHANGE_WORKING_SET_REMOVE:
		return new RemoveWorkingSetModificationStrategy((IWorkingSet) event.getOldValue());
	case CHANGE_WORKING_SET_LABEL_CHANGE: //$FALL-THROUGH$
	case CHANGE_WORKING_SET_NAME_CHANGE: //$FALL-THROUGH$
	case CHANGE_WORKING_SET_CONTENT_CHANGE:
		return new UpdateWorkingSetModificationStraregy(
				(IWorkingSet) event.getOldValue(),
				(IWorkingSet) event.getNewValue());
	default:
		return NOOP;
	}
}
 
Example 4
private void refreshJavaElements(IStructuredSelection selection, IProgressMonitor monitor) throws JavaModelException {
	Object[] selectedElements= selection.toArray();
	ArrayList<IJavaElement> javaElements= new ArrayList<IJavaElement>();
	for (int i= 0; i < selectedElements.length; i++) {
		Object curr= selectedElements[i];
		if (curr instanceof IPackageFragmentRoot) {
			javaElements.add((IPackageFragmentRoot) curr);
		} else if (curr instanceof PackageFragmentRootContainer) {
			javaElements.addAll(Arrays.asList(((PackageFragmentRootContainer) curr).getPackageFragmentRoots()));
		} else if (curr instanceof IWorkingSet) {
			IAdaptable[] members= ((IWorkingSet) curr).getElements();
			for (int k= 0; k < members.length; k++) {
				IJavaElement adapted= (IJavaElement)members[k].getAdapter(IJavaElement.class);
				if (adapted instanceof IPackageFragmentRoot) {
					javaElements.add(adapted);
				}
			}
		}
		}
	if (!javaElements.isEmpty()) {
		IJavaModel model= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
		model.refreshExternalArchives(javaElements.toArray(new IJavaElement[javaElements.size()]), monitor);
	}
}
 
Example 5
Source Project: goclipse   Source File: GoSearchPage.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public FileTextSearchScope createTextSearchScope() {
  // Setup search scope
  switch (getContainer().getSelectedScope()) {
    case ISearchPageContainer.WORKSPACE_SCOPE:
      return FileTextSearchScope.newWorkspaceScope(getExtensions(), false);
    case ISearchPageContainer.SELECTION_SCOPE:
      return getSelectedResourcesScope();
    case ISearchPageContainer.SELECTED_PROJECTS_SCOPE:
      return getEnclosingProjectScope();
    case ISearchPageContainer.WORKING_SET_SCOPE:
      IWorkingSet[] workingSets = getContainer().getSelectedWorkingSets();
      return FileTextSearchScope.newSearchScope(workingSets, getExtensions(), false);
    default:
      // unknown scope
      return FileTextSearchScope.newWorkspaceScope(getExtensions(), false);
  }
}
 
Example 6
private boolean isNewTarget(Object element) {
	if (element == null)
		return true;
	if (element instanceof IResource) {
		return true;
	}
	if (element instanceof IJavaElement) {
		int type= ((IJavaElement)element).getElementType();
		return type == IJavaElement.JAVA_PROJECT ||
			type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
			type == IJavaElement.PACKAGE_FRAGMENT ||
			type == IJavaElement.COMPILATION_UNIT ||
			type == IJavaElement.TYPE;
	}
	if (element instanceof IWorkingSet) {
		String workingSetId= ((IWorkingSet)element).getId();
		return
			IWorkingSetIDs.JAVA.equals(workingSetId) ||
			IWorkingSetIDs.RESOURCE.equals(workingSetId) ||
			IWorkingSetIDs.OTHERS.equals(workingSetId);
	}
	return false;
}
 
Example 7
/**
 * 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;
}
 
Example 8
@Override
public void run(IStructuredSelection selection) {
	IWorkingSet ws= getWorkingSet(selection);
	if (ws == null)
		return;
	HashSet<IAdaptable> elements= new HashSet<IAdaptable>(Arrays.asList(ws.getElements()));
	List<?> selectedElements= selection.toList();
	for (Iterator<?> iter= selectedElements.iterator(); iter.hasNext();) {
		Object object= iter.next();
		if (object instanceof IAdaptable) {
			IAdaptable[] adaptedElements= ws.adaptElements(new IAdaptable[] {(IAdaptable)object});
			if (adaptedElements.length == 1) {
				elements.remove(adaptedElements[0]);
			}
		}
	}
	ws.setElements(elements.toArray(new IAdaptable[elements.size()]));
}
 
Example 9
/**
 * Initializes GUI elements of {@link NewExtensionWizardPage}
 */
private void initialize() {
	ExtensionUtils.getTemplates().stream().forEach(template -> extensionTemplateCombo.add(template));
	extensionTemplateCombo.setText("yempty");
	IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
	if (workingSets != null)
	{
		for (IWorkingSet workingSet: workingSets)
		{
			if (!workingSet.getName().startsWith("Aggregate"))
			{
				workingSetCombo.add(workingSet.getName());
			}
		}
	}
	extensionDirectoryField.setStringValue(getDefaultExtensionLocation());
}
 
Example 10
Source Project: Pydev   Source File: PythonBaseModelProvider.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @param newWorkingSet
 */
private IWorkspace[] getWorkspaces(IWorkingSet newWorkingSet) {
    IAdaptable[] elements = newWorkingSet.getElements();
    HashSet<IWorkspace> set = new HashSet<IWorkspace>();

    for (IAdaptable adaptable : elements) {
        IResource adapter = adaptable.getAdapter(IResource.class);
        if (adapter != null) {
            IWorkspace workspace = adapter.getWorkspace();
            set.add(workspace);
        } else {
            Log.log("Was not expecting that IWorkingSet adaptable didn't return anything...");
        }
    }
    return set.toArray(new IWorkspace[0]);
}
 
Example 11
private void recalculateCheckedState(List<IWorkingSet> addedWorkingSets) {
	Set<IWorkingSet> checkedWorkingSets= new HashSet<IWorkingSet>();
	GrayedCheckedModelElement[] elements= fModel.getChecked();
	for (int i= 0; i < elements.length; i++)
		checkedWorkingSets.add(elements[i].getWorkingSet());

	if (addedWorkingSets != null)
		checkedWorkingSets.addAll(addedWorkingSets);

	fModel= createGrayedCheckedModel(fElements, getAllWorkingSets(), checkedWorkingSets);

	fTableViewer.setInput(fModel);
	fTableViewer.refresh();
	fTableViewer.setCheckedElements(fModel.getChecked());
	fTableViewer.setGrayedElements(fModel.getGrayed());
}
 
Example 12
/**
 * Collects and combines the selection which may contain sources from
 * different projects and / or multiple sources from same project.
 * <p>
 * If selection contains hierarchical data (like file and it's parent
 * directory), the only topmost element is returned (same for directories
 * from projects).
 * <p>
 * The children from selected parents are not resolved, so that the return
 * value contains the 'highest' possible hierarchical elements without
 * children.
 *
 * @param structuredSelection
 * @return a map with the project as a key and selected resources as value.
 *         If project itself was selected, then key is the same as value.
 */
public static Map<IProject, List<WorkItem>> getResourcesPerProject(IStructuredSelection structuredSelection) {
    Map<IProject, List<WorkItem>> projectsMap = new HashMap<>();
    for (Iterator<?> iter = structuredSelection.iterator(); iter.hasNext();) {
        Object element = iter.next();
        WorkItem workItem = getWorkItem(element);
        if (workItem == null) {
            IWorkingSet wset = Util.getAdapter(IWorkingSet.class, element);
            if (wset != null) {
                mapResources(wset, projectsMap);
                continue;
            }

            // Support for active changesets
            ChangeSet set = Util.getAdapter(ChangeSet.class, element);
            for (WorkItem change : getResources(set)) {
                mapResource(change, projectsMap, true);
            }
            continue;
        }
        mapResource(workItem, projectsMap, false);
    }
    return projectsMap;
}
 
Example 13
/**
 * @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<>();
    boolean aggregateWorkingSet = wset.isAggregateWorkingSet();
    // 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;
}
 
Example 14
@Test
public void testCreateWorkingSet() {
  wizard.init( PlatformUI.getWorkbench(), null );
  wizard.addPages();
  DynamicWorkingSetPage startingPage = ( DynamicWorkingSetPage )wizard.getStartingPage();

  IWorkingSet workingSet = startingPage.getSelection();

  assertThat( workingSet.getName() ).isEmpty();
  assertThat( workingSet.getElements() ).isEmpty();
  assertThat( workingSet.isSelfUpdating() ).isTrue();
  assertThat( workingSet.isAggregateWorkingSet() ).isFalse();
  assertThat( workingSet.isEditable() ).isTrue();
  assertThat( workingSet.getId() ).isEqualTo( DynamicWorkingSet.ID );
  assertThat( workingSet.getLabel() ).isEmpty();
  assertThat( workingSet.getImageDescriptor() ).isNotNull();
}
 
Example 15
/**
 * Removes the selected working sets from the workbench.
 */
private void removeSelectedWorkingSets() {
	ISelection selection= fTableViewer.getSelection();
	if (selection instanceof IStructuredSelection) {
		IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
		Iterator<?> iter= ((IStructuredSelection)selection).iterator();
		while (iter.hasNext()) {
			IWorkingSet workingSet= (IWorkingSet)iter.next();
			if (fAddedWorkingSets.contains(workingSet)) {
				fAddedWorkingSets.remove(workingSet);
			} else {
				IWorkingSet[] recentWorkingSets= manager.getRecentWorkingSets();
				for (int i= 0; i < recentWorkingSets.length; i++) {
					if (workingSet.equals(recentWorkingSets[i])) {
						fRemovedMRUWorkingSets.add(workingSet);
						break;
					}
				}
				fRemovedWorkingSets.add(workingSet);
			}
			fAllWorkingSets.remove(workingSet);
			manager.removeWorkingSet(workingSet);
		}
		fTableViewer.remove(((IStructuredSelection)selection).toArray());
	}
}
 
Example 16
/**
 * @param memento a memento, or <code>null</code>
 */
public WorkingSetModel(IMemento memento) {
	fLocalWorkingSetManager= PlatformUI.getWorkbench().createLocalWorkingSetManager();
	addListenersToWorkingSetManagers();
	fActiveWorkingSets= new ArrayList<IWorkingSet>();
	fAllWorkingSets= new ArrayList<IWorkingSet>();

	if (memento == null || ! restoreState(memento)) {
		IWorkingSet others= fLocalWorkingSetManager.createWorkingSet(WorkingSetMessages.WorkingSetModel_others_name, new IAdaptable[0]);
		others.setId(IWorkingSetIDs.OTHERS);
		fLocalWorkingSetManager.addWorkingSet(others);
		fActiveWorkingSets.add(others);
		fAllWorkingSets.add(others);
	}
	Assert.isNotNull(fOthersWorkingSetUpdater);

	fElementMapper.rebuild(getActiveWorkingSets());
	fOthersWorkingSetUpdater.updateElements();
}
 
Example 17
private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
	FindAction action;
	if (fEditor != null)
		action= new WorkingSetFindAction(fEditor, new FindWriteReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
	else
		action= new WorkingSetFindAction(fSite, new FindWriteReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
	action.update(getContext().getSelection());
	addAction(action, manager);
}
 
Example 18
/**
 * @return the selected working set to filter if in root mode {@link #PROJECTS_AS_ROOTS}
 */
public IWorkingSet getFilterWorkingSet() {
	if (getRootMode() != PROJECTS_AS_ROOTS)
		return null;

	if (fActionSet == null)
		return null;

	return fActionSet.getWorkingSetActionGroup().getFilterGroup().getWorkingSet();
}
 
Example 19
private SearchScopeAction getSearchScopeAction(int searchScopeType, String[] workingSetNames) {
	switch (searchScopeType) {
		case SEARCH_SCOPE_TYPE_WORKSPACE:
			return fSearchScopeWorkspaceAction;
		case SEARCH_SCOPE_TYPE_PROJECT:
			return fSearchScopeProjectAction;
		case SEARCH_SCOPE_TYPE_WORKING_SET:
			IWorkingSet[] workingSets= getWorkingSets(workingSetNames);
			if (workingSets != null && workingSets.length > 0) {
				return new SearchScopeWorkingSetAction(this, workingSets, getScopeDescription(workingSets));
			}
			return null;
	}
	return null;
}
 
Example 20
@Override
public boolean canPasteOn(IJavaElement[] selectedJavaElements, IResource[] selectedResources, IWorkingSet[] selectedWorkingSets, List<?> selectedElements) throws JavaModelException {
	if (selectedResources.length != 0 || selectedWorkingSets.length != 0)
		return false;
	TypedSource[] typedSources= getClipboardTypedSources(fAvailableTypes);
	Object destination= getTarget(selectedJavaElements, selectedResources);
	if (destination instanceof IJavaElement)
		return ReorgTypedSourcePasteStarter.create(typedSources, (IJavaElement)destination) != null;
	return false;
}
 
Example 21
private boolean isGoIntoTarget(Object element) {
	if (element == null)
		return false;
	if (element instanceof IJavaElement) {
		int type= ((IJavaElement)element).getElementType();
		return type == IJavaElement.JAVA_PROJECT ||
			type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
			type == IJavaElement.PACKAGE_FRAGMENT;
	}
	if (element instanceof IWorkingSet) {
		return true;
	}
	return false;
}
 
Example 22
Source Project: n4js   Source File: WorkingSet.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
default <T> T getAdapter(final Class<T> adapter) {

	if (IWorkingSet.class == adapter || ResourceMapping.class == adapter) {
		return (T) new WorkingSetAdapter(this);
	}

	return Platform.getAdapterManager().getAdapter(this, adapter);
}
 
Example 23
public IWorkingSet[] getSelection() {
	GrayedCheckedModelElement[] checked= fModel.getChecked();
	IWorkingSet[] result= new IWorkingSet[checked.length];
	for (int i= 0; i < checked.length; i++) {
		result[i]= checked[i].getWorkingSet();
	}
	return result;
}
 
Example 24
@Override
public Image getImage(Object object) {
	Assert.isTrue(object instanceof IWorkingSet);
	IWorkingSet workingSet= (IWorkingSet)object;
	ImageDescriptor imageDescriptor= workingSet.getImageDescriptor();
	if (imageDescriptor == null)
		return null;
	Image icon= fIcons.get(imageDescriptor);
	if (icon == null) {
		icon= imageDescriptor.createImage();
		fIcons.put(imageDescriptor, icon);
	}
	return icon;
}
 
Example 25
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();
}
 
Example 26
@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);
	// }
}
 
Example 27
public void updateElements() {
	Assert.isTrue(fWorkingSet != null && fWorkingSetModel != null); // init and addWorkingSet have happend

	IWorkingSet[] activeWorkingSets= fWorkingSetModel.getActiveWorkingSets();

	List<IAdaptable> result= new ArrayList<IAdaptable>();
	Set<IResource> projects= new HashSet<IResource>();
	for (int i= 0; i < activeWorkingSets.length; i++) {
		if (activeWorkingSets[i] == fWorkingSet) continue;
		IAdaptable[] elements= activeWorkingSets[i].getElements();
		for (int j= 0; j < elements.length; j++) {
			IAdaptable element= elements[j];
			IResource resource= (IResource)element.getAdapter(IResource.class);
			if (resource != null && resource.getType() == IResource.PROJECT) {
				projects.add(resource);
			}
		}
	}
	IJavaModel model= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
	try {
		IJavaProject[] jProjects= model.getJavaProjects();
		for (int i= 0; i < jProjects.length; i++) {
			if (!projects.contains(jProjects[i].getProject()))
				result.add(jProjects[i]);
		}
		Object[] rProjects= model.getNonJavaResources();
		for (int i= 0; i < rProjects.length; i++) {
			if (!projects.contains(rProjects[i]))
				result.add((IProject) rProjects[i]);
		}
	} catch (JavaModelException e) {
		JavaPlugin.log(e);
	}
	fWorkingSet.setElements(CollectionsUtil.toArray(result, IAdaptable.class));
}
 
Example 28
public SearchScopeWorkingSetAction(SearchScopeActionGroup group, IWorkingSet[] workingSets, String name) {
	super(group, name);
	setToolTipText(CallHierarchyMessages.SearchScopeActionGroup_workingset_tooltip);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_SEARCH_SCOPE_ACTION);

	this.fWorkingSets = workingSets;
}
 
Example 29
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();

	IWorkingSet[] workingSets= fWorkingSets;
	if (fWorkingSets == null) {
		workingSets= factory.queryWorkingSets();
		if (workingSets == null)
			return super.createQuery(element); // workspace
	}
	SearchUtil.updateLRUWorkingSets(workingSets);
	IJavaSearchScope scope= factory.createJavaSearchScope(workingSets, JavaSearchScopeFactory.NO_PROJ);
	String description= factory.getWorkingSetScopeDescription(workingSets, JavaSearchScopeFactory.NO_PROJ);
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 
Example 30
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
	if (e1 instanceof IWorkingSet || e2 instanceof IWorkingSet)
		return 0;

	return super.compare(viewer, e1, e2);
}