public class ToolBarPersistence extends Object implements Runnable
The class uses the preferences framework of the java runtime, and installs a shutdown hook to save the toolbars state on application exit.
Warning : this class cannot be run from a sandboxed (untrusted) environment (unsigned applet/ java web start) as it uses classes requiring a SecurityManager (Preferences API and Runtime shutdown hook).
Call loadToolBarLayout() upon application startup, after registering all ToolBars.
ToolBarIO
Constructor and Description |
---|
ToolBarPersistence(Object mainClass,
ToolBarContainer container)
Construct a new set of persistent toolbars.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handleUnloadedToolBar(VLToolBar toolbar) |
void |
loadToolBarLayout()
Load the toolbar configuration.
|
void |
run()
Save the toolbar configuration.
|
void |
saveToolBarLayout()
Save the toolbar configuration.
|
public ToolBarPersistence(Object mainClass, ToolBarContainer container)
mainClass
- the main class of the application. Will be used to
generate a reasonable name for the preferences to store toolbar
configurationcontainer
- the toolbarcontainer to keep persistentSecurityException
- if this class is invoked from an untrusted environmentprotected void handleUnloadedToolBar(VLToolBar toolbar)
public void loadToolBarLayout() throws IOException, ParserConfigurationException, SAXException
public void run()
Masks all errors.
don't call this method directly : it is used by the shudown hook.
run
in interface Runnable
Runnable.run()
public void saveToolBarLayout() throws IOException
IOException
© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications