Package org.jppf.ui.options.factory
Class OptionsHandler
java.lang.Object
org.jppf.ui.options.factory.OptionsHandler
This class handles the persistence of the dynamic UI com.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA graph of the persistent options. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OptionElementaddPage(OptionElement page) Add a page to the list of pages managed by this handler.static OptionElementaddPageFromURL(String xmlPath, String baseName) Add a page built from an xml document.static OptionElementaddPageFromXml(String xmlPath) Add a page built from an xml document.static OptionsHandler.OptionNodeBuild a graph of the persistent elements.static voidexportSettings(String path) Export the UI settings to an XML file.static OptionElementfindOptionWithName(OptionElement searchRoot, String name) static OptionsPageBuilderGet the page builder used to instantiate pages from XML descriptors.static FrameGet the main window of the application.static OptionElementRetrieve a page from its name.static List<OptionElement>Get the list of option pages managed by this handler.static PluggableViewHandlerGet the object which handles user-defined pluggable views.static PreferencesGet the root of the preferences subtree in which the chart configurations are saved.static OptionElementRetrieve the first loaded page.static voidimportSettings(String path) Export the UI settings to an XML file.static voidloadFrameAttributes(Frame frame, Preferences pref) Load the specified frame state from the preferences store.static voidLoad the application's main window state from the preferences store.static OptionElementloadPageFromURL(String xmlPath, String baseName) Load a page built from an xml document.static OptionElementloadPageFromXml(String xmlPath) Load a page built from an xml document.static voidLoad the value of all persistent options in the preferences store.static voidloadPreferences(OptionsHandler.OptionNode node, Preferences prefs) Save the value of all persistent options in the preferences store.static voidremovePage(OptionContainer page) Remove a page from the list of pages managed by this handler.static voidsaveFrameAttributes(Frame frame, Preferences pref) Save the specified frame state to the preferences store.static voidSave the application's main window state to the preferences store.static voidSave the value of all persistent options in the preferences store.static voidsavePreferences(OptionsHandler.OptionNode node, Preferences prefs) Save the value of all persistent options in the preferences store.static voidsetMainWindow(Frame mainWindow) Set the main window of the application.static voidsetPreferences(Preferences preferences) Set the root of the preferences subtree in which the chart configurations are saved.
-
Constructor Details
-
OptionsHandler
public OptionsHandler()
-
-
Method Details
-
getPageList
Get the list of option pages managed by this handler.- Returns:
- a list of
OptionsPageinstances.
-
getPage
Retrieve a page from its name.- Parameters:
name- the name of the page to retrieve.- Returns:
- an
OptionsPageinstance.
-
getTopPage
Retrieve the first loaded page.- Returns:
- an
OptionsPageinstance.
-
addPage
Add a page to the list of pages managed by this handler.- Parameters:
page- anOptionsPageinstance.- Returns:
- the page that was added.
-
removePage
Remove a page from the list of pages managed by this handler.- Parameters:
page- anOptionsPageinstance.
-
loadPageFromXml
Load a page built from an xml document.- Parameters:
xmlPath- the path to the xml document.- Returns:
- the page that was added.
-
addPageFromXml
Add a page built from an xml document.- Parameters:
xmlPath- the path to the xml document.- Returns:
- the page that was added.
-
loadPageFromURL
Load a page built from an xml document.- Parameters:
xmlPath- the path to the xml document.baseName- base name for resource bundle lookup.- Returns:
- the page that was added.
-
addPageFromURL
Add a page built from an xml document.- Parameters:
xmlPath- the path to the xml document.baseName- base name for resource bundle lookup.- Returns:
- the page that was added.
-
savePreferences
public static void savePreferences()Save the value of all persistent options in the preferences store. -
savePreferences
Save the value of all persistent options in the preferences store.- Parameters:
node- the root of the options subtree to save.prefs- the preferences node in which to save the values.
-
loadPreferences
public static void loadPreferences()Load the value of all persistent options in the preferences store. -
loadPreferences
Save the value of all persistent options in the preferences store.- Parameters:
node- the root of the options subtree to save.prefs- the preferences node in which to save the values.
-
getBuilder
Get the page builder used to instantiate pages from XML descriptors.- Returns:
- an
OptionsPageBuilderinstance.
-
buildPersistenceGraph
Build a graph of the persistent elements.- Parameters:
elt- the root of the current subgraph.- Returns:
- an
OptionNodeinstance.
-
getPreferences
Get the root of the preferences subtree in which the chart configurations are saved.- Returns:
- a
Preferencesinstance.
-
setPreferences
Set the root of the preferences subtree in which the chart configurations are saved.- Parameters:
preferences- aPreferencesinstance.
-
loadMainWindowAttributes
Load the application's main window state from the preferences store.- Parameters:
pref- the preferences node from where the attributes are loaded.
-
saveMainWindowAttributes
Save the application's main window state to the preferences store.- Parameters:
pref- the preferences node where the attributes are saved.
-
loadFrameAttributes
Load the specified frame state from the preferences store.- Parameters:
frame- the frame for which the attributes are retrieved.pref- the preferences node from where the attributes are loaded.
-
saveFrameAttributes
Save the specified frame state to the preferences store.- Parameters:
frame- the frame for which the attributes are saved.pref- the preferences node where the attributes are saved.
-
getMainWindow
Get the main window of the application.- Returns:
- a
Frameinstance.
-
setMainWindow
Set the main window of the application.- Parameters:
mainWindow- aFrameinstance.
-
findOptionWithName
- Parameters:
searchRoot- the root option to search from.name- the name of the option to search.- Returns:
- the first option found with the specified name.
-
getPluggableViewHandler
Get the object which handles user-defined pluggable views.- Returns:
- a
PluggableViewHandlerinstance.
-
exportSettings
Export the UI settings to an XML file.- Parameters:
path- the path of the XML file to save to.
-
importSettings
Export the UI settings to an XML file.- Parameters:
path- the path of the XML file to save to.
-