title: Enable/Disbale eclispe rcp editor via menu when clicking on a TreeViewer element
body: <p>In my eclipse RCP application I have a TreeViewer from where I can select different editors, for drawing elements, which show up after double clicking. In my top menu I have an option that allows to enable/disbale the drawing. The action for the editors looks like the following:</p>
  
  <pre><code>public class EnableEditorAction implements IEditorActionDelegate {
  
  IEditor hallEditor = null;
  
  @Override
  public void run(IAction action) {       
      if (hallEditor != null){
          hallEditor.setMachineHallEditMode(true);
      }       
  }
  
  @Override
  public void setActiveEditor(IAction action, IEditorPart targetEditor) {
      // check for enabled
      boolean bEnabled = false;
      if (targetEditor != null &amp;&amp; targetEditor instanceof IMachineHallEditor) {
          hallEditor = (IMachineHallEditor) targetEditor;
          bEnabled = !hallEditor.isMachineHallEditingMode();
      } 
      action.setEnabled(bEnabled);
  }
  
  @Override
  public void selectionChanged(IAction action, ISelection selection) {
      if (hallEditor != null) {
          action.setEnabled(!hallEditor.isMachineHallEditingMode());
      }       
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem I have is that the menu option is only enabled when clicking inside an editor. What i want is to enable the menu option also after clicking on one of the editors in the TreeViewer to the left.</p>
  
  <p>How would I do that?</p>