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; }
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; }
if (action.getFieldValues().length == 0 && binding == null) { buf.append((isLogic) ? "insertLogical( new " : "insert( new "); buf.append("();\n"); generateSetMethodCalls(binding, action.getFieldValues());
protected void fixActionInsertFactBindings(final IAction[] rhs) { final Set<String> existingBindings = extractExistingActionBindings(rhs); for (IAction action : rhs) { if (action instanceof ActionInsertFact) { final ActionInsertFact aif = (ActionInsertFact) action; if (aif.getFieldValues().length > 0 && aif.getBoundName() == null) { int idx = 0; String binding = "fact" + idx; while (existingBindings.contains(binding)) { idx++; binding = "fact" + idx; } existingBindings.add(binding); aif.setBoundName(binding); } } } }
private void visitActionFieldList(ActionInsertFact afl) { String factType = afl.getFactType(); for (ActionFieldValue afv : afl.getFieldValues()) { InterpolationVariable var = new InterpolationVariable(afv.getValue(), afv.getType(), factType, afv.getField()); if (afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.containsKey(var)) { vars.put(var, vars.size()); } } }
private void visitActionFieldList(final ActionInsertFact afl) { String factType = afl.getFactType(); for (ActionFieldValue afv : afl.getFieldValues()) { InterpolationVariable var = new InterpolationVariable(afv.getValue(), afv.getType(), factType, afv.getField()); if (afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.contains(var)) { vars.add(var); } else { hasNonTemplateOutput = true; } } }
@Before public void setUp() throws Exception { doReturn(oracle).when(modeller).getDataModelOracle(); doReturn(new ActionFieldValue[0]).when(action).getFieldValues(); testedWidget = spy(new ActionInsertFactWidget(modeller, eventBus, action, readOnly)); }
@Before public void setUp() throws Exception { doReturn(oracle).when(modeller).getDataModelOracle(); doReturn(new ActionFieldValue[0]).when(action).getFieldValues(); testedWidget = spy(new ActionInsertFactWidget(modeller, eventBus, action, readOnly)); }
private Widget getAssertLabel() { ClickHandler cl = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showAddFieldPopup(w); } }; String assertType = "assert"; //NON-NLS if (this.model instanceof ActionInsertLogicalFact) { assertType = "assertLogical"; //NON-NLS } String lbl = (model.isBound() == false) ? HumanReadable.getActionDisplayName(assertType) + " <b>" + this.model.getFactType() + "</b>" : HumanReadable.getActionDisplayName(assertType) + " <b>" + this.model.getFactType() + "</b>" + " <b>[" + model.getBoundName() + "]</b>"; if (this.model.getFieldValues() != null && model.getFieldValues().length > 0) { lbl = lbl + ":"; } return new ClickableLabel(lbl, cl, !this.readOnly); }
private Widget getAssertLabel() { ClickHandler cl = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showAddFieldPopup(w); } }; String assertType = "assert"; //NON-NLS if (this.model instanceof ActionInsertLogicalFact) { assertType = "assertLogical"; //NON-NLS } String lbl = (model.isBound() == false) ? HumanReadable.getActionDisplayName(assertType) + " <b>" + this.model.getFactType() + "</b>" : HumanReadable.getActionDisplayName(assertType) + " <b>" + this.model.getFactType() + "</b>" + " <b>[" + model.getBoundName() + "]</b>"; if (this.model.getFieldValues() != null && model.getFieldValues().length > 0) { lbl = lbl + ":"; } return new ClickableLabel(lbl, cl, !this.readOnly); }
int col = 0; for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldValue val = model.getFieldValues()[i];
int col = 0; for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldValue val = model.getFieldValues()[i];
private ActionInsertFact visitActionFieldList(ActionInsertFact afl) { ActionInsertFact clone = new ActionInsertFact(); clone.setFactType(afl.getFactType()); clone.setBoundName(afl.getBoundName()); for (ActionFieldValue afv : afl.getFieldValues()) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField(afv.getField()); afvClone.setNature(afv.getNature()); afvClone.setType(afv.getType()); afvClone.setValue(afv.getValue()); clone.addFieldValue(afvClone); } return clone; }
private ActionInsertFact visitActionFieldList(ActionInsertFact afl) { ActionInsertFact clone = new ActionInsertFact(); clone.setFactType(afl.getFactType()); clone.setBoundName(afl.getBoundName()); for (ActionFieldValue afv : afl.getFieldValues()) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField(afv.getField()); afvClone.setNature(afv.getNature()); afvClone.setType(afv.getType()); afvClone.setValue(afv.getValue()); clone.addFieldValue(afvClone); } return clone; }
a4.getFactType()); assertEquals(2, a4.getFieldValues().length); a4.getFieldValues()[0].getField()); assertEquals("actioninsertfact1", a4.getFieldValues()[0].getValue()); assertEquals(DataType.TYPE_NUMERIC_INTEGER, a4.getFieldValues()[0].getType()); a4.getFieldValues()[1].getField()); assertEquals("actioninsertfact2", a4.getFieldValues()[1].getValue()); assertEquals(DataType.TYPE_NUMERIC_INTEGER, a4.getFieldValues()[1].getType());
null, DataType.TYPE_STRING)); aif1.getFieldValues()[0].setNature(BaseSingleFieldConstraint.TYPE_LITERAL); null, DataType.TYPE_STRING)); aif2.getFieldValues()[0].setNature(BaseSingleFieldConstraint.TYPE_LITERAL); model.addRhsItem(aif2); raif2.getFactType()); assertEquals("rating", raif2.getFieldValues()[0].getField()); assertEquals(DataType.TYPE_STRING, raif2.getFieldValues()[0].getType()); assertNull(raif2.getFieldValues()[0].getValue()); assertEquals(BaseSingleFieldConstraint.TYPE_LITERAL, raif2.getFieldValues()[0].getNature());
null, DataType.TYPE_STRING)); aif.getFieldValues()[0].setNature(BaseSingleFieldConstraint.TYPE_LITERAL); raif2.getFactType()); assertEquals("rating", raif2.getFieldValues()[0].getField()); assertEquals(DataType.TYPE_STRING, raif2.getFieldValues()[0].getType()); assertNull(raif2.getFieldValues()[0].getValue()); assertEquals(BaseSingleFieldConstraint.TYPE_LITERAL, raif2.getFieldValues()[0].getNature());
null, DataType.TYPE_STRING)); aif.getFieldValues()[0].setNature(BaseSingleFieldConstraint.TYPE_LITERAL); model.addRhsItem(aif); raif2.getFactType()); assertEquals("rating", raif2.getFieldValues()[0].getField()); assertEquals(DataType.TYPE_STRING, raif2.getFieldValues()[0].getType()); assertNull(raif2.getFieldValues()[0].getValue()); assertEquals(BaseSingleFieldConstraint.TYPE_LITERAL, raif2.getFieldValues()[0].getNature());
"$r"); assertEquals(1, aif.getFieldValues().length); ActionFieldValue fv1 = aif.getFieldValues()[0]; assertNotNull(fv1); assertTrue(fv1 instanceof ActionWorkItemFieldValue);
null, DataType.TYPE_STRING)); aif.getFieldValues()[0].setNature(BaseSingleFieldConstraint.TYPE_LITERAL); raif3.getFactType()); assertEquals("rating", raif3.getFieldValues()[0].getField()); assertEquals(DataType.TYPE_STRING, raif3.getFieldValues()[0].getType()); assertNull(raif3.getFieldValues()[0].getValue()); assertEquals(BaseSingleFieldConstraint.TYPE_LITERAL, raif3.getFieldValues()[0].getNature());