org.gjt.rec.util
Class AbstractSettings

java.lang.Object
  |
  +--org.gjt.rec.util.AbstractSettings
All Implemented Interfaces:
Settings
Direct Known Subclasses:
BaseSettings, ResourceSettings

public abstract class AbstractSettings
extends Object
implements Settings

Implements listener support for implementations of the Settings interface. Implementations extend this class and invoke the fireSettingsChanged(SettingsEvent) method when the settings change.

Author:
Neil Stockbridge
See Also:
Settings, SettingsEvent

Field Summary
static String REVISION
           
 
Constructor Summary
AbstractSettings()
           
 
Method Summary
 void addSettingsListener(SettingsListener listener)
          Registers a listener with this settings object so that it receives notification when this settings object changes.
protected  void fireSettingsChanged(SettingsEvent e)
          Notifies each registered listener of a change in this settings object.
 void removeSettingsListener(SettingsListener listener)
          Removes a listener from the list of objects that are notified when this settings object changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gjt.rec.util.Settings
get, getNames, remove, set
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

AbstractSettings

public AbstractSettings()
Method Detail

fireSettingsChanged

protected void fireSettingsChanged(SettingsEvent e)
Notifies each registered listener of a change in this settings object.

Parameters:
e - an event object describing the change in the settings.

addSettingsListener

public void addSettingsListener(SettingsListener listener)
Description copied from interface: Settings
Registers a listener with this settings object so that it receives notification when this settings object changes.

Specified by:
addSettingsListener in interface Settings
Parameters:
listener - the listener to register

removeSettingsListener

public void removeSettingsListener(SettingsListener listener)
Description copied from interface: Settings
Removes a listener from the list of objects that are notified when this settings object changes. If the listener is registered multiply, only the last registered reference will be removed.

Specified by:
removeSettingsListener in interface Settings
Parameters:
listener - the listener to unregister