EOModelEditorInput input; if (_editorInput instanceof EOModelEditorInput) { input = (EOModelEditorInput) _editorInput; } else if (_editorInput instanceof IFileEditorInput) { IFileEditorInput fileEditorInput = (IFileEditorInput) _editorInput; input = new EOModelEditorInput(fileEditorInput); handleModelErrors(input.getLoadFailures());
IFileEditorInput fileEditorInput; if (_editorInput instanceof IFileEditorInput) { fileEditorInput = (IFileEditorInput) _editorInput;
  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 {      EOModelEditorInput input;      if (_editorInput instanceof EOModelEditorInput) {        input = (EOModelEditorInput) _editorInput;      }      else if (_editorInput instanceof IFileEditorInput) {        IFileEditorInput fileEditorInput = (IFileEditorInput) _editorInput;        input = new EOModelEditorInput(fileEditorInput);        handleModelErrors(input.getLoadFailures());      }      else {        throw new PartInitException("Unknown editor input: " + _editorInput + ".");      }      EOModelEditorInput oldInput = (EOModelEditorInput) getEditorInput();      if (oldInput != null) {        oldInput.getModel().removePropertyChangeListener(EOModel.DIRTY, myDirtyModelListener);      }      input.getModel().addPropertyChangeListener(EOModel.DIRTY, myDirtyModelListener);      super.init(_site, input);      updatePartName();      _site.setSelectionProvider(this);    }    catch (Exception e) {      throw new PartInitException("Failed to create EOModelEditorInput for " + _editorInput + ".", e);    }  }