|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anthonyeden.lib.Preferences
Base class for user preferences. Applications can extend this base class to provide extended user preferences.
Methods which alter a preference should fire a PropertyChange event.
Field Summary | |
static java.lang.String |
LOOK_AND_FEEL
The Look and Feel property name. |
Constructor Summary | |
Preferences()
Construct a Preferences object. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener. |
java.lang.String |
getLookAndFeelClassName()
Get the preferred look and feel class name. |
void |
load(Configuration configuration)
Load the preferences from the given root element. |
void |
load(java.io.File file)
Load the preferences from the given file. |
void |
load(org.apache.commons.vfs.FileObject file)
Load the preferences from the given file. |
void |
load(java.lang.String id,
java.io.InputStream in)
Load the preferences from the given InputStream. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a PropertyChangeListener. |
void |
save(java.io.File file)
Save the current configuration to the given file. |
void |
save(org.apache.commons.vfs.FileObject file)
Save the current configuration to the given file. |
void |
save(MutableConfiguration configuration)
Save the preferences to the given root XML Element. |
void |
save(java.lang.String id,
java.io.OutputStream out)
Save the preferences to the given OutputStream. |
void |
setLookAndFeelClassName(java.lang.String lookAndFeelClassName)
Set the preferred look and feel class name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String LOOK_AND_FEEL
Constructor Detail |
public Preferences()
Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The PropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The PropertyChangeListenerpublic java.lang.String getLookAndFeelClassName()
public void setLookAndFeelClassName(java.lang.String lookAndFeelClassName)
lookAndFeelClassName
- The new preferred look and feel class namepublic void load(java.io.File file) throws java.lang.Exception
file
- The file
java.lang.Exception
- Any exceptionload(String id, InputStream in)
public void load(org.apache.commons.vfs.FileObject file) throws java.lang.Exception
file
- The file
java.lang.Exception
- Any exceptionload(String id, InputStream in)
public void load(java.lang.String id, java.io.InputStream in) throws java.lang.Exception
load(Element element)
method to obtain preference configuration information.
Subclasses must call super.load(Element element)
if they
override this method so that standard preferences are properly loaded.
id
- The source idin
- The InputStream
java.lang.Exception
- Any exceptionpublic void load(Configuration configuration) throws java.lang.Exception
super.load(Configuration configuration)
if they override this method so that standard preferences are
properly loaded.
configuration
- The configuration element
java.lang.Exception
- Any Exceptionpublic void save(java.io.File file) throws java.lang.Exception
file
- The file to save to
java.lang.Exception
public void save(org.apache.commons.vfs.FileObject file) throws java.lang.Exception
file
- The file to save to
java.lang.Exception
public void save(java.lang.String id, java.io.OutputStream out) throws java.lang.Exception
save(Element element)
method to store preference
configuration information to the root XML element. Subclasses must call
super.save(Element element)
if they override this method so
that standard preferences are properly stored.
out
- The OutputStream
java.lang.Exception
- Any exceptionpublic void save(MutableConfiguration configuration) throws java.lang.Exception
super.save(MutableConfiguration configuration)
if they
override this method so that standard preferences are properly stored.
configuration
- The MutableConfiguration object
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |