myModel.addPropertyChangeListener(EOModel.ENTITIES, myEntitiesChangeListener);
  public void init(IEditorSite _site, IEditorInput _editorInput) throws PartInitException {    try {      IWorkbench workbench = Activator.getDefault().getWorkbench();      IWorkbenchPage workbenchPage = workbench.getActiveWorkbenchWindow().getActivePage();      if (workbenchPage != null && !EOModelerPerspectiveFactory.EOMODELER_PERSPECTIVE_ID.equals(workbenchPage.getPerspective().getId())) {        boolean switchPerspectives = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.getString("EOModelEditor.switchPerspectivesTitle"), Messages.getString("EOModelEditor.switchPerspectivesMessage")); //$NON-NLS-1$ //$NON-NLS-2$        if (switchPerspectives) {          workbench.showPerspective(EOModelerPerspectiveFactory.EOMODELER_PERSPECTIVE_ID, workbench.getActiveWorkbenchWindow());        }      }    }    catch (WorkbenchException e) {      e.printStackTrace();    }    try {      IFileEditorInput fileEditorInput;      if (_editorInput instanceof IFileEditorInput) {        fileEditorInput = (IFileEditorInput) _editorInput;      }      else {        throw new PartInitException("Unknown editor input: " + _editorInput + ".");      }      if (myModel != null) {        myModel.removePropertyChangeListener(EOModel.DIRTY, myDirtyModelListener);      }      IFile file = fileEditorInput.getFile();      String openingEntityName = null;      if ("plist".equalsIgnoreCase(file.getFileExtension())) { //$NON-NLS-1$        String name = file.getName();        openingEntityName = name.substring(0, name.indexOf('.'));        fileEditorInput = new FileEditorInput(file.getParent().getFile(new Path("index.eomodeld"))); //$NON-NLS-1$      }      myLoadFailures = new HashSet();      myModel = EclipseEOModelGroupFactory.createModel(fileEditorInput.getFile().getParent(), myLoadFailures);      if (openingEntityName != null) {        myOpeningEntity = myModel.getEntityNamed(openingEntityName);      }      handleModelErrors(myLoadFailures);      myModel.addPropertyChangeListener(EOModel.DIRTY, myDirtyModelListener);      super.init(_site, fileEditorInput);      updatePartName();      _site.setSelectionProvider(this);    }    catch (Exception e) {      throw new PartInitException("Failed to create EOModelEditorInput for " + _editorInput + ".", e);    }  }