java.util.prefs
Class PreferenceChangeEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by java.util.prefs.PreferenceChangeEvent
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class PreferenceChangeEvent
extends EventObject sample code for java.util.EventObject definition code for java.util.EventObject

An event emitted by a Preferences node to indicate that a preference has been added, removed or has had its value changed.

Note, that although PreferenceChangeEvent inherits Serializable interface from EventObject, it is not intended to be Serializable. Appropriate serialization methods are implemented to throw NotSerializableException.

Since:
1.4
See Also:
Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences , PreferenceChangeListener sample code for java.util.prefs.PreferenceChangeListener definition code for java.util.prefs.PreferenceChangeListener , NodeChangeEvent sample code for java.util.prefs.NodeChangeEvent definition code for java.util.prefs.NodeChangeEvent

Field Summary
 
Fields inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
source sample code for java.util.EventObject.source definition code for java.util.EventObject.source
 
Constructor Summary
PreferenceChangeEvent sample code for java.util.prefs.PreferenceChangeEvent.PreferenceChangeEvent(java.util.prefs.Preferences, java.lang.String, java.lang.String) definition code for java.util.prefs.PreferenceChangeEvent.PreferenceChangeEvent(java.util.prefs.Preferences, java.lang.String, java.lang.String) (Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences  node, String sample code for java.lang.String definition code for java.lang.String  key, String sample code for java.lang.String definition code for java.lang.String  newValue)
          Constructs a new PreferenceChangeEvent instance.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getKey sample code for java.util.prefs.PreferenceChangeEvent.getKey() definition code for java.util.prefs.PreferenceChangeEvent.getKey() ()
          Returns the key of the preference that was changed.
 String sample code for java.lang.String definition code for java.lang.String getNewValue sample code for java.util.prefs.PreferenceChangeEvent.getNewValue() definition code for java.util.prefs.PreferenceChangeEvent.getNewValue() ()
          Returns the new value for the preference.
 Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences getNode sample code for java.util.prefs.PreferenceChangeEvent.getNode() definition code for java.util.prefs.PreferenceChangeEvent.getNode() ()
          Returns the preference node that emitted the event.
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource() , toString sample code for java.util.EventObject.toString() definition code for java.util.EventObject.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

PreferenceChangeEvent sample code for java.util.prefs.PreferenceChangeEvent(java.util.prefs.Preferences, java.lang.String, java.lang.String) definition code for java.util.prefs.PreferenceChangeEvent(java.util.prefs.Preferences, java.lang.String, java.lang.String)

public PreferenceChangeEvent(Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences  node,
                             String sample code for java.lang.String definition code for java.lang.String  key,
                             String sample code for java.lang.String definition code for java.lang.String  newValue)
Constructs a new PreferenceChangeEvent instance.

Parameters:
node - The Preferences node that emitted the event.
key - The key of the preference that was changed.
newValue - The new value of the preference, or null if the preference is being removed.
Method Detail

getNode sample code for java.util.prefs.PreferenceChangeEvent.getNode() definition code for java.util.prefs.PreferenceChangeEvent.getNode()

public Preferences sample code for java.util.prefs.Preferences definition code for java.util.prefs.Preferences  getNode()
Returns the preference node that emitted the event.

Returns:
The preference node that emitted the event.

getKey sample code for java.util.prefs.PreferenceChangeEvent.getKey() definition code for java.util.prefs.PreferenceChangeEvent.getKey()

public String sample code for java.lang.String definition code for java.lang.String  getKey()
Returns the key of the preference that was changed.

Returns:
The key of the preference that was changed.

getNewValue sample code for java.util.prefs.PreferenceChangeEvent.getNewValue() definition code for java.util.prefs.PreferenceChangeEvent.getNewValue()

public String sample code for java.lang.String definition code for java.lang.String  getNewValue()
Returns the new value for the preference.

Returns:
The new value for the preference, or null if the preference was removed.