PreferenceChangeEventpublic class PreferenceChangeEvent extends 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. |
Fields Summary |
---|
private String | keyKey of the preference that changed. | private String | newValueNew value for preference, or null if it was removed. | private static final long | serialVersionUID |
Constructors Summary |
---|
public PreferenceChangeEvent(Preferences node, String key, String newValue)Constructs a new PreferenceChangeEvent instance.
super(node);
this.key = key;
this.newValue = newValue;
|
Methods Summary |
---|
public java.lang.String | getKey()Returns the key of the preference that was changed.
return key;
| public java.lang.String | getNewValue()Returns the new value for the preference.
return newValue;
| public java.util.prefs.Preferences | getNode()Returns the preference node that emitted the event.
return (Preferences) getSource();
| private void | readObject(java.io.ObjectInputStream in)Throws NotSerializableException, since PreferenceChangeEvent objects
are not intended to be serializable.
throw new NotSerializableException("Not serializable.");
| private void | writeObject(java.io.ObjectOutputStream out)Throws NotSerializableException, since NodeChangeEvent objects
are not intended to be serializable.
throw new NotSerializableException("Not serializable.");
|
|