• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IWorkingSetManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: restoreWorkingSetsForProjects

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
void restoreWorkingSetsForProjects(List<WorkingSetData> workingSetDataList, List<IProject> projects,
		IWorkingSetManager mockedManager) {
	if (workingSetDataList == null || workingSetDataList.isEmpty()) {
		return;
	}
	if (projects == null || projects.isEmpty()) {
		return;
	}

	for (WorkingSetData data : workingSetDataList) {
		if (data.projectNamesContainedBefore.isEmpty()) {
			continue;
		}
		updateWorkingSet(data, projects);
	}

}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:18,代码来源:WorkingSetSupport.java


示例2: addProjectToSelectedWorkingSet

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
/**
 * <p>
 * Adds the newly created project to the currently selected working set.
 * </p>
 * 
 * @param project the project to be added to the selected working set
 */
private void addProjectToSelectedWorkingSet(IProject project) {
	IWorkbench workbench = PlatformUI.getWorkbench();
	IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
	if (workbenchWindow == null) {
		return;
	}
	ISelectionService selectionService = workbenchWindow.getSelectionService();
	ISelection selection = selectionService.getSelection();
	if (selection instanceof IStructuredSelection) {
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		Object firstElement = structuredSelection.getFirstElement();
		if (firstElement instanceof IAdaptable) {
			IAdaptable adaptable = (IAdaptable) firstElement;
			IWorkingSet workingSet = (IWorkingSet) adaptable.getAdapter(IWorkingSet.class);
			if (workingSet != null) {
				// new project wizard was invoked by right-clicking a working set
				IWorkingSetManager workingSetManager = workbench.getWorkingSetManager();
				workingSetManager.addToWorkingSets(project, new IWorkingSet[]{workingSet});
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:30,代码来源:DwprofileNewProjectWizardLogic.java


示例3: selectWorkingSetAction

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void selectWorkingSetAction() {
	IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(getShell(), true);
	dialog.open();
	IWorkingSet[] sets = dialog.getSelection();
	if(sets != null) {
		workingSets = sets;
	} else {
		// dialog cancelled
		return;
	}
	updateWorkingSetScope();
	updateWorkingSetLabel();
	
	participantScope.setSelection(false);
	selectedResourcesScope.setSelection(false);
	workingSetScope.setSelection(true);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:GlobalRefreshResourceSelectionPage.java


示例4: createWorkingSet

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void createWorkingSet() {
	IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSetNewWizard wizard= manager.createWorkingSetNewWizard(new String[] {IWorkingSetIDs.JAVA});
	// the wizard can't be null since we have at least the Java working set.
	WizardDialog dialog= new WizardDialog(getShell(), wizard);
	dialog.create();
	if (dialog.open() == Window.OK) {
		IWorkingSet workingSet= wizard.getSelection();
		if (WorkingSetModel.isSupportedAsTopLevelElement(workingSet)) {
			fAllWorkingSets.add(workingSet);
			fTableViewer.add(workingSet);
			fTableViewer.setSelection(new StructuredSelection(workingSet), true);
			fTableViewer.setChecked(workingSet, true);
			manager.addWorkingSet(workingSet);
			fAddedWorkingSets.add(workingSet);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:WorkingSetConfigurationDialog.java


示例5: removeSelectedWorkingSets

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
/**
 * 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());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:WorkingSetConfigurationDialog.java


示例6: fill

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
@Override
public void fill(Menu menu, int index) {
	MenuItem mi= new MenuItem(menu, SWT.RADIO, index);

	String name= fWorkingSet.getLabel();

	mi.setText("&" + fId + " " + name);  //$NON-NLS-1$  //$NON-NLS-2$
	if (fImage == null) {
		ImageDescriptor imageDescriptor= fWorkingSet.getImageDescriptor();
		if (imageDescriptor != null)
			fImage= imageDescriptor.createImage();
	}
	mi.setImage(fImage);
	mi.setSelection(fWorkingSet.equals(fActionGroup.getWorkingSet()));
	mi.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
			fActionGroup.setWorkingSet(fWorkingSet, true);
			manager.addRecentWorkingSet(fWorkingSet);
		}
	});
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:WorkingSetMenuContributionItem.java


示例7: run

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
@Override
public void run() {
	Shell shell= getShell();
	IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSetSelectionDialog dialog= manager.createWorkingSetSelectionDialog(shell, false);
	IWorkingSet workingSet= fActionGroup.getWorkingSet();
	if (workingSet != null)
		dialog.setSelection(new IWorkingSet[]{workingSet});

	if (dialog.open() == Window.OK) {
		IWorkingSet[] result= dialog.getSelection();
		if (result != null && result.length > 0) {
			fActionGroup.setWorkingSet(result[0], true);
			manager.addRecentWorkingSet(result[0]);
		}
		else
			fActionGroup.setWorkingSet(null, true);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:SelectWorkingSetAction.java


示例8: WorkingSetFilterActionGroup

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
public WorkingSetFilterActionGroup(IWorkbenchPartSite site, IPropertyChangeListener changeListener) {
	Assert.isNotNull(site);
	Assert.isNotNull(changeListener);

	fChangeListener= changeListener;
	fWorkbenchPage= site.getPage();
	fAllowWindowWorkingSetByDefault= true;
	fClearWorkingSetAction= new ClearWorkingSetAction(this);
	fSelectWorkingSetAction= new SelectWorkingSetAction(this, site);
	fEditWorkingSetAction= new EditWorkingSetAction(this, site);

	fWorkingSetListener= new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			doPropertyChange(event);
		}
	};
	fWorkingSetFilter= new WorkingSetFilter();

	IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
	manager.addPropertyChangeListener(fWorkingSetListener);

	if (useWindowWorkingSetByDefault()) {
		setWorkingSet(site.getPage().getAggregateWorkingSet(), false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:WorkingSetFilterActionGroup.java


示例9: run

import org.eclipse.ui.IWorkingSetManager; //导入依赖的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,代码行数:22,代码来源:EditWorkingSetAction.java


示例10: initWorkingSetFilter

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
/**
 * Restores the working set filter from the persistence store.
 */
protected void initWorkingSetFilter(String workingSetName) {
	IWorkingSet workingSet = null;

	if (workingSetName != null && workingSetName.length() > 0) {
		IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
		workingSet = workingSetManager.getWorkingSet(workingSetName);
	} else if (PlatformUI.getPreferenceStore().getBoolean(
			IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) {
		// use the window set by default if the global preference is set
		workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet();
	}

	if (workingSet != null) {
		setWorkingSet(workingSet);
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:20,代码来源:WorkingSetActionProvider.java


示例11: initWorkingSet

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
protected void initWorkingSet(String workingSetName) {
    IWorkingSet workingSet = null;

    if (workingSetName != null && workingSetName.length() > 0) {
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        workingSet = workingSetManager.getWorkingSet(workingSetName);
    } /*
       * else if (PlatformUI.getPreferenceStore().getBoolean(
       * IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) {
       * // use the window set by default if the global preference is set
       * workingSet =
       * PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage
       * ().getAggregateWorkingSet(); }
       */
    if (workingSet != null) {
        setCurrentWorkingSet(workingSet);
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:19,代码来源:BugContentProvider.java


示例12: createWorkingSet

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void createWorkingSet(IWorkingSet[] workingSets, IProject[] projects) {
	IWorkingSetManager manager = PsfImportPlugin.getDefault().getWorkbench().getWorkingSetManager();
	String workingSetName;
	for (int i = 0; i < workingSets.length; i++) {
		workingSetName = workingSets[i].getName();
		IWorkingSet oldSet = manager.getWorkingSet(workingSetName);
		if (oldSet == null) {
			IWorkingSet newSet = manager.createWorkingSet(workingSetName, projects);
			manager.addWorkingSet(newSet);
		} else {
			// don't overwrite the old elements
			IAdaptable[] tempElements = oldSet.getElements();
			IAdaptable[] adaptedProjects = oldSet.adaptElements(projects);
			IAdaptable[] finalElementList = new IAdaptable[tempElements.length + adaptedProjects.length];
			System.arraycopy(tempElements, 0, finalElementList, 0, tempElements.length);
			System.arraycopy(adaptedProjects, 0, finalElementList, tempElements.length, adaptedProjects.length);
			oldSet.setElements(finalElementList);
		}
	}
}
 
开发者ID:kelvinst,项目名称:psf-import,代码行数:21,代码来源:ImportProjectSetJob.java


示例13: resetEclipseWorkingSetsBaseOnCurrentState

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
/**
 * Resets the state of all Eclipse based working sets that belong to the 'Resources' type.
 */
private void resetEclipseWorkingSetsBaseOnCurrentState() {
	try {
		if (getWorkbench() == null || getWorkbench().getWorkingSetManager() == null) {
			return; // happens during shutdown
		}

		// Removed listener otherwise due to the Eclipse based working set deletion
		// we would delete our content.
		getWorkbench().getWorkingSetManager().removePropertyChangeListener(this);

		deleteEclipseResourcesWorkingSets();
		final IWorkingSetManager manager = getWorkbench().getWorkingSetManager();
		for (final WorkingSet workingSet : getAllWorkingSets()) {
			if (!OTHERS_WORKING_SET_ID.equals(workingSet.getId())) {
				org.eclipse.ui.internal.WorkingSet eclipseWorkingSet = createEclipseWorkingSet(workingSet);
				eclipseWorkingSet.setId(WorkingSetManagerModificationStrategy.RESOURCE_WORKING_SET_ID);
				manager.addWorkingSet(eclipseWorkingSet);
			}
		}
	} finally {
		IWorkbench wb = getWorkbench();
		if (wb != null) {
			IWorkingSetManager wsm = wb.getWorkingSetManager();
			if (wsm != null) { // null-safe re-adding (can be null during shutdown)
				wsm.addPropertyChangeListener(this);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:33,代码来源:ManualAssociationAwareWorkingSetManager.java


示例14: deleteEclipseResourcesWorkingSets

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
/**
 * Deletes all Eclipse based working sets that belong to the 'Resources' working set type.
 */
private void deleteEclipseResourcesWorkingSets() {
	// Discard the Eclipse based working set manager state by deleting all 'Resources' working sets.
	final Iterator<IWorkingSet> itr = getAllEclipseResourceWorkingSetsIterator();
	final IWorkingSetManager manager = getWorkbench().getWorkingSetManager();
	while (itr.hasNext()) {
		final IWorkingSet next = itr.next();
		manager.removeWorkingSet(next);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:ManualAssociationAwareWorkingSetManager.java


示例15: addToWorkingSet

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void addToWorkingSet(IProject project) {
    IWorkingSet[] selectedWorkingSets = workingSetGroup.getSelectedWorkingSets();
    if (selectedWorkingSets.length != 0) {
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        workingSetManager.addToWorkingSets(project, selectedWorkingSets);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:8,代码来源:PgImport.java


示例16: initializeScopingHint

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void initializeScopingHint() {
	String working_sets = settings.get(STORE_WORKING_SETS);
	if (working_sets == null) {
		participantScope.setSelection(true);
		updateParticipantScope();
	} else {
		StringTokenizer st = new StringTokenizer(working_sets, " ,"); //$NON-NLS-1$
		ArrayList ws = new ArrayList();
		while (st.hasMoreTokens()) {
			String workingSetName = st.nextToken();
			if (workingSetName != null && workingSetName.equals("") == false) { //$NON-NLS-1$
				IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
				IWorkingSet workingSet = workingSetManager.getWorkingSet(workingSetName);
				if (workingSet != null) {
					ws.add(workingSet);
				}
			}
		}
		if(! ws.isEmpty()) {
			this.workingSets = (IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]);
			updateWorkingSetScope();
			updateWorkingSetLabel();			
			participantScope.setSelection(false);
			selectedResourcesScope.setSelection(false);
			workingSetScope.setSelection(true);
		}
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:29,代码来源:GlobalRefreshResourceSelectionPage.java


示例17: addToWorkingSets

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
@SuppressWarnings("unused")
private void addToWorkingSets() {		
	if(workingSetGroup != null){
		IWorkingSet[] selectedWorkingSets = workingSetGroup.getSelectedWorkingSets();
		if(selectedWorkingSets == null || selectedWorkingSets.length == 0)
			return; // no Working set is selected
		IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
		for (Iterator i = createdProjects.iterator(); i.hasNext();) {
			IProject project = (IProject) i.next();
			workingSetManager.addToWorkingSets(project, selectedWorkingSets);
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:14,代码来源:SPIFePlanIntegrationWizardPage.java


示例18: doWorkingSetChanged

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void doWorkingSetChanged(PropertyChangeEvent event) {
	if (ViewActionGroup.MODE_CHANGED.equals(event.getProperty())) {
		fPart.rootModeChanged(((Integer)event.getNewValue()).intValue());
		Object oldInput= null;
		Object newInput= null;
		if (fPart.getRootMode() == PackageExplorerPart.PROJECTS_AS_ROOTS) {
			oldInput= fPart.getWorkingSetModel();
			newInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
		} else {
			oldInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
			newInput= fPart.getWorkingSetModel();
		}
		if (oldInput != null && newInput != null) {
			Frame frame;
			for (int i= 0; (frame= fFrameList.getFrame(i)) != null; i++) {
				if (frame instanceof TreeFrame) {
					TreeFrame treeFrame= (TreeFrame)frame;
					if (oldInput.equals(treeFrame.getInput()))
						treeFrame.setInput(newInput);
				}
			}
		}
	} else {
		IWorkingSet workingSet= (IWorkingSet) event.getNewValue();

		String workingSetLabel= null;
		if (workingSet != null)
			workingSetLabel= BasicElementLabels.getWorkingSetLabel(workingSet);
		fPart.setWorkingSetLabel(workingSetLabel);
		fPart.updateTitle();

		String property= event.getProperty();
		if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) {
			TreeViewer viewer= fPart.getTreeViewer();
			viewer.getControl().setRedraw(false);
			viewer.refresh();
			viewer.getControl().setRedraw(true);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:PackageExplorerActionGroup.java


示例19: workingSetModelChanged

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
private void workingSetModelChanged(PropertyChangeEvent event) {
	String property= event.getProperty();
	Object newValue= event.getNewValue();
	List<Object> toRefresh= new ArrayList<Object>(1);
	if (WorkingSetModel.CHANGE_WORKING_SET_MODEL_CONTENT.equals(property)) {
		toRefresh.add(fWorkingSetModel);
	} else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) {
		toRefresh.add(newValue);
	} else if (IWorkingSetManager.CHANGE_WORKING_SET_LABEL_CHANGE.equals(property)) {
		toRefresh.add(newValue);
	}
	ArrayList<Runnable> runnables= new ArrayList<Runnable>();
	postRefresh(toRefresh, true, runnables);
	executeRunnables(runnables);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:WorkingSetAwareContentProvider.java


示例20: doPropertyChange

import org.eclipse.ui.IWorkingSetManager; //导入依赖的package包/类
protected void doPropertyChange(PropertyChangeEvent event) {
	String property= event.getProperty();
	if (fMethodsViewer != null) {
		if (MembersOrderPreferenceCache.isMemberOrderProperty(event.getProperty())) {
			fMethodsViewer.refresh();
		}
	}
	if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) {
		updateHierarchyViewer(true);
		updateToolTipAndDescription();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:TypeHierarchyViewPart.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CacheStrategy类代码示例发布时间:2022-05-21
下一篇:
Java CBZip2InputStream类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap