private ActionCallMethod visitActionCallMethod(ActionCallMethod acm) { ActionCallMethod clone = new ActionCallMethod(); clone.setVariable(acm.getVariable()); clone.setState(acm.getState()); clone.setMethodName(acm.getMethodName()); for (ActionFieldValue aff : acm.getFieldValues()) { clone.addFieldValue(cloneActionFieldFunction((ActionFieldFunction) aff)); } return clone; }
private ActionCallMethod visitActionCallMethod(ActionCallMethod acm) { ActionCallMethod clone = new ActionCallMethod(); clone.setVariable(acm.getVariable()); clone.setState(acm.getState()); clone.setMethodName(acm.getMethodName()); for (ActionFieldValue aff : acm.getFieldValues()) { clone.addFieldValue(cloneActionFieldFunction((ActionFieldFunction) aff)); } return clone; }
private ActionSetField clone(final ActionSetField action) { if (action instanceof ActionUpdateField) { final ActionUpdateField auf = (ActionUpdateField) action; final ActionUpdateField clone = new ActionUpdateField(auf.getVariable()); clone.setFieldValues(auf.getFieldValues()); return clone; } else if (action instanceof ActionCallMethod) { final ActionCallMethod acm = (ActionCallMethod) action; final ActionCallMethod clone = new ActionCallMethod(acm.getVariable()); clone.setState(acm.getState()); clone.setMethodName(acm.getMethodName()); clone.setFieldValues(acm.getFieldValues()); return clone; } else if (action instanceof ActionSetField) { final ActionSetField clone = new ActionSetField(action.getVariable()); clone.setFieldValues(action.getFieldValues()); return clone; } else { return action; } } }
private Widget getSetterLabel() { HorizontalPanel horiz = new HorizontalPanel(); if (model.getState() == ActionCallMethod.TYPE_UNDEFINED) { Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact(); edit.setAltText(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue()); edit.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue()); edit.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showAddFieldPopup(w); } }); horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]")); // NON-NLS if (!this.readOnly) { horiz.add(edit); } } else { horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "." + model.getMethodName() + "]")); // NON-NLS } return horiz; }
private Widget getSetterLabel() { HorizontalPanel horiz = new HorizontalPanel(); if (model.getState() == ActionCallMethod.TYPE_UNDEFINED) { Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact(); edit.setAltText(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue()); edit.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue()); edit.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showAddFieldPopup(w); } }); horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]")); // NON-NLS if (!this.readOnly) { horiz.add(edit); } } else { horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "." + model.getMethodName() + "]")); // NON-NLS } return horiz; }