/**
  * The method is overridden to compare {@link ScriptEditor} nature with the nature of this view.
  *
  * @see
  *     org.eclipse.dltk.mod.ui.infoviews.AbstractInfoView#isValidWorkbenchPart(org.eclipse.ui.IWorkbenchPart)
  */
 protected boolean isValidWorkbenchPart(IWorkbenchPart part) {
   if (part instanceof ScriptEditor) {
     final ScriptEditor editor = (ScriptEditor) part;
     return editor.getLanguageToolkit().getNatureId().equals(getNature());
   }
   return false;
 }
 /**
  * Note: This constructor is for internal use only. Clients should not call this constructor.
  *
  * @param editor the Script editor
  */
 public OpenEditorActionGroup(ScriptEditor editor) {
   fIsEditorOwner = true;
   fOpen = new OpenAction(editor);
   fOpen.setActionDefinitionId(IScriptEditorActionDefinitionIds.OPEN_EDITOR);
   editor.setAction("OpenEditor", fOpen); // $NON-NLS-1$
   fSite = editor.getEditorSite();
   initialize(fSite.getSelectionProvider());
 }
  QuerySpecification createQuery(IModelElement element) throws ModelException {
    DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();
    ScriptEditor editor = getEditor();

    IDLTKSearchScope scope;
    String description;
    boolean isInsideInterpreterEnvironment = true;
    if (editor != null) {
      scope =
          factory.createProjectSearchScope(editor.getEditorInput(), isInsideInterpreterEnvironment);
      description =
          factory.getProjectScopeDescription(
              editor.getEditorInput(), isInsideInterpreterEnvironment);
    } else {
      scope =
          factory.createProjectSearchScope(
              element.getScriptProject(), isInsideInterpreterEnvironment);
      description =
          factory.getProjectScopeDescription(
              element.getScriptProject(), isInsideInterpreterEnvironment);
    }
    return new ElementQuerySpecification(element, getLimitTo(), scope, description);
  }
 /** Note: This constructor is for internal use only. Clients should not call this constructor. */
 public OpenCallHierarchyAction(ScriptEditor editor) {
   this(editor.getEditorSite());
   fEditor = editor;
   setEnabled(SelectionConverter.canOperateOn(fEditor));
 }