private void setEnums(DropDownData enums) { if (methodParameter.getType().equals(DataType.TYPE_BOOLEAN)) { this.enums = DropDownData.create(new String[]{"true", "false"}); } else { this.enums = enums; } }
private void setEnums(DropDownData enums) { if (methodParameter.getType().equals(DataType.TYPE_BOOLEAN)) { this.enums = DropDownData.create(new String[]{"true", "false"}); } else { this.enums = enums; } }
private void addVariables( final Iterator<String> variables) { if (variables.hasNext()) { final String variable = variables.next(); final String factType = factTypesByVariables.get(variable); if (factType.equals(this.methodParameter.getType())) { addItem(variable); addVariables(variables); } else { matcher.isThereAMatchingSuperType( factType, methodParameter.getType(), new Callback<Boolean>() { @Override public void callback(Boolean result) { if (result) { addItem(variable); } addVariables(variables); } }); } } else { setSelectedIndex(); } }
private void addVariables( final Iterator<String> variables) { if (variables.hasNext()) { final String variable = variables.next(); final String factType = factTypesByVariables.get(variable); if (factType.equals(this.methodParameter.getType())) { addItem(variable); addVariables(variables); } else { matcher.isThereAMatchingSuperType( factType, methodParameter.getType(), new Callback<Boolean>() { @Override public void callback(Boolean result) { if (result) { addItem(variable); } addVariables(variables); } }); } } else { setSelectedIndex(); } }
public MethodParameterValueEditor(final AsyncPackageDataModelOracle oracle, final ActionFieldFunction val, final DropDownData enums, final RuleModeller modeller, final Command onValueChangeCommand) { this.oracle = oracle; this.methodParameter = val; this.modeller = modeller; this.parameterType = val.getType(); this.onValueChangeCommand = onValueChangeCommand; setEnums(enums); refresh(); initWidget(root); }
public MethodParameterValueEditor(final AsyncPackageDataModelOracle oracle, final ActionFieldFunction val, final DropDownData enums, final RuleModeller modeller, final Command onValueChangeCommand) { this.oracle = oracle; this.methodParameter = val; this.modeller = modeller; this.parameterType = val.getType(); this.onValueChangeCommand = onValueChangeCommand; setEnums(enums); refresh(); initWidget(root); }
private TextBox boundLiteralTextBox() { final TextBox box = TextBoxFactory.getTextBox(methodParameter.getType()); // We need both handlers, since The textbox TextBoxFactory can return a box that changes the value in itself box.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { setMethodParameterValue(box.getValue()); } }); box.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { setMethodParameterValue(box.getValue()); } }); box.setStyleName("constraint-value-Editor"); if (this.methodParameter.getValue() != null || this.methodParameter.getValue().isEmpty()) { box.setValue(this.methodParameter.getValue()); } // This updates the model setMethodParameterValue(box.getValue()); return box; }
private ActionFieldFunction cloneActionFieldFunction(ActionFieldFunction aff) { ActionFieldFunction clone = new ActionFieldFunction(); clone.setField(aff.getField()); clone.setNature(aff.getNature()); clone.setType(aff.getType()); clone.setValue(aff.getValue()); clone.setMethod(aff.getMethod()); return clone; }
private TextBox boundLiteralTextBox() { final TextBox box = TextBoxFactory.getTextBox(methodParameter.getType()); // We need both handlers, since The textbox TextBoxFactory can return a box that changes the value in itself box.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { setMethodParameterValue(box.getValue()); } }); box.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { setMethodParameterValue(box.getValue()); } }); box.setStyleName("constraint-value-Editor"); if (this.methodParameter.getValue() != null || this.methodParameter.getValue().isEmpty()) { box.setValue(this.methodParameter.getValue()); } // This updates the model setMethodParameterValue(box.getValue()); return box; }
private ActionFieldFunction cloneActionFieldFunction(ActionFieldFunction aff) { ActionFieldFunction clone = new ActionFieldFunction(); clone.setField(aff.getField()); clone.setNature(aff.getNature()); clone.setType(aff.getType()); clone.setValue(aff.getValue()); clone.setMethod(aff.getMethod()); return clone; }
private void doLayout() { layout.clear(); layout.setWidget(0, 0, getSetterLabel()); FlexTable inner = new FlexTable(); for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldFunction val = model.getFieldValue(i); inner.setWidget(i, 0, typeLabel(val.getType())); inner.setWidget(i, 1, valueEditor(val)); } layout.setWidget(0, 1, inner); }
private void doLayout() { layout.clear(); layout.setWidget(0, 0, getSetterLabel()); FlexTable inner = new FlexTable(); for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldFunction val = model.getFieldValue(i); inner.setWidget(i, 0, typeLabel(val.getType())); inner.setWidget(i, 1, valueEditor(val)); } layout.setWidget(0, 1, inner); }