box.addItem( fields[ i ] );
}
box.setSelectedIndex( 0 );
box.addChangeHandler( new ChangeHandler() {
public void onChange( ChangeEvent event ) {
String factType = pattern.getFactType();
String fieldName = box.getItemText( box.getSelectedIndex() );
String fieldType = getCompletions().getFieldType( factType,
fieldName );
hasConstraints.addConstraint( new SingleFieldConstraint( factType,
fieldName,
fieldType,
null ) );
modeller.refreshWidget();
popup.hide();
}
} );
popup.addAttribute( Constants.INSTANCE.AddARestrictionOnAField(),
box );
final ListBox composites = new ListBox();
composites.addItem( "..." ); //NON-NLS
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() ) );
hasConstraints.addConstraint( comp );
modeller.refreshWidget();