public void dispose() {
    myNodeEditor.dispose();
    myNodeEditor = null;

    myComponent.removeAll();
    myComponent = null;
  }
  public void recreateEditor() {
    if (myProject.isDisposed() || !isValid()) return;
    // if (myNodeEditor instanceof NodeEditor) return;

    myComponent.removeAll();

    FileEditorState state = myNodeEditor != null ? getState(FileEditorStateLevel.FULL) : null;

    IOperationContext context = createOperationContext();
    Editor oldNodeEditor = myNodeEditor;
    myNodeEditor = new MPSEditorOpener(myProject).createEditorFor(context, myFile.getNode());
    if (oldNodeEditor != null) {
      oldNodeEditor.dispose();
    }

    if (state != null) {
      setState(state);
    }

    myComponent.add(((BaseNodeEditor) myNodeEditor).getComponent(), BorderLayout.CENTER);
    myComponent.validate();
  }
 public void dispose() {
   myNodeEditor.dispose();
   myComponent.removeAll();
   myDisposed = true;
 }