if ( "...".equals( fieldName ) ) {
return;
}
String fieldType = completions.getFieldType( factType,
fieldName );
fp.addConstraint( new SingleFieldConstraint( factType,
fieldName,
fieldType,
con ) );
modeller.refreshWidget();
popup.hide();
}
} );
popup.addAttribute( Constants.INSTANCE.AddARestrictionOnAField(),
box );
final ListBox composites = new ListBox();
composites.addItem( "..." );
composites.addItem( Constants.INSTANCE.AllOfAnd(),
CompositeFieldConstraint.COMPOSITE_TYPE_AND );
composites.addItem( Constants.INSTANCE.AnyOfOr(),
CompositeFieldConstraint.COMPOSITE_TYPE_OR );
composites.setSelectedIndex( 0 );
composites.addChangeHandler( new ChangeHandler() {
public void onChange( ChangeEvent event ) {
CompositeFieldConstraint comp = new CompositeFieldConstraint();
comp.setCompositeJunctionType( composites.getValue( composites.getSelectedIndex() ) );
fp.addConstraint( comp );
modeller.refreshWidget();
popup.hide();
}
} );
InfoPopup infoComp = new InfoPopup( Constants.INSTANCE.MultipleFieldConstraints(),
Constants.INSTANCE.MultipleConstraintsTip1() );
HorizontalPanel horiz = new HorizontalPanel();
horiz.add( composites );
horiz.add( infoComp );
if ( con == null ) {
popup.addAttribute( Constants.INSTANCE.MultipleFieldConstraint(),
horiz );
}
if ( con == null ) {
popup.addRow( new SmallLabel( "<i>" + Constants.INSTANCE.AdvancedOptionsColon() + "</i>" ) ); //NON-NLS
Button predicate = new Button( Constants.INSTANCE.NewFormula() );
predicate.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
SingleFieldConstraint con = new SingleFieldConstraint();
con.setConstraintValueType( SingleFieldConstraint.TYPE_PREDICATE );
fp.addConstraint( con );
modeller.refreshWidget();
popup.hide();
}
} );
popup.addAttribute( Constants.INSTANCE.AddANewFormulaStyleExpression(),
predicate );
Button ebBtn = new Button( Constants.INSTANCE.ExpressionEditor() );
ebBtn.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();
con.setConstraintValueType( SingleFieldConstraint.TYPE_UNDEFINED );
fp.addConstraint( con );
con.setExpressionLeftSide( new ExpressionFormLine( new ExpressionUnboundFact( pattern ) ) );
modeller.refreshWidget();
popup.hide();
}
} );
popup.addAttribute( Constants.INSTANCE.ExpressionEditor(),