use of org.drools.workbench.screens.guided.rule.client.editor.events.TemplateVariablesChangedEvent in project drools-wb by kiegroup.
the class ActionInsertFactWidget method doLayout.
private void doLayout() {
layout.clear();
layout.setWidget(0, 0, getAssertLabel());
layout.setWidget(1, 0, new HTML(" "));
layout.getFlexCellFormatter().setColSpan(0, 0, 2);
FlexTable inner = new FlexTable();
int col = 0;
for (int i = 0; i < model.getFieldValues().length; i++) {
ActionFieldValue val = model.getFieldValues()[i];
inner.setWidget(i, 0 + col, fieldSelector(val));
inner.setWidget(i, 1 + col, valueEditor(val));
final int idx = i;
Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
remove.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.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);
}
}
layout.setWidget(1, 1, inner);
}
Aggregations