@Test public void isValidWhenEmptyAndOptional() { TextPM pModel = new TextPM(); pModel.setMandatory(false); pModel.setText(null); assertEquals("pModel.isValid()", true, pModel.isValid()); pModel.getValidator().add(new ValidationRule() { public ValidationState validate() { return new ValidationState("baeh!"); } }); assertEquals("pModel.isValid()", true, pModel.isValid()); }
public void setText(String aText) { if (aText == null) { aText = ""; } if (equals(text, aText)) { return; } String old = text; text = aText; revalidate(); updateModified(); getPropertyChangeSupport().firePropertyChange("text", old, text); }
TextPM extends AbstractValuePM implements ITextPM { public void setText(String aText) { if (aText == null) { aText = ""; } if (equals(text, aText)) { return; } String old = text; text = aText; revalidate(); updateModified(); getPropertyChangeSupport().firePropertyChange("text", old, text); } }
TextPM extends AbstractValuePM implements ITextPM { public void setText(String aText) { if (aText == null) { aText = ""; } if (equals(text, aText)) { return; } String old = text; text = aText; revalidate(); updateModified(); getPropertyChangeSupport().firePropertyChange("text", old, text); } TextPM(String initialText);  TextPM(); }
TextPM extends AbstractValuePM implements ITextPM { public void setText(String aText) { if (aText == null) { aText = ""; } if (equals(text, aText)) { return; } String old = text; text = aText; revalidate(); updateModified(); getPropertyChangeSupport().firePropertyChange("text", old, text); } TextPM(String initialText);  TextPM(); String getText(); String getText(boolean convertWhitespaceStringToNull); void setText(String aText); boolean isRestrictedToOptions(); void setRestrictedToOptions(boolean restrictedToOptions); boolean isEmpty(); boolean isModified(); void reset(); void preset(); void reformat(); Options getOptions(); void setOptions(Options newOptions); @Override Comparable<?> getComparable(); }
TextPM extends AbstractValuePM implements ITextPM { public void setText(String aText) { if (aText == null) { aText = ""; } if (equals(text, aText)) { return; } String old = text; text = aText; revalidate(); updateModified(); getPropertyChangeSupport().firePropertyChange("text", old, text); } TextPM(String initialText);  TextPM(); String getText(); String getText(boolean convertWhitespaceStringToNull); void setText(String aText); boolean isRestrictedToOptions(); void setRestrictedToOptions(boolean restrictedToOptions); boolean isEmpty(); boolean isModified(); void reset(); void preset(); void reformat(); Options getOptions(); void setOptions(Options newOptions); @Override Comparable<?> getComparable();  }