use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class RuleModellerActionSelectorPopup method addLogicalInsertions.
// Add logical insertions
void addLogicalInsertions() {
if (oracle.getFactTypes().length == 0) {
return;
}
choices.addItem(SECTION_SEPARATOR);
for (int i = 0; i < oracle.getFactTypes().length; i++) {
final String item = oracle.getFactTypes()[i];
choices.addItem(GuidedRuleEditorResources.CONSTANTS.LogicallyInsertFact0(item), "LINS" + item);
cmds.put("LINS" + item, new Command() {
public void execute() {
model.addRhsItem(new ActionInsertLogicalFact(item), Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex())));
hide();
}
});
}
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class RuleModellerActionSelectorPopup method addUpdateNotModify.
// Add update, not modify
void addUpdateNotModify() {
List<String> vars = model.getLHSPatternVariables();
if (vars.size() == 0) {
return;
}
choices.addItem(SECTION_SEPARATOR);
for (Iterator<String> iter = vars.iterator(); iter.hasNext(); ) {
final String v = iter.next();
choices.addItem(GuidedRuleEditorResources.CONSTANTS.ChangeFieldValuesOf0(v), "VAR" + v);
cmds.put("VAR" + v, new Command() {
public void execute() {
addActionSetField(v, Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex())));
hide();
}
});
}
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class RuleModellerActionSelectorPopup method addInsertions.
// Add insertions
void addInsertions() {
if (oracle.getFactTypes().length == 0) {
return;
}
choices.addItem(SECTION_SEPARATOR);
for (int i = 0; i < oracle.getFactTypes().length; i++) {
final String item = oracle.getFactTypes()[i];
choices.addItem(GuidedRuleEditorResources.CONSTANTS.InsertFact0(item), "INS" + item);
cmds.put("INS" + item, new Command() {
public void execute() {
model.addRhsItem(new ActionInsertFact(item), Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex())));
hide();
}
});
}
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class ActionInsertFactWidget method valueEditor.
ActionValueEditor valueEditor(final ActionFieldValue actionFieldValue) {
final ActionValueEditor actionValueEditor = actionValueEditor(factType, actionFieldValue, model.getFieldValues(), readOnly);
actionValueEditor.setOnChangeCommand(new Command() {
public void execute() {
RefreshUtil.refreshActionValueEditorsDropDownData(actionValueEditors, actionFieldValue);
setModified(true);
}
});
// Keep a reference to the value editors so they can be refreshed for dependent enums
actionValueEditors.put(actionFieldValue, actionValueEditor);
return actionValueEditor;
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class CompositeFactPatternWidget method doLayout.
protected void doLayout() {
this.layout.setWidget(0, 0, getCompositeLabel());
this.layout.getFlexCellFormatter().setColSpan(0, 0, 2);
// this.layout.getFlexCellFormatter().setWidth(0, 0, "15%");
this.layout.setWidget(1, 0, new HTML(" "));
if (this.pattern.getPatterns() != null) {
DirtyableVerticalPane vert = new DirtyableVerticalPane();
IFactPattern[] facts = pattern.getPatterns();
for (int i = 0; i < facts.length; i++) {
RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget(this.getModeller(), this.getEventBus(), facts[i], this.readOnly);
widget.addOnModifiedCommand(new Command() {
public void execute() {
setModified(true);
}
});
// Wrap widget so the Fact pattern can be deleted
vert.add(wrapLHSWidget(pattern, i, widget));
vert.add(spacerWidget());
}
this.layout.setWidget(1, 1, vert);
}
}
Aggregations