提交 82f96368 编写于 作者: M malenkov

4114658: DOC: Unspecified behaviour for java.beans.PropertyEditorSupport

Reviewed-by: peterz, loneid
上级 ddcb9249
...@@ -204,20 +204,21 @@ public interface PropertyEditor { ...@@ -204,20 +204,21 @@ public interface PropertyEditor {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/** /**
* Register a listener for the PropertyChange event. When a * Adds a listener for the value change.
* PropertyEditor changes its value it should fire a PropertyChange * When the property editor changes its value
* event on all registered PropertyChangeListeners, specifying the * it should fire a {@link PropertyChangeEvent}
* null value for the property name and itself as the source. * on all registered {@link PropertyChangeListener}s,
* specifying the {@code null} value for the property name
* and itself as the source.
* *
* @param listener An object to be invoked when a PropertyChange * @param listener the {@link PropertyChangeListener} to add
* event is fired.
*/ */
void addPropertyChangeListener(PropertyChangeListener listener); void addPropertyChangeListener(PropertyChangeListener listener);
/** /**
* Remove a listener for the PropertyChange event. * Removes a listener for the value change.
* *
* @param listener The PropertyChange listener to be removed. * @param listener the {@link PropertyChangeListener} to remove
*/ */
void removePropertyChangeListener(PropertyChangeListener listener); void removePropertyChangeListener(PropertyChangeListener listener);
......
...@@ -233,11 +233,20 @@ public class PropertyEditorSupport implements PropertyEditor { ...@@ -233,11 +233,20 @@ public class PropertyEditorSupport implements PropertyEditor {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/** /**
* Register a listener for the PropertyChange event. The class will * Adds a listener for the value change.
* fire a PropertyChange value whenever the value is updated. * When the property editor changes its value
* it should fire a {@link PropertyChangeEvent}
* on all registered {@link PropertyChangeListener}s,
* specifying the {@code null} value for the property name.
* If the source property is set,
* it should be used as the source of the event.
* <p>
* The same listener object may be added more than once,
* and will be called as many times as it is added.
* If {@code listener} is {@code null},
* no exception is thrown and no action is taken.
* *
* @param listener An object to be invoked when a PropertyChange * @param listener the {@link PropertyChangeListener} to add
* event is fired.
*/ */
public synchronized void addPropertyChangeListener( public synchronized void addPropertyChangeListener(
PropertyChangeListener listener) { PropertyChangeListener listener) {
...@@ -248,9 +257,14 @@ public class PropertyEditorSupport implements PropertyEditor { ...@@ -248,9 +257,14 @@ public class PropertyEditorSupport implements PropertyEditor {
} }
/** /**
* Remove a listener for the PropertyChange event. * Removes a listener for the value change.
* <p>
* If the same listener was added more than once,
* it will be notified one less time after being removed.
* If {@code listener} is {@code null}, or was never added,
* no exception is thrown and no action is taken.
* *
* @param listener The PropertyChange listener to be removed. * @param listener the {@link PropertyChangeListener} to remove
*/ */
public synchronized void removePropertyChangeListener( public synchronized void removePropertyChangeListener(
PropertyChangeListener listener) { PropertyChangeListener listener) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册