myBindingContext = BindingFactory.createContext(); myBindingContext.bind(myNumberOfToManyFaultsToBatchFetchText, new Property(myRelationship, EORelationship.NUMBER_OF_TO_MANY_FAULTS_TO_BATCH_FETCH), new BindSpec(null, null, new RegexStringValidator("^[0-9]*$", "^[0-9]$", "Please enter a number"), null)); myBindingContext.bind(myOwnsDestinationButton, new Property(myRelationship, EORelationship.OWNS_DESTINATION), null); myBindingContext.bind(myPropagatesPrimaryKeyButton, new Property(myRelationship, EORelationship.PROPAGATES_PRIMARY_KEY), null); updateCardinalityEnabled();
  public void setInput(IWorkbenchPart _part, ISelection _selection) {    super.setInput(_part, _selection);    disposeBindings();    Object selectedObject = ((IStructuredSelection) _selection).getFirstElement();    if (selectedObject instanceof EORelationship) {      myRelationship = (EORelationship) selectedObject;    }    else if (selectedObject instanceof EORelationshipPath) {      myRelationship = ((EORelationshipPath) selectedObject).getChildRelationship();    }    if (myRelationship != null) {      myRelationship.addPropertyChangeListener(EORelationship.TO_MANY, myRelationshipPropertyChangeListener);    }    myBindingContext = BindingFactory.createContext();    myBindingContext.bind(myNumberOfToManyFaultsToBatchFetchText, new Property(myRelationship, EORelationship.NUMBER_OF_TO_MANY_FAULTS_TO_BATCH_FETCH), new BindSpec(null, null, new RegexStringValidator("^[0-9]*$", "^[0-9]$", "Please enter a number"), null));    myBindingContext.bind(myOwnsDestinationButton, new Property(myRelationship, EORelationship.OWNS_DESTINATION), null);    myBindingContext.bind(myPropagatesPrimaryKeyButton, new Property(myRelationship, EORelationship.PROPAGATES_PRIMARY_KEY), null);    updateCardinalityEnabled();  }