myRelationship = (EORelationship) ((IStructuredSelection) _selection).getFirstElement(); myNameField.setText(myRelationship.getName());
Object selectedObject = ((IStructuredSelection) _selection).getFirstElement(); if (selectedObject instanceof EORelationship) { myRelationship = (EORelationship) selectedObject; } else if (selectedObject instanceof EORelationshipPath) { myRelationship = ((EORelationshipPath) selectedObject).getChildRelationship(); } if (myContext != null) { myContext.dispose(); } myContext = BindingFactory.createContext(myComposite);
  public void setInput(IWorkbenchPart _part, ISelection _selection) {    super.setInput(_part, _selection);    myRelationship = (EORelationship) ((IStructuredSelection) _selection).getFirstElement();    myNameField.setText(myRelationship.getName());  }