@Test public void removeOptions() { ITextPM pModel = new TextPM(); Options<Integer> opt = new Options<Integer>(); pModel.setOptions(opt); Counter counter = new Counter(); pModel.addPropertyChangeListener(counter); assertEquals("counter.eventCount", 0, counter.eventCount); pModel.setOptions(null); assertEquals("counter.eventCount", 1, counter.eventCount); opt.put(1, "one"); assertEquals("counter.eventCount", 1, counter.eventCount); }
public void setOptions(Options newOptions) { if (options == newOptions) { return; } Options old = options; if (options != null) { options.removeOptionsListener(optionsListener); } options = newOptions; if (options != null) { options.addOptionsListener(optionsListener); } revalidate(); getPropertyChangeSupport().firePropertyChange("options", old, options); }
TextPM extends AbstractValuePM implements ITextPM { public void setOptions(Options newOptions) { if (options == newOptions) { return; } Options old = options; if (options != null) { options.removeOptionsListener(optionsListener); } options = newOptions; if (options != null) { options.addOptionsListener(optionsListener); } revalidate(); getPropertyChangeSupport().firePropertyChange("options", old, options); } }
TextPM extends AbstractValuePM implements ITextPM { public void setOptions(Options newOptions) { if (options == newOptions) { return; } Options old = options; if (options != null) { options.removeOptionsListener(optionsListener); } options = newOptions; if (options != null) { options.addOptionsListener(optionsListener); } revalidate(); getPropertyChangeSupport().firePropertyChange("options", old, options); } TextPM(String initialText);  TextPM(); }
TextPM extends AbstractValuePM implements ITextPM { public void setOptions(Options newOptions) { if (options == newOptions) { return; } Options old = options; if (options != null) { options.removeOptionsListener(optionsListener); } options = newOptions; if (options != null) { options.addOptionsListener(optionsListener); } revalidate(); getPropertyChangeSupport().firePropertyChange("options", old, options); } 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 setOptions(Options newOptions) { if (options == newOptions) { return; } Options old = options; if (options != null) { options.removeOptionsListener(optionsListener); } options = newOptions; if (options != null) { options.addOptionsListener(optionsListener); } revalidate(); getPropertyChangeSupport().firePropertyChange("options", old, options); } 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();  }