コード例 #1
0
 /** {@inheritDoc} */
 public boolean selectionChanged(IStructuredSelection selection) {
   if (selection.size() == 1 && selection.getFirstElement() instanceof IScriptProject) {
     fSelectedProject = (IScriptProject) selection.getFirstElement();
     return true;
   }
   return false;
 }
コード例 #2
0
 @Override
 public void selectionChanged(IFormPart masterPart, ISelection selection) {
   IStructuredSelection ssel = (IStructuredSelection) selection;
   if (ssel.size() == 1) {
     fInput = (IPluginExtensionPoint) ssel.getFirstElement();
   } else fInput = null;
   update();
 }
コード例 #3
0
 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));
   }
 }
コード例 #4
0
  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;
  }
コード例 #5
0
 private void handleOpen(IStructuredSelection selection) {
   Object object = selection.getFirstElement();
   if (object instanceof IProductPlugin) {
     ManifestEditor.openPluginEditor(((IProductPlugin) object).getId());
   }
 }