qflib 0.98.1

de.qfs.lib.config
Interface Configurable

All Known Implementing Classes:
ConfigWrapper, DefaultTableModelSorter, MultiPane, OptionSet

public interface Configurable

The Configurable interface is used together with the Configuration class to make an Object's state persistent.

A Configurable has a name under which it is registered within the Configuration. When the Configuration is saved, it queries all registered Configurables for their state, which will be passed back to them, when the Configuration is restored.

A Configurable should notify the Configuration via Configuration.stateChanged, when its state changes.

Version:
$Revision: 1.9 $
Author:
Gregor Schmid
See Also:
Configuration

Method Summary
 java.lang.String getConfigurableName()
          Get the Configurable's name.
 java.util.Properties getConfigurableState()
          Get the Configurable's state.
 void registrationChanged(Configuration config, java.lang.String name, boolean registered, boolean valuesKept)
          This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
 void setConfigurableName(java.lang.String name)
          Set the Configurable's name.
 void setConfigurableState(java.util.Properties state)
          Set the Configurable's state.
 

Method Detail

setConfigurableName

public void setConfigurableName(java.lang.String name)
Set the Configurable's name.
Parameters:
name - The name to set.

getConfigurableName

public java.lang.String getConfigurableName()
Get the Configurable's name.
Returns:
The Configurable's name.

getConfigurableState

public java.util.Properties getConfigurableState()
Get the Configurable's state.
Returns:
The Configurable's state.

setConfigurableState

public void setConfigurableState(java.util.Properties state)
Set the Configurable's state.
Parameters:
state - The state to set.

registrationChanged

public void registrationChanged(Configuration config,
                                java.lang.String name,
                                boolean registered,
                                boolean valuesKept)
This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
Parameters:
config - The affected Configuration.
name - The registration name of the Configurable which may be different from the Configurable's name.
registered - True if the Configurable was just registered, false if it was unregistered.
valuesKept - Whether the Configurable's values were kept, if it was just unregistered.

qflib 0.98.1