@Test public void editorClearsPreviousValuesWhenNewValueIsNull() throws Exception { uut.setValue(null); verify(checkedArgOptionMock).clear(); verify(checkedValueMock).clear(); verify(unCheckedArgOptionMock).clear(); verify(unCheckedValueMock).clear(); verify(checkedArgOptionMock).setValue(eq("")); verify(checkedValueMock).setValue(eq("")); verify(unCheckedArgOptionMock).setValue(eq("")); verify(unCheckedValueMock).setValue(eq("")); verifyNoMoreInteractions(checkedArgOptionMock, checkedValueMock, unCheckedArgOptionMock, unCheckedValueMock); }
@Override public void setValue(String value) { this.flagArgModel = value; checkedArgOption1.clear(); checkedValue1.clear(); unCheckedArgOption1.clear(); unCheckedValue1.clear(); checkedArgOption1.setValue(""); checkedValue1.setValue(""); unCheckedArgOption1.setValue(""); unCheckedValue1.setValue(""); LinkedList<String> newLinkedList = Lists.newLinkedList(Splitter.on(",").trimResults().split(Strings.nullToEmpty(value))); if (!Strings.isNullOrEmpty(newLinkedList.peek())) { setCheckedFields(newLinkedList.removeFirst()); if (newLinkedList.peek() != null) { setUncheckedFields(newLinkedList.removeFirst()); } } }
FlagArgumentOptionEditor implements ValueAwareEditor<String>, LeafValueEditor<String>, InvalidEvent.InvalidHandler, ValueChangeHandler<String>, HasValueChangeHandlers<String> { @Override public void setValue(String value) { this.flagArgModel = value; checkedArgOption1.clear(); checkedValue1.clear(); unCheckedArgOption1.clear(); unCheckedValue1.clear(); checkedArgOption1.setValue(""); checkedValue1.setValue(""); unCheckedArgOption1.setValue(""); unCheckedValue1.setValue(""); LinkedList<String> newLinkedList = Lists.newLinkedList(Splitter.on(",").trimResults().split(Strings.nullToEmpty(value))); if (!Strings.isNullOrEmpty(newLinkedList.peek())) { setCheckedFields(newLinkedList.removeFirst()); if (newLinkedList.peek() != null) { setUncheckedFields(newLinkedList.removeFirst()); } } } }
FlagArgumentOptionEditor implements ValueAwareEditor<String>, LeafValueEditor<String>, InvalidEvent.InvalidHandler, ValueChangeHandler<String>, HasValueChangeHandlers<String> { @Override public void setValue(String value) { this.flagArgModel = value; checkedArgOption1.clear(); checkedValue1.clear(); unCheckedArgOption1.clear(); unCheckedValue1.clear(); checkedArgOption1.setValue(""); checkedValue1.setValue(""); unCheckedArgOption1.setValue(""); unCheckedValue1.setValue(""); LinkedList<String> newLinkedList = Lists.newLinkedList(Splitter.on(",").trimResults().split(Strings.nullToEmpty(value))); if (!Strings.isNullOrEmpty(newLinkedList.peek())) { setCheckedFields(newLinkedList.removeFirst()); if (newLinkedList.peek() != null) { setUncheckedFields(newLinkedList.removeFirst()); } } } FlagArgumentOptionEditor(TextField checkedArgOption, TextField checkedValue,
                                    TextField unCheckedArgOption, TextField unCheckedValue,
                                    final IplantValidationConstants validationConstants); }
FlagArgumentOptionEditor implements ValueAwareEditor<String>, LeafValueEditor<String>, InvalidEvent.InvalidHandler, ValueChangeHandler<String>, HasValueChangeHandlers<String> { @Override public void setValue(String value) { this.flagArgModel = value; checkedArgOption1.clear(); checkedValue1.clear(); unCheckedArgOption1.clear(); unCheckedValue1.clear(); checkedArgOption1.setValue(""); checkedValue1.setValue(""); unCheckedArgOption1.setValue(""); unCheckedValue1.setValue(""); LinkedList<String> newLinkedList = Lists.newLinkedList(Splitter.on(",").trimResults().split(Strings.nullToEmpty(value))); if (!Strings.isNullOrEmpty(newLinkedList.peek())) { setCheckedFields(newLinkedList.removeFirst()); if (newLinkedList.peek() != null) { setUncheckedFields(newLinkedList.removeFirst()); } } } FlagArgumentOptionEditor(TextField checkedArgOption, TextField checkedValue,
                                    TextField unCheckedArgOption, TextField unCheckedValue,
                                    final IplantValidationConstants validationConstants); @Override HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler); @Override void fireEvent(GwtEvent<?> event); @Override void flush(); @Override String getValue(); @Override void setValue(String value); @Override void onInvalid(InvalidEvent event); @Override void onPropertyChange(String... paths); @Override void onValueChange(ValueChangeEvent<String> event); @Override void setDelegate(EditorDelegate<String> delegate); }
FlagArgumentOptionEditor implements ValueAwareEditor<String>, LeafValueEditor<String>, InvalidEvent.InvalidHandler, ValueChangeHandler<String>, HasValueChangeHandlers<String> { @Override public void setValue(String value) { this.flagArgModel = value; checkedArgOption1.clear(); checkedValue1.clear(); unCheckedArgOption1.clear(); unCheckedValue1.clear(); checkedArgOption1.setValue(""); checkedValue1.setValue(""); unCheckedArgOption1.setValue(""); unCheckedValue1.setValue(""); LinkedList<String> newLinkedList = Lists.newLinkedList(Splitter.on(",").trimResults().split(Strings.nullToEmpty(value))); if (!Strings.isNullOrEmpty(newLinkedList.peek())) { setCheckedFields(newLinkedList.removeFirst()); if (newLinkedList.peek() != null) { setUncheckedFields(newLinkedList.removeFirst()); } } } FlagArgumentOptionEditor(TextField checkedArgOption, TextField checkedValue,
                                    TextField unCheckedArgOption, TextField unCheckedValue,
                                    final IplantValidationConstants validationConstants); @Override HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler); @Override void fireEvent(GwtEvent<?> event); @Override void flush(); @Override String getValue(); @Override void setValue(String value); @Override void onInvalid(InvalidEvent event); @Override void onPropertyChange(String... paths); @Override void onValueChange(ValueChangeEvent<String> event); @Override void setDelegate(EditorDelegate<String> delegate);  }