本文整理了Java中org.eclipse.ui.ide.IDE.computeSelectedResources()
方法的一些代码示例,展示了IDE.computeSelectedResources()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IDE.computeSelectedResources()
方法的具体详情如下:
包路径:org.eclipse.ui.ide.IDE
类名称:IDE
方法名:computeSelectedResources
[英]Extracts and returns the IResource
s in the given selection or the resource objects they adapts to.
[中]提取并返回给定选择中的IResource
或它们适应的资源对象。
代码示例来源:origin: org.eclipse/org.eclipse.team.ui
protected boolean checkWorkingSetElements() {
List allWorkingSetResources = new ArrayList();
IWorkingSet[] workingSets = getWorkingSets();
for (int i = 0; i < workingSets.length; i++) {
IWorkingSet set = workingSets[i];
allWorkingSetResources.addAll(IDE.computeSelectedResources(new StructuredSelection(set.getElements())));
}
getViewer().setCheckedElements(allWorkingSetResources.toArray(new IResource[allWorkingSetResources.size()]));
return !allWorkingSetResources.isEmpty();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui
@Override
protected boolean checkWorkingSetElements() {
List allWorkingSetResources = new ArrayList();
IWorkingSet[] workingSets = getWorkingSets();
for (int i = 0; i < workingSets.length; i++) {
IWorkingSet set = workingSets[i];
allWorkingSetResources.addAll(IDE.computeSelectedResources(new StructuredSelection(set.getElements())));
}
getViewer().setCheckedElements(allWorkingSetResources.toArray(new IResource[allWorkingSetResources.size()]));
return !allWorkingSetResources.isEmpty();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.workbench = workbench;
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
setWindowTitle(DataTransferMessages.DataTransfer_importTitle);
setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/importdir_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
setWindowTitle(DataTransferMessages.DataTransfer_export);
setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.workbench = workbench;
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
setWindowTitle(DataTransferMessages.DataTransfer_importTitle);
setDefaultPageImageDescriptor(IDEWorkbenchPlugin
.getIDEImageDescriptor("wizban/importzip_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List<?> selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
// look it up if current selection (after resource adapting) is empty
if (selection.isEmpty() && workbench.getActiveWorkbenchWindow() != null) {
IWorkbenchPage page = workbench.getActiveWorkbenchWindow()
.getActivePage();
if (page != null) {
IEditorPart currentEditor = page.getActiveEditor();
if (currentEditor != null) {
Object selectedResource = Adapters.adapt(currentEditor.getEditorInput(), IResource.class);
if (selectedResource != null) {
selection = new StructuredSelection(selectedResource);
}
}
}
}
setWindowTitle(DataTransferMessages.DataTransfer_export);
setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
内容来源于网络,如有侵权,请联系作者删除!