FileDocCategorySizeDatePackage
PropertyChangeListenerProxy.javaAPI DocJava SE 5 API1928Fri Aug 26 14:56:56 BST 2005java.beans

PropertyChangeListenerProxy

public class PropertyChangeListenerProxy extends EventListenerProxy implements PropertyChangeListener
A class which extends the EventListenerProxy specifically for adding a named PropertyChangeListener. Instances of this class can be added as PropertyChangeListener to an object.

If the object has a getPropertyChangeListeners() method then the array returned could be a mixture of PropertyChangeListener and PropertyChangeListenerProxy objects.

see
java.util.EventListenerProxy
since
1.4

Fields Summary
private String
propertyName
Constructors Summary
public PropertyChangeListenerProxy(String propertyName, PropertyChangeListener listener)
Constructor which binds the PropertyChangeListener to a specific property.

param
listener The listener object
param
propertyName The name of the property to listen on.

        // XXX - msd NOTE: I changed the order of the arguments so that it's
        // similar to PropertyChangeSupport.addPropertyChangeListener(String,
        // PropertyChangeListener);
        super(listener);
        this.propertyName = propertyName;
    
Methods Summary
public java.lang.StringgetPropertyName()
Returns the name of the named property associated with the listener.

        return propertyName;
    
public voidpropertyChange(java.beans.PropertyChangeEvent evt)
Forwards the property change event to the listener delegate.

param
evt the property change event

        ((PropertyChangeListener)getListener()).propertyChange(evt);