Package org.jdesktop.application

# Class AbstractBean

java.lang.Object
org.jdesktop.application.AbstractBean

Direct Known Subclasses:
  `ActionManager`, `Application`, `ApplicationContext`, `LocalStorage`, `ResourceManager`, `Task.InputBlocker`, `TaskMonitor`, `TaskService`, `View`

public class AbstractBean extends Object
An encapsulation of the PropertyChangeSupport methods based on java.beans.PropertyChangeSupport. PropertyChangeListeners are fired on the event dispatching thread.

Note: this class is only public because the so-called "fix" for javadoc bug 4780441 still fails to correctly document public methods inherited from a package private class.

## Constructor Summary

Constructors
Constructor
Description
`AbstractBean()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addPropertyChangeListener(PropertyChangeListener listener)`
Add a PropertyChangeListener to the listener list.
`void`
`addPropertyChangeListener(String propertyName, PropertyChangeListener listener)`
Add a PropertyChangeListener for a specific property.
`protected void`
`firePropertyChange(PropertyChangeEvent e)`
Fire an existing PropertyChangeEvent
`protected void`
`firePropertyChange(String propertyName, Object oldValue, Object newValue)`
Called whenever the value of a bound property is set.
`PropertyChangeListener[]`
`getPropertyChangeListeners()`
An array of all of the `PropertyChangeListeners` added so far.
`void`
`removePropertyChangeListener(PropertyChangeListener listener)`
Remove a PropertyChangeListener from the listener list.
`void`
`removePropertyChangeListener(String propertyName, PropertyChangeListener listener)`
Remove a PropertyChangeListener for a specific property.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AbstractBean

public AbstractBean()

## Method Details

### addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties and its `propertyChange` method will run on the event dispatching thread.

If `listener` is null, no exception is thrown and no action is taken.

Parameters:
  `listener` - the PropertyChangeListener to be added.
See Also:
  - `removePropertyChangeListener(java.beans.PropertyChangeListener)`
  - `PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)`

### removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.

If `listener` is null, no exception is thrown and no action is taken.

Parameters:
  `listener` - the PropertyChangeListener to be removed.
See Also:
  - `addPropertyChangeListener(java.beans.PropertyChangeListener)`
  - `PropertyChangeSupport.removePropertyChangeListener(java.beans.PropertyChangeListener)`

### addPropertyChangeListener

public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. If `propertyName` or `listener` is null, no exception is thrown and no action is taken.

Parameters:
  `propertyName` - The name of the property to listen on.
  `listener` - the PropertyChangeListener to be added
See Also:
  - `PropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)`

### removePropertyChangeListener

public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. If `listener` was added more than once to the same event source for the specified property, it will be notified one less time after being removed. If `propertyName` is null, no exception is thrown and no action is taken. If `listener` is null, or was never added for the specified property, no exception is thrown and no action is taken.

Parameters:
  `propertyName` - The name of the property that was listened on.
  `listener` - The PropertyChangeListener to be removed
See Also:
  - `PropertyChangeSupport.removePropertyChangeListener(String, PropertyChangeListener)`

### getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()
An array of all of the `PropertyChangeListeners` added so far.

Returns:
  all of the `PropertyChangeListeners` added so far.
See Also:
  - `PropertyChangeSupport.getPropertyChangeListeners()`

### firePropertyChange

protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
Called whenever the value of a bound property is set.

If oldValue is not equal to newValue, invoke the `propertyChange` method on all of the `PropertyChangeListeners` added so far, on the event dispatching thread.

See Also:
  - `addPropertyChangeListener(java.beans.PropertyChangeListener)`
  - `removePropertyChangeListener(java.beans.PropertyChangeListener)`
  - `PropertyChangeSupport.firePropertyChange(String, Object, Object)`

### firePropertyChange

protected void firePropertyChange(PropertyChangeEvent e)
Fire an existing PropertyChangeEvent

If the event's oldValue property is not equal to newValue, invoke the `propertyChange` method on all of the `PropertyChangeListeners` added so far, on the event dispatching thread.

See Also:
  - `addPropertyChangeListener(java.beans.PropertyChangeListener)`
  - `removePropertyChangeListener(java.beans.PropertyChangeListener)`
  - `PropertyChangeSupport.firePropertyChange(PropertyChangeEvent e)`