txtColumnHeader.setEnabled( true );
txtColumnHeader.setText( chosenConditionsSelection.getHeader() );
final String[] ops = presenter.getOperatorCompletions( availablePatternsSelection,
chosenConditionsSelection );
final CEPOperatorsDropdown ddOperator = new CEPOperatorsDropdown( ops,
chosenConditionsSelection );
ddOperatorContainer.setWidget( ddOperator );
criteriaExtendedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
criteriaLimitedEntry.setVisible( presenter.getTableFormat() == GuidedDecisionTable52.TableFormat.LIMITED_ENTRY );
// Fields specific to the table format
switch ( presenter.getTableFormat() ) {
case EXTENDED_ENTRY:
txtValueList.setEnabled( !presenter.requiresValueList( availablePatternsSelection,
chosenConditionsSelection ) );
txtValueList.setText( chosenConditionsSelection.getValueList() );
makeDefaultValueWidget();
defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );
if ( chosenConditionsSelection.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) {
txtPredicateExpression.setText( chosenConditionsSelection.getFactField() );
}
ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {
@Override
public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
chosenConditionsSelection.setOperator( event.getValue().getValue() );
final boolean requiresValueList = presenter.requiresValueList( availablePatternsSelection,
chosenConditionsSelection );
txtValueList.setEnabled( requiresValueList );
if ( !requiresValueList ) {
txtValueList.setText( "" );
}
presenter.stateChanged();
validateConditionOperator();
makeDefaultValueWidget();
defaultValueContainer.setVisible( validator.doesOperatorNeedValue( chosenConditionsSelection ) );
}
} );
switch ( chosenConditionsSelection.getConstraintValueType() ) {
case BaseSingleFieldConstraint.TYPE_LITERAL:
optLiteral.setValue( true );
displayCalculationTypes( availablePatternsSelection,
chosenConditionsSelection );
break;
case BaseSingleFieldConstraint.TYPE_RET_VALUE:
optFormula.setValue( true );
displayCalculationTypes( availablePatternsSelection,
chosenConditionsSelection );
break;
case BaseSingleFieldConstraint.TYPE_PREDICATE:
optPredicate.setValue( true );
displayCalculationTypes( availablePatternsSelection,
chosenConditionsSelection );
}
break;
case LIMITED_ENTRY:
calculationType.setVisible( false );
makeLimitedValueWidget();
// If operator changes the widget used to populate the
// value can change
ddOperator.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() {
@Override
public void onValueChange( ValueChangeEvent<OperatorSelection> event ) {
chosenConditionsSelection.setOperator( event.getValue().getValue() );
validateConditionOperator();