HorizontalPanel pattern = new HorizontalPanel();
pattern.add( patternLabel );
doPatternLabel();
//Pattern selector
ImageButton changePattern = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
GuidedDecisionTableConstants.INSTANCE.ChooseAnExistingPatternThatThisColumnAddsTo(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
showChangePattern( w );
}
} );
changePattern.setEnabled( !isReadOnly );
pattern.add( changePattern );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Pattern(),
pattern );
//Radio buttons for Calculation Type
switch ( model.getTableFormat() ) {
case EXTENDED_ENTRY:
HorizontalPanel valueTypes = new HorizontalPanel();
valueTypes.add( literal );
valueTypes.add( formula );
valueTypes.add( predicate );
addAttribute( new StringBuilder( GuidedDecisionTableConstants.INSTANCE.CalculationType() ).append( GuidedDecisionTableConstants.COLON ).toString(),
valueTypes );
switch ( editingCol.getConstraintValueType() ) {
case BaseSingleFieldConstraint.TYPE_LITERAL:
literal.setValue( true );
break;
case BaseSingleFieldConstraint.TYPE_RET_VALUE:
formula.setValue( true );
break;
case BaseSingleFieldConstraint.TYPE_PREDICATE:
predicate.setValue( true );
}
if ( !isReadOnly ) {
literal.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent w ) {
editingCol.setFactField( null );
applyConsTypeChange( BaseSingleFieldConstraint.TYPE_LITERAL );
}
} );
}
if ( !isReadOnly ) {
formula.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent w ) {
editingCol.setFactField( null );
applyConsTypeChange( BaseSingleFieldConstraint.TYPE_RET_VALUE );
}
} );
}
if ( !isReadOnly ) {
predicate.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent w ) {
editingCol.setFactField( null );
applyConsTypeChange( BaseSingleFieldConstraint.TYPE_PREDICATE );
}
} );
}
break;
case LIMITED_ENTRY:
binding.setEnabled( !isReadOnly );
}
//Fact field
HorizontalPanel field = new HorizontalPanel();
fieldLabel.setEnabled( !isReadOnly );
field.add( fieldLabel );
field.add( fieldLabelInterpolationInfo );
this.editField = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
GuidedDecisionTableConstants.INSTANCE.EditTheFieldThatThisColumnOperatesOn(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
showFieldChange();
}
} );
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( new StringBuilder( GuidedDecisionTableConstants.INSTANCE.Field() ).append( GuidedDecisionTableConstants.COLON ).toString(),
field );
doFieldLabel();
//Operator
HorizontalPanel operator = new HorizontalPanel();
operator.add( operatorLabel );
this.editOp = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
GuidedDecisionTableConstants.INSTANCE.EditTheOperatorThatIsUsedToCompareDataWithThisField(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
showOperatorChange();