}
};
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from collect" ) + "</div>";
DirtyableFlexTable panel = new DirtyableFlexTable();
int r = 0;
if ( pattern.getFactPattern() == null ) {
panel.setWidget( r++,
0,
new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
leftPatternclick,
!this.readOnly ) );
}
panel.setWidget( r++,
0,
new HTML( lbl ) );
if ( this.getFromCollectPattern().getRightPattern() == null ) {
panel.setWidget( r++,
0,
new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
rightPatternclick,
!this.readOnly ) );
} else {
IPattern rPattern = this.getFromCollectPattern().getRightPattern();
RuleModellerWidget patternWidget = null;
if ( rPattern instanceof FactPattern) {
patternWidget = new FactPatternWidget( this.getModeller(),
this.getEventBus(),
rPattern,
true,
true,
this.readOnly );
} else if ( rPattern instanceof FromAccumulateCompositeFactPattern) {
patternWidget = new FromAccumulateCompositeFactPatternWidget( this.getModeller(),
this.getEventBus(),
(FromAccumulateCompositeFactPattern) rPattern,
this.readOnly );
} else if ( rPattern instanceof FromCollectCompositeFactPattern ) {
patternWidget = new FromCollectCompositeFactPatternWidget( this.getModeller(),
this.getEventBus(),
(FromCollectCompositeFactPattern) rPattern,
this.readOnly );
} else if ( rPattern instanceof FromEntryPointFactPattern ) {
patternWidget = new FromEntryPointFactPatternWidget( this.getModeller(),
this.getEventBus(),
(FromEntryPointFactPattern) rPattern,
this.readOnly );
} else if ( rPattern instanceof FromCompositeFactPattern ) {
patternWidget = new FromCompositeFactPatternWidget( this.getModeller(),
this.getEventBus(),
(FromCompositeFactPattern) rPattern,
this.readOnly );
} else if ( rPattern instanceof FreeFormLine) {
patternWidget = new FreeFormLineWidget( this.getModeller(),
this.getEventBus(),
(FreeFormLine) rPattern,
this.readOnly );
} else {
throw new IllegalArgumentException( "Unsuported pattern " + rPattern + " for right side of FROM COLLECT" );
}
patternWidget.addOnModifiedCommand( new Command() {
public void execute() {
setModified( true );
}
} );
panel.setWidget( r++,
0,
addRemoveButton( patternWidget,
new ClickHandler() {
public void onClick( ClickEvent event ) {