@Test public void testInitTextBoxByRuleAttribute() { final TextBox textBox = mock(TextBox.class); final String attributeValue = "123"; doReturn(attributeValue).when(ruleAttribute).getValue(); factory.initTextBoxByRuleAttribute(textBox, ruleAttribute); verify(textBox).setEnabled(!isReadOnly); verify(textBox).setValue(attributeValue); }
protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); }
EditAttributeWidgetFactory { protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); } }
EditAttributeWidgetFactory { protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); } EditAttributeWidgetFactory(final boolean isReadOnly); }
EditAttributeWidgetFactory { protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); } EditAttributeWidgetFactory(final boolean isReadOnly); TextBox textBox(final RuleAttribute ruleAttribute, final String dataType); DatePicker datePicker(final RuleAttribute ruleAttribute, final boolean allowEmptyValues); }
EditAttributeWidgetFactory { protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); } EditAttributeWidgetFactory(final boolean isReadOnly); TextBox textBox(final RuleAttribute ruleAttribute, final String dataType); DatePicker datePicker(final RuleAttribute ruleAttribute, final boolean allowEmptyValues);  }