new HTML( " " ) );
layout.getFlexCellFormatter().setColSpan( 0,
0,
2 );
DirtyableFlexTable inner = new DirtyableFlexTable();
int col = 0;
for ( int i = 0; i < model.fieldValues.length; i++ ) {
ActionFieldValue val = model.fieldValues[i];
inner.setWidget( i,
0 + col,
fieldSelector( val ) );
inner.setWidget( i,
1 + col,
valueEditor( val ) );
final int idx = i;
Image remove = DroolsGuvnorImages.INSTANCE.DeleteItemSmall();
remove.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent event) {
if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
model.removeField( idx );
setModified( true );
getModeller().refreshWidget();
//Signal possible change in Template variables
TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( getModeller().getModel() );
getEventBus().fireEventFromSource( tvce,
getModeller().getModel() );
}
}
} );
if ( !this.readOnly ) {
inner.setWidget( i,
2 + col,
remove );
}
}