/** {@inheritDoc} */ public boolean selectionChanged(IStructuredSelection selection) { if (selection.size() == 1 && selection.getFirstElement() instanceof IScriptProject) { fSelectedProject = (IScriptProject) selection.getFirstElement(); return true; } return false; }
@Override public void selectionChanged(IFormPart masterPart, ISelection selection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.size() == 1) { fInput = (IPluginExtensionPoint) ssel.getFirstElement(); } else fInput = null; update(); }
private void doSearch(ISelection sel) { IPackageFragment frag = getPackageFragment(sel); if (frag != null) { FindReferencesAction action = new FindReferencesAction(getPage().getEditorSite()); action.run(frag); } else if (sel instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) sel; PackageObject exportObject = (PackageObject) selection.getFirstElement(); NewSearchUI.runQueryInBackground(new BlankQuery(exportObject)); } }
private IPackageFragment getPackageFragment(ISelection sel) { if (sel instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) sel; if (selection.size() != 1) return null; IBaseModel model = getPage().getModel(); if (!(model instanceof IPluginModelBase)) return null; return PDEJavaHelper.getPackageFragment( ((PackageObject) selection.getFirstElement()).getName(), ((IPluginModelBase) model).getPluginBase().getId(), getPage().getPDEEditor().getCommonProject()); } return null; }
private void handleOpen(IStructuredSelection selection) { Object object = selection.getFirstElement(); if (object instanceof IProductPlugin) { ManifestEditor.openPluginEditor(((IProductPlugin) object).getId()); } }