IAction action = model.rhs[ i ];
//if lockRHS() set the widget RO, otherwise let them decide.
Boolean readOnly = this.lockRHS() ? true : null;
RuleModellerWidget w = getWidgetFactory().getWidget( this,
eventBus,
action,
readOnly );
w.addOnModifiedCommand( this.onWidgetModifiedCommand );
widget.add( wrapRHSWidget( model,
i,
w ) );
widget.add( spacerWidget() );
layout.setWidget( currentLayoutRow,
0,
new DirtyableHorizontalPane() );
layout.setWidget( currentLayoutRow,
1,
new DirtyableHorizontalPane() );
layout.setWidget( currentLayoutRow,
2,
this.wrapLineNumber( i + 1,
false ) );
layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
2,
HasHorizontalAlignment.ALIGN_CENTER );
layout.getFlexCellFormatter().setVerticalAlignment( currentLayoutRow,
2,
HasVerticalAlignment.ALIGN_MIDDLE );
layout.setWidget( currentLayoutRow,
3,
widget );
layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
3,
HasHorizontalAlignment.ALIGN_LEFT );
layout.getFlexCellFormatter().setVerticalAlignment( currentLayoutRow,
3,
HasVerticalAlignment.ALIGN_TOP );
layout.getFlexCellFormatter().setWidth( currentLayoutRow,
3,
"100%" );
if ( !w.isFactTypeKnown() ) {
final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
image.setTitle( GuidedRuleEditorResources.CONSTANTS.InvalidPatternSectionDisabled() );
this.addLineIcon( currentLayoutRow,
0,
image );
}
final int index = i;
if ( !( this.lockRHS() || w.isReadOnly() ) ) {
this.addActionsButtonsToLayout( GuidedRuleEditorResources.CONSTANTS.AddAnActionBelow(),
new ClickHandler() {
public void onClick( ClickEvent event ) {
showActionSelector( (Widget) event.getSource(),