IStructuredSelection previousSelection = mySelection; IStructuredSelection selection = (IStructuredSelection) _selection; mySelection = selection; if (previousSelection == null || !selection.toList().equals(previousSelection.toList())) { Object selectedObject = null; if (!selection.isEmpty()) { selectedObject = selection.getFirstElement(); } if (selectedObject instanceof EOModel) { EOModel selectedModel = (EOModel) selectedObject; System.out.println("EOModelEditor.setSelection: model = " + selectedModel); } else if (selectedObject instanceof EOEntity) { EOEntity selectedEntity = (EOEntity) selectedObject; setSelectedEntity(selectedEntity); } else if (selectedObject instanceof EOAttribute) {  } else if (selectedObject instanceof EORelationship) { EORelationship selectedRelationship = (EORelationship) selectedObject; getEntityEditor().setEntity(selectedRelationship.getEntity()); getEntityEditor().setSelection(selection); setActivePage(1); } else if (selectedObject instanceof EORelationshipPath) { EORelationshipPath selectedRelationshipPath = (EORelationshipPath) selectedObject; getEntityEditor().setEntity(selectedRelationshipPath.getChildRelationship().getEntity()); getEntityEditor().setSelection(new StructuredSelection(selectedRelationshipPath.getChildRelationship())); setActivePage(1); } getContentOutlinePage().setSelection(selection); fireSelectionChanged(selection); }
setSelection(_selection, true);
  public void setSelection(ISelection _selection) {    IStructuredSelection previousSelection = mySelection;    IStructuredSelection selection = (IStructuredSelection) _selection;    mySelection = selection;    if (previousSelection == null || !selection.toList().equals(previousSelection.toList())) {      Object selectedObject = null;      if (!selection.isEmpty()) {        selectedObject = selection.getFirstElement();      }      if (selectedObject instanceof EOModel) {        EOModel selectedModel = (EOModel) selectedObject;        System.out.println("EOModelEditor.setSelection: model = " + selectedModel);      }      else if (selectedObject instanceof EOEntity) {        EOEntity selectedEntity = (EOEntity) selectedObject;        setSelectedEntity(selectedEntity);      }      else if (selectedObject instanceof EOAttribute) {        //((ISelectionProvider) getActiveEditor()).setSelection(_selection);      }      else if (selectedObject instanceof EORelationship) {        EORelationship selectedRelationship = (EORelationship) selectedObject;        getEntityEditor().setEntity(selectedRelationship.getEntity());        getEntityEditor().setSelection(selection);        setActivePage(1);      }      else if (selectedObject instanceof EORelationshipPath) {        EORelationshipPath selectedRelationshipPath = (EORelationshipPath) selectedObject;        getEntityEditor().setEntity(selectedRelationshipPath.getChildRelationship().getEntity());        getEntityEditor().setSelection(new StructuredSelection(selectedRelationshipPath.getChildRelationship()));        setActivePage(1);      }      getContentOutlinePage().setSelection(selection);      fireSelectionChanged(selection);    }  }