|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alee.managers.settings.ComponentSettingsManager
public class ComponentSettingsManager
This SettingsManager sub-manager registers and processes component settings auto-save/restore them on any changes within or outside of that component.
This manager should never be called directly (except the case when you register new SettingsProcessor or if you know what you are doing) to avoid any unexpected component behavior.
SettingsManager
,
SettingsManager
Field Summary | |
---|---|
static java.lang.String |
COMPONENT_SETTINGS_PROCESSOR_KEY
Keys used to store custom data in JComponent. |
protected static boolean |
initialized
Whether ComponentSettingsManager is initialized or not. |
protected static java.util.Map<java.lang.Class,java.lang.Class> |
settingsProcessorClasses
Registered settings processor classes. |
protected static java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<SettingsProcessor>> |
settingsProcessors
Registered component settings processors. |
protected static boolean |
throwExceptions
Whether throw exceptions on inappropriate actions or not. |
Constructor Summary | |
---|---|
ComponentSettingsManager()
|
Method Summary | ||
---|---|---|
protected static SettingsProcessor |
createSettingsProcessor(SettingsProcessorData data)
Returns new SettingsProcessor instance for the specified SettingsProcessorData. |
|
protected static java.lang.Class |
findSuitableSettingsProcessor(java.lang.Class componentType)
Returns settings processor class for the specified component type. |
|
static void |
initializeManager()
Initializes ComponentSettingsManager. |
|
static boolean |
isComponentSupported(java.lang.Class<? extends javax.swing.JComponent> componentType)
Returns whether the specified component is supported or not. |
|
static boolean |
isComponentSupported(javax.swing.JComponent component)
Returns whether the specified component is supported or not. |
|
static boolean |
isThrowExceptions()
Returns whether exceptions are thrown on inappropriate actions or not. |
|
static void |
loadSettings(javax.swing.JComponent component)
Loads saved settings into the component if it is registered. |
|
static void |
registerComponent(javax.swing.JComponent component,
SettingsProcessor settingsProcessor)
Registers component using the specified SettingsProcessor. |
|
static void |
registerComponent(SettingsProcessorData data)
Registers component using the specified SettingsProcessorData. |
|
static
|
registerSettingsProcessor(java.lang.Class<? extends javax.swing.JComponent> componentType,
java.lang.Class<T> settingsProcessor)
Registers specified settings processor class for the specified component type. |
|
static void |
saveSettings()
Saves all registered components settings. |
|
static void |
saveSettings(javax.swing.JComponent component)
Saves component settings. |
|
static void |
setThrowExceptions(boolean throwExceptions)
Sets whether throw exceptions on inappropriate actions or not. |
|
static void |
unregisterComponent(javax.swing.JComponent component)
Unregisters component from settings auto-save. |
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 COMPONENT_SETTINGS_PROCESSOR_KEY
protected static final java.util.Map<java.lang.Class,java.lang.Class> settingsProcessorClasses
protected static final java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<SettingsProcessor>> settingsProcessors
protected static boolean throwExceptions
protected static boolean initialized
Constructor Detail |
---|
public ComponentSettingsManager()
Method Detail |
---|
public static void initializeManager()
public static boolean isThrowExceptions()
public static void setThrowExceptions(boolean throwExceptions)
throwExceptions
- whether throw exceptions on inappropriate actions or notpublic static boolean isComponentSupported(javax.swing.JComponent component)
component
- component
public static boolean isComponentSupported(java.lang.Class<? extends javax.swing.JComponent> componentType)
componentType
- component type
public static <T extends SettingsProcessor> void registerSettingsProcessor(java.lang.Class<? extends javax.swing.JComponent> componentType, java.lang.Class<T> settingsProcessor)
T
- settings processor typecomponentType
- component typesettingsProcessor
- settings processor classprotected static java.lang.Class findSuitableSettingsProcessor(java.lang.Class componentType)
componentType
- component type
protected static SettingsProcessor createSettingsProcessor(SettingsProcessorData data)
data
- SettingsProcessorData
public static void registerComponent(SettingsProcessorData data)
data
- SettingsProcessorDatapublic static void registerComponent(javax.swing.JComponent component, SettingsProcessor settingsProcessor)
component
- component to registersettingsProcessor
- component settings processorpublic static void loadSettings(javax.swing.JComponent component)
component
- component registered for settings auto-savepublic static void saveSettings()
public static void saveSettings(javax.swing.JComponent component)
component
- component registered for settings auto-savepublic static void unregisterComponent(javax.swing.JComponent component)
component
- component to unregister
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |