本文整理汇总了Java中org.eclipse.ui.IWorkingSetManager.addToWorkingSets方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkingSetManager.addToWorkingSets方法的具体用法?Java IWorkingSetManager.addToWorkingSets怎么用?Java IWorkingSetManager.addToWorkingSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkingSetManager
的用法示例。
在下文中一共展示了IWorkingSetManager.addToWorkingSets方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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});
}
}
}
}
示例2: 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);
}
}
示例3: 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);
}
}
}
示例4: addToWorkingSets
import org.eclipse.ui.IWorkingSetManager; //导入方法依赖的package包/类
private void addToWorkingSets(IProject project) {
IWorkingSet[] selectedWorkingSets = ((WizardNewHybridProjectCreationPage) pageOne).getSelectedWorkingSets();
if(selectedWorkingSets == null || selectedWorkingSets.length == 0)
return; // no Working set is selected
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
workingSetManager.addToWorkingSets(project, selectedWorkingSets);
}
示例5: addToWorkingSet
import org.eclipse.ui.IWorkingSetManager; //导入方法依赖的package包/类
public void addToWorkingSet(IProject project) {
if ((getSelectedWorkingSets() != null) && (project != null)) {
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
workingSetManager.addToWorkingSets(project, getSelectedWorkingSets());
}
}