• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JavaSearchScopeFactory类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory的典型用法代码示例。如果您正苦于以下问题:Java JavaSearchScopeFactory类的具体用法?Java JavaSearchScopeFactory怎么用?Java JavaSearchScopeFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JavaSearchScopeFactory类属于org.eclipse.jdt.internal.ui.search包,在下文中一共展示了JavaSearchScopeFactory类的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleManifestmainclassBrowse

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

private void handleManifestmainclassBrowse() {

    String mainClass = getManifestmainclass();
    
    ILabelProvider lp= new WorkbenchLabelProvider();
    ITreeContentProvider cp= new WorkbenchContentProvider();

    IResource[] res=jproject.getResource();
    IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(res, true);
    SelectionDialog dialog = JavaUI.createMainTypeDialog(getShell(), getContainer(), searchScope, 0, false);
    dialog.setMessage("Select Main-Class for JAR file");
    dialog.setTitle("Fat Jar Config");
    
    if (dialog.open() == SelectionDialog.OK) {
        Object[] elements= dialog.getResult();
        if (elements.length == 1) {
            SourceType mainElement = (SourceType)elements[0];
            mainClass = mainElement.getFullyQualifiedName();
            manifestmainclassText.setText(mainClass);
        }
    }
}
 

开发者ID:thahn0720,
项目名称:agui_eclipse_plugin,
代码行数:28,
代码来源:ConfigPage.java

示例2: createQuery

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
	JavaEditor editor= getEditor();

	IJavaSearchScope scope;
	String description;
	boolean isInsideJRE= true;
	if (editor != null) {
		scope= factory.createJavaProjectSearchScope(editor.getEditorInput(), isInsideJRE);
		description= factory.getProjectScopeDescription(editor.getEditorInput(), isInsideJRE);
	} else {
		scope= factory.createJavaProjectSearchScope(element.getJavaProject(), isInsideJRE);
		description=  factory.getProjectScopeDescription(element.getJavaProject(), isInsideJRE);
	}
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 

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

示例3: createQuery

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
	JavaEditor editor= getEditor();

	IJavaSearchScope scope;
	String description;
	boolean isInsideJRE= factory.isInsideJRE(element);
	if (editor != null) {
		scope= factory.createJavaProjectSearchScope(editor.getEditorInput(), isInsideJRE);
		description= factory.getProjectScopeDescription(editor.getEditorInput(), isInsideJRE);
	} else {
		scope= factory.createJavaProjectSearchScope(element.getJavaProject(), isInsideJRE);
		description=  factory.getProjectScopeDescription(element.getJavaProject(), isInsideJRE);
	}
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 

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

示例4: findMainMethodByName

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
private IType findMainMethodByName(String name) {
	if (fMainTypes == null) {
		List<IResource> resources= JarPackagerUtil.asResources(fJarPackage.getElements());
		if (resources == null) {
			setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_noResourceSelected);
			return null;
		}
		IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(resources.toArray(new IResource[resources.size()]), true);
		MainMethodSearchEngine engine= new MainMethodSearchEngine();
		try {
			fMainTypes= engine.searchMainMethods(getContainer(), searchScope, 0);
		} catch (InvocationTargetException ex) {
			// null
		} catch (InterruptedException e) {
			// null
		}
	}
	for (int i= 0; i < fMainTypes.length; i++) {
		if (fMainTypes[i].getFullyQualifiedName().equals(name))
		 return fMainTypes[i];
	}
	return null;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:24,
代码来源:JarManifestWizardPage.java

示例5: handleMainClassBrowseButtonPressed

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
protected void handleMainClassBrowseButtonPressed() {
	List<IResource> resources= JarPackagerUtil.asResources(fJarPackage.getElements());
	if (resources == null) {
		setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_noResourceSelected);
		return;
	}
	IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(resources.toArray(new IResource[resources.size()]), true);
	SelectionDialog dialog= JavaUI.createMainTypeDialog(getContainer().getShell(), getContainer(), searchScope, 0, false, ""); //$NON-NLS-1$
	dialog.setTitle(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_title);
	dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_mainTypeSelectionDialog_message);
	if (fJarPackage.getManifestMainClass() != null)
		dialog.setInitialSelections(new Object[] {fJarPackage.getManifestMainClass()});

	if (dialog.open() == Window.OK) {
		fJarPackage.setManifestMainClass((IType)dialog.getResult()[0]);
		fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage));
	} else if (!fJarPackage.isMainClassValid(getContainer())) {
		// user did not cancel: no types were found
		fJarPackage.setManifestMainClass(null);
		fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage));
	}
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:23,
代码来源:JarManifestWizardPage.java

示例6: getInt

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
/**
 * Returns the integer value of the strings.
 * 
 * @param str the array of strings
 * @return the integer value of the strings
 */
private int getInt(String[] str) {
	boolean value;
	int mask= 0;
	int val= 0;
	for (int i= 0; i < str.length; i++) {
		value= fSettings.getBoolean(str[i]);
		if (value) {
			switch (i) {
				case 0:
					val= JavaSearchScopeFactory.SOURCES;
					break;
				case 1:
					val= JavaSearchScopeFactory.PROJECTS;
					break;
				case 2:
					val= JavaSearchScopeFactory.JRE;
					break;
				case 3:
					val= JavaSearchScopeFactory.LIBS;
			}
			mask|= val;
		}
	}
	return mask;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:32,
代码来源:SearchInDialog.java

示例7: createIncludeMask

点赞 3

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
/**
 * Creates the search in options.
 * 
 * @param parent the parent composite
 * @return the group control
 */
private Control createIncludeMask(Composite parent) {
	Group result= new Group(parent, SWT.NONE);
	result.setText(SearchMessages.SearchPage_searchIn_label);
	result.setLayout(new GridLayout(4, false));
	fIncludeMasks= new Button[] {
			createButton(result, SWT.CHECK, SearchMessages.SearchPage_searchIn_sources, JavaSearchScopeFactory.SOURCES, fSettings.getBoolean(SEARCH_IN_SOURCES)),
			createButton(result, SWT.CHECK, SearchMessages.SearchPage_searchIn_projects, JavaSearchScopeFactory.PROJECTS, fSettings.getBoolean(SEARCH_IN_PROJECTS)),
			createButton(result, SWT.CHECK, SearchMessages.SearchPage_searchIn_jre, JavaSearchScopeFactory.JRE, fSettings.getBoolean(SEARCH_IN_JRE)),
			createButton(result, SWT.CHECK, SearchMessages.SearchPage_searchIn_libraries, JavaSearchScopeFactory.LIBS, fSettings.getBoolean(SEARCH_IN_APPLIBS)),
	};

	SelectionAdapter listener= new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			updateOKStatus();
		}
	};
	for (int i= 0; i < fIncludeMasks.length; i++) {
		fIncludeMasks[i].addSelectionListener(listener);
	}

	return result;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:30,
代码来源:SearchInDialog.java

示例8: createPackageSelectionDialog

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
private PackageSelectionDialog createPackageSelectionDialog(
		IJavaProject jProject) {
	PackageSelectionDialog dialog = new PackageSelectionDialog(
			JavaPlugin.getActiveWorkbenchShell(), PlatformUI.getWorkbench()
					.getProgressService(),
			PackageSelectionDialog.F_HIDE_EMPTY_INNER,
			JavaSearchScopeFactory.getInstance()
					.createJavaProjectSearchScope(jProject, false));
	dialog.setTitle("选择当前工程中的包");
	return dialog;
}
 

开发者ID:bsteker,
项目名称:bdf2,
代码行数:12,
代码来源:SelectClassPage.java

示例9: handleManifestmainclassBrowse

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleManifestmainclassBrowse() {
	try {
		String mainClass = getManifestmainclass();

		ILabelProvider lp = new WorkbenchLabelProvider();
		ITreeContentProvider cp = new WorkbenchContentProvider();

		IResource[] res = { jproject.getCorrespondingResource() };
		IJavaSearchScope searchScope = JavaSearchScopeFactory.getInstance().createJavaSearchScope(res, true);
		SelectionDialog dialog = JavaUI.createMainTypeDialog(getShell(), getContainer(), searchScope, 0, false);
		dialog.setMessage("Select Main-Class for JAR file");
		dialog.setTitle("Fat Jar Config");

		if (dialog.open() == SelectionDialog.OK) {
			Object[] elements = dialog.getResult();
			if (elements.length == 1) {
				SourceType mainElement = (SourceType) elements[0];
				mainClass = mainElement.getFullyQualifiedName();
				manifestmainclassText.setText(mainClass);
			}
		}
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
}
 

开发者ID:thahn0720,
项目名称:agui_eclipse_plugin,
代码行数:31,
代码来源:FJExportWizardConfigPage.java

示例10: runMethodRefQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
static JavaSearchQuery runMethodRefQuery(
    String TypeName, String methodName, String[] parameterTypes) throws JavaModelException {
  IMethod method = getMethod(TypeName, methodName, parameterTypes);
  JavaSearchQuery query =
      new JavaSearchQuery(
          new ElementQuerySpecification(
              method,
              IJavaSearchConstants.REFERENCES,
              JavaSearchScopeFactory.getInstance().createWorkspaceScope(true),
              "workspace scope"));
  NewSearchUI.runQueryInForeground(null, query);
  return query;
}
 

开发者ID:eclipse,
项目名称:che,
代码行数:14,
代码来源:SearchTestHelper.java

示例11: runTypeRefQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
static JavaSearchQuery runTypeRefQuery(String typeName) throws JavaModelException {
  IType type = getType(typeName);
  JavaSearchQuery query =
      new JavaSearchQuery(
          new ElementQuerySpecification(
              type,
              IJavaSearchConstants.REFERENCES,
              JavaSearchScopeFactory.getInstance().createWorkspaceScope(true),
              "workspace scope"));
  NewSearchUI.runQueryInForeground(null, query);
  return query;
}
 

开发者ID:eclipse,
项目名称:che,
代码行数:13,
代码来源:SearchTestHelper.java

示例12: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
	boolean isInsideJRE= factory.isInsideJRE(element);

	IJavaSearchScope scope= factory.createWorkspaceScope(isInsideJRE);
	String description= factory.getWorkspaceScopeDescription(isInsideJRE);
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:10,
代码来源:FindReferencesAction.java

示例13: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();

	IType type= getType(element);
	if (type == null) {
		return super.createQuery(element);
	}
	IJavaSearchScope scope= SearchEngine.createHierarchyScope(type);
	String description= factory.getHierarchyScopeDescription(type);
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:13,
代码来源:FindDeclarationsInHierarchyAction.java

示例14: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@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);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:16,
代码来源:FindImplementorsInWorkingSetAction.java

