|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.lib.config.Configurator
A Configurator is a composite, holding Configurables
and other Configurators, thus building a hierarchy which is used to
determine the names under which the Configurables are registered with the
Configuration
. This way it is possible to register
similar Configurables under different names, without them having to know
anything about their place in the hierarchy.
A Configurator is especially useful when building a reusable GUI component that has various subcomponents requiring confguration. All the nested Configurables can be collected under one Configurator hierarchy, that can be made accessible through the components interface. The user of the component can the register all Configurables at once.
Constructor Summary | |
Configurator(java.lang.String name)
Create a new Configurator. |
Method Summary | |
void |
add(Configurable configurable)
Add a Configurable to the Configurator's children. |
void |
add(Configurator configurator)
Add a Configurator to the Configurator's children. |
Configurator |
copy()
Create a deep copy of the Configurator hierarchy rooted at this Configurator. |
java.lang.String |
getName()
Get the name of the Configurator. |
boolean |
isRegistered()
Query whether the Configurator is registered with the Configuration. |
boolean |
isRegistered(Configuration configuration)
Query whether the Configurator is registered with a special Configuration. |
void |
register()
Register the children of the Configurator with the Configuration. |
void |
register(Configuration configuration)
Register the children of the Configurator with a special Configuration. |
void |
remove(Configurable configurable,
boolean keepValues)
Remove a Configurable from the Configurator's children. |
void |
remove(Configurator configurator,
boolean keepValues)
Remove a Configurator from the Configurator's children. |
protected void |
setParent(Configurator parent)
Set the Configurator's parent. |
void |
unregister(boolean keepValues)
Unregister the Configurator's children from the Configuration. |
void |
unregister(Configuration configuration,
boolean keepValues)
Unregister the Configurator's children from a special Configuration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Configurator(java.lang.String name)
name
- The name of the Configurator.Method Detail |
public void add(Configurable configurable)
configurable
- The Configurable to add.public void add(Configurator configurator)
configurator
- The Configurator to add.public void remove(Configurable configurable, boolean keepValues)
configurable
- The Configurable to remove.keepValues
- If true, the Configurable's state is kept
in the Configuration.public void remove(Configurator configurator, boolean keepValues)
configurator
- The Configurator to remove.keepValues
- If true, the Configurator's state is kept
in the Configuration.public boolean isRegistered()
public boolean isRegistered(Configuration configuration)
configuration
- The Configuration to test for.public void register()
public void register(Configuration configuration)
configuration
- The Configuration to register with.public void unregister(boolean keepValues)
keepValues
- If true, keep the state of the Configurables
in the Configuration.public void unregister(Configuration configuration, boolean keepValues)
configuration
- The Configuration to unregister from.keepValues
- If true, keep the state of the Configurables
in the Configuration.public java.lang.String getName()
public Configurator copy()
This method is useful to save parts of a Configuration in different files, while still keeping the whole Configuration in one big hierarchy.
protected void setParent(Configurator parent)
parent
- The parent to set.
|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |