|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.managers.settings.SettingsProcessor<C,V>
public abstract class SettingsProcessor<C extends java.awt.Component,V extends java.io.Serializable>
This abstract class represents core component settings tracking functionality. Extend and register it in SettingsManager or ComponentSettingsManager to provide additional components support.
SettingsProcessor is also defended from recursive settings load/save which might occur if component sends additional data change events when new data is loaded into it (doesn't matter from SettingsProcessor or some other source). To register new SettingsProcessor useregisterSettingsProcessor(Class, Class)
method from SettingsManager or
ComponentSettingsManager class (they both do the same).
SettingsManager
,
SettingsManager.registerSettingsProcessor(Class, Class)
,
ComponentSettingsManager
,
ComponentSettingsManager.registerSettingsProcessor(Class, Class)
Field Summary | |
---|---|
protected SettingsProcessorData |
data
Settings processor data. |
protected boolean |
loading
Whether this settings processor is currently loading settings or not. |
protected boolean |
saving
Whether this settings processor is currently saving settings or not. |
Constructor Summary | |
---|---|
SettingsProcessor(java.awt.Component component,
java.lang.String group,
java.lang.String key,
java.lang.Object defaultValue,
boolean loadInitialSettings,
boolean applySettingsChanges)
Constructs SettingsProcessor using the specified data. |
|
SettingsProcessor(SettingsProcessorData data)
Constructs SettingsProcessor using the specified SettingsProcessorData. |
Method Summary | |
---|---|
void |
destroy()
Destroys this SettingsProcessor. |
protected abstract void |
doDestroy(C component)
Called when component is unregistered from ComponentSettingsManager. |
protected abstract void |
doInit(C component)
Called when a new component is registered in ComponentSettingsManager. |
protected abstract void |
doLoad(C component)
Called on component settings load. |
protected abstract void |
doSave(C component)
Called on component settings save. |
C |
getComponent()
Returns managed component. |
SettingsProcessorData |
getData()
Returns SettingsProcessorData. |
V |
getDefaultValue()
Returns component default value. |
java.lang.String |
getGroup()
Returns component settings group. |
java.lang.String |
getKey()
Returns component settings key. |
void |
load()
Loads saved settings into the component. |
protected V |
loadValue()
Loads and returns saved component settings. |
void |
save()
Saves settings taken from the component. |
void |
save(boolean onChange)
Saves settings taken from the component. |
protected void |
saveValue(V value)
Saves component settings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean loading
protected boolean saving
protected SettingsProcessorData data
Constructor Detail |
---|
public SettingsProcessor(java.awt.Component component, java.lang.String group, java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
component
- component which settings are being managedgroup
- component settings groupkey
- component settings keydefaultValue
- component default valueloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notpublic SettingsProcessor(SettingsProcessorData data)
data
- SettingsProcessorDataMethod Detail |
---|
public SettingsProcessorData getData()
public C getComponent()
public java.lang.String getGroup()
public java.lang.String getKey()
public V getDefaultValue()
public final void load()
public final void save()
public final void save(boolean onChange)
onChange
- whether this save is called from component change listenerspublic final void destroy()
protected V loadValue()
protected void saveValue(V value)
value
- new component settingsprotected abstract void doInit(C component)
component
- registered componentprotected abstract void doDestroy(C component)
component
- unregistered componentprotected abstract void doLoad(C component)
component
- component to load settings intoprotected abstract void doSave(C component)
component
- component to save settings from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |