java.util.prefs
Class PreferenceChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.util.prefs.PreferenceChangeEvent
All Implemented Interfaces:
Serializable

public class PreferenceChangeEvent
extends EventObject

ObjectEvent fired when a Preferences entry changes. This event is generated when a entry is added, changed or removed. When an entry is removed then getNewValue will return null.

Preference change events are only generated for entries in one particular preference node. Notification of subnode addition/removal is given by a NodeChangeEvent.

Note that although this class is marked as serializable, attempts to serialize it will fail with NotSerializableException.

Since:
1.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PreferenceChangeEvent(Preferences node, String key, String value)
          Creates a new PreferenceChangeEvent.
 
Method Summary
 String getKey()
          Returns the key of the entry that was added, changed or removed.
 String getNewValue()
          Returns the new value of the entry that was added or changed, or returns null when the entry was removed.
 Preferences getNode()
          Returns the source Preference node from which an entry was added, changed or removed.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreferenceChangeEvent

public PreferenceChangeEvent(Preferences node,
                             String key,
                             String value)
Creates a new PreferenceChangeEvent.

Parameters:
node - The source preference node for which an entry was added, changed or removed
key - The key of the entry that was added, changed or removed
value - The new value of the entry that was added or changed, or null when the entry was removed
Method Detail

getNode

public Preferences getNode()
Returns the source Preference node from which an entry was added, changed or removed.


getKey

public String getKey()
Returns the key of the entry that was added, changed or removed.


getNewValue

public String getNewValue()
Returns the new value of the entry that was added or changed, or returns null when the entry was removed.