示例15: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@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); // in 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);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:16,
代码来源:FindReferencesInWorkingSetAction.java

示例16: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
	IType type= getType(element);
	if (type == null) {
		return super.createQuery(element);
	}
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
	IJavaSearchScope scope= SearchEngine.createHierarchyScope(type);
	String description= factory.getHierarchyScopeDescription(type);
	return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:12,
代码来源:FindReferencesInHierarchyAction.java

示例17: createQuery

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
	JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();

	IWorkingSet[] workingSets= fWorkingSet;
	if (fWorkingSet == null) {
		workingSets= factory.queryWorkingSets();
		if (workingSets == null)
			return super.createQuery(element); // in 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);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:16,
代码来源:FindDeclarationsInWorkingSetAction.java

示例18: run

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
public void run() {
	try {
		IWorkingSet[] workingSets;
		workingSets = JavaSearchScopeFactory.getInstance().queryWorkingSets();
		if (workingSets != null) {
			this.fGroup.setActiveWorkingSets(workingSets);
			SearchUtil.updateLRUWorkingSets(workingSets);
		} else {
			this.fGroup.setActiveWorkingSets(null);
		}
	} catch (InterruptedException e) {
		// cancel pressed
	}
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:16,
代码来源:SelectWorkingSetAction.java

示例19: getFullDescription

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
public String getFullDescription(int includeMask) {
	IMember[] members= fGroup.getView().getInputElements();
	if (members != null) {
		HashSet<String> projectNames= new HashSet<String>();
		for (int i= 0; i < members.length; i++) {
			projectNames.add(members[i].getJavaProject().getElementName());
		}
		JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
		return factory.getProjectScopeDescription(
				projectNames.toArray(new String[projectNames.size()]),
				includeMask);
	}
	return ""; //$NON-NLS-1$
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:16,
代码来源:SearchScopeProjectAction.java

示例20: findMainMethodByName

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
private static IType findMainMethodByName(String name, IPackageFragmentRoot[] classpathResources, IRunnableContext context) {

		List<IResource> resources= JarPackagerUtil.asResources(classpathResources);
		if (resources == null) {
			return null;
		}

		for (Iterator<IResource> iterator= resources.iterator(); iterator.hasNext();) {
			IResource element= iterator.next();
			if (element == null)
				iterator.remove();
		}

		IJavaSearchScope searchScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(resources.toArray(new IResource[resources.size()]), true);
		MainMethodSearchEngine engine= new MainMethodSearchEngine();
		try {
			IType[] mainTypes= engine.searchMainMethods(context, searchScope, 0);
			for (int i= 0; i < mainTypes.length; i++) {
				if (mainTypes[i].getFullyQualifiedName().equals(name))
					return mainTypes[i];
			}
		} catch (InvocationTargetException ex) {
			JavaPlugin.log(ex);
		} catch (InterruptedException e) {
			// null
		}

		return null;
	}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:30,
代码来源:FatJarPackageWizardPage.java

示例21: restoreDialog

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的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

示例22: fillViewMenu

点赞 2

import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; //导入依赖的package包/类
@Override
protected void fillViewMenu(IMenuManager menuManager) {
	super.fillViewMenu(menuManager);

	if (! BUG_184693) {
		fShowContainerForDuplicatesAction= new ShowContainerForDuplicatesAction();
		menuManager.add(fShowContainerForDuplicatesAction);
	}
	if (fAllowScopeSwitching) {
		fFilterActionGroup= new WorkingSetFilterActionGroup(getShell(), JavaPlugin.getActivePage(), new IPropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent event) {
				IWorkingSet ws= (IWorkingSet) event.getNewValue();
				if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
					setSearchScope(SearchEngine.createWorkspaceScope());
					setSubtitle(null);
				} else {
					setSearchScope(JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true));
					setSubtitle(ws.getLabel());
				}

				applyFilter();
			}
		});
		fFilterActionGroup.fillViewMenu(menuManager);
	}

	menuManager.add(new Separator());
	menuManager.add(new TypeFiltersPreferencesAction());
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:30,
代码来源:FilteredTypesSelectionDialog.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)