if ( this.constraint instanceof SingleFieldConstraint ) {
SingleFieldConstraint sfc = (SingleFieldConstraint) this.constraint;
operator = sfc.getOperator();
}
if ( OperatorsOracle.operatorRequiresList( operator ) ) {
final TextBox box = TextBoxFactory.getTextBox( DataType.TYPE_STRING );
box.setStyleName( "constraint-value-Editor" );
box.addChangeHandler( new ChangeHandler() {
public void onChange( ChangeEvent event ) {
constraint.setValue( box.getText() );
executeOnValueChangeCommand();
makeDirty();
}
} );
box.setText( assertValue() );
attachDisplayLengthHandler( box );
return box;
}
//Date picker
boolean isCEPOperator = false;
if ( this.constraint instanceof HasOperator ) {
isCEPOperator = CEPOracle.isCEPOperator( ( (HasOperator) this.constraint ).getOperator() );
}
if ( DataType.TYPE_DATE.equals( this.fieldType ) || ( DataType.TYPE_THIS.equals( this.fieldName ) && isCEPOperator ) ) {
if ( this.readOnly ) {
return new SmallLabel( constraint.getValue() );
}
final PopupDatePicker dp = new PopupDatePicker( false );
// Wire up update handler
dp.addValueChangeHandler( new ValueChangeHandler<Date>() {
public void onValueChange( ValueChangeEvent<Date> event ) {
constraint.setValue( PopupDatePicker.convertToString( event ) );
executeOnValueChangeCommand();
}
} );
dp.setValue( assertValue() );
return dp;
}
//Default editor for all other literals
final TextBox box = TextBoxFactory.getTextBox( fieldType );
box.setStyleName( "constraint-value-Editor" );
box.addChangeHandler( new ChangeHandler() {
public void onChange( ChangeEvent event ) {
constraint.setValue( box.getText() );
executeOnValueChangeCommand();
makeDirty();
}
} );
box.setText( assertValue() );
attachDisplayLengthHandler( box );
return box;
}