/** {@inheritDoc} */
 public boolean selectionChanged(IStructuredSelection selection) {
   if (selection.size() == 1 && selection.getFirstElement() instanceof IScriptProject) {
     fSelectedProject = (IScriptProject) selection.getFirstElement();
     return true;
   }
   return false;
 }
 protected void handleDoubleClick(IStructuredSelection ssel) {
   super.handleDoubleClick(ssel);
   Object selected = ssel.getFirstElement();
   if (selected instanceof SiteFeatureAdapter) {
     IFeature feature = findFeature(((SiteFeatureAdapter) selected).feature);
     FeatureEditor.openFeatureEditor(feature);
   }
 }
 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());
   }
 }