oracle.javatools.editor
Class WeakPropertyChangeSupport
java.lang.Object
oracle.javatools.editor.WeakPropertyChangeSupport
- public final class WeakPropertyChangeSupport
- extends java.lang.Object
The WeakPropertyChangeSupport
is based on the PropertyChangeSupport
, but uses WeakReferences
to store listener references. This allows the listener to get garbage collected without having to detach explicitly.
Method Summary |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to listening for property changes. |
void |
firePropertyChange(java.beans.PropertyChangeEvent event)
Fire a PropertyChangeEvent indicating that the given property has changed. |
void |
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
Fire a PropertyChangeEvent indicating that the given property has changed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener so that it no longer receives property changes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WeakPropertyChangeSupport
public WeakPropertyChangeSupport(java.lang.Object source)
- Construct a new
WeakPropertyChangeSupport
. The given source is used as the source for PropertyChangeEvents
.
- Parameters:
source
- the source of property changes
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Add a
PropertyChangeListener
to listening for property changes.
-
- Parameters:
listener
- the listener to add
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Removes a
PropertyChangeListener
so that it no longer receives property changes.
-
- Parameters:
listener
- the listener to remove
firePropertyChange
public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
- Fire a
PropertyChangeEvent
indicating that the given property has changed. Note that if the values are equal, the event will not be fired.
-
- Parameters:
propertyName
- the name of the property
oldValue
- the old value
newValue
- the new value
firePropertyChange
public void firePropertyChange(java.beans.PropertyChangeEvent event)
- Fire a
PropertyChangeEvent
indicating that the given property has changed. Note that if the the values are equal, the event will not be fired.
Copyright © 1997, 2004, Oracle. All rights reserved.