|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.config.Config
public class Config
Config is the core part of the configuration system; it is simply a
Collection of Choice
s.
Config does the following things:
Config does not attempt to make permanent copies of the config data because different apps may wish to store the data in different ways. Possible storage mechanisms include:
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
protected PropertyChangeSupport |
changeListeners
The set of property change listeners. |
protected List |
keys
The array that stores the keys |
protected EventListenerList |
listenerList
The list of listeners |
protected Properties |
local
The set of local values |
private static Logger |
log
The log stream |
protected List |
models
The array that stores the models |
protected String |
title
The name for dialog boxes and properties files |
Constructor Summary | |
---|---|
Config(String title)
Config ctor |
Method Summary | |
---|---|
void |
add(Choice model)
Add a key/model pairing |
void |
add(org.jdom.Document xmlconfig,
ResourceBundle configResources)
Add the set of configuration options specified in the xml file. |
void |
addConfigListener(ConfigListener li)
Add an Exception listener to the list of things wanting to know whenever we capture an Exception |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. |
void |
applicationToLocal()
Take the data in the application and copy it to the local storage area. |
protected void |
fireChoiceAdded(String key,
Choice model)
A Choice got added |
protected void |
fireChoiceRemoved(String key,
Choice model)
A Choice got added |
Choice |
getChoice(String key)
Get the Choice for a given key |
static String |
getLeaf(String key)
What is the Path of this key |
String |
getLocal(String name)
Get a configuration Choice (by name). |
static String |
getPath(String key)
What is the Path of this key |
Properties |
getProperties()
Take the data in the local storage area and store it permanently |
String |
getTitle()
|
Iterator |
iterator()
The set of Choice that we are controlling |
void |
localToApplication()
Take the data in the local storage area and copy it to the application. |
void |
localToPermanent(URI uri)
Take the data in the local storage area and store it permanently, using the configured storage area. |
void |
permanentToLocal(URI uri)
Take the data stored permanently and copy it to the local storage area, using the configured storage area |
void |
remove(String key)
Remove a key/model pairing |
void |
removeConfigListener(ConfigListener li)
Remove an Exception listener from the list of things wanting to know whenever we capture an Exception |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
void |
setLocal(String name,
String value)
Set a configuration Choice (by name) to a new value. |
void |
setProperties(Properties prop)
Take the data stored permanently and copy it to the local storage area, using the specified stream |
int |
size()
The number of Choices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String title
protected List keys
protected List models
protected Properties local
protected PropertyChangeSupport changeListeners
protected EventListenerList listenerList
private static final Logger log
Constructor Detail |
---|
public Config(String title)
title
- The name for dialog boxes and properties filesMethod Detail |
---|
public String getTitle()
public void add(Choice model)
model
- The Choice model to map to its keypublic void add(org.jdom.Document xmlconfig, ResourceBundle configResources)
xmlconfig
- The JDOM document to read.configResources
- contains the user level text for this configpublic void remove(String key)
key
- The name to killpublic Iterator iterator()
public Choice getChoice(String key)
public int size()
public void setLocal(String name, String value)
public String getLocal(String name)
public void applicationToLocal()
public void localToApplication()
public void setProperties(Properties prop)
public Properties getProperties()
public void permanentToLocal(URI uri) throws IOException
IOException
public void localToPermanent(URI uri) throws IOException
IOException
public static String getPath(String key)
public static String getLeaf(String key)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedpublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedpublic void addConfigListener(ConfigListener li)
public void removeConfigListener(ConfigListener li)
protected void fireChoiceAdded(String key, Choice model)
protected void fireChoiceRemoved(String key, Choice model)
|
Copyright ยจ 2003-2007 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |