com.vlsolutions.swing.toolbars
Class ToolBarPersistence
java.lang.Object
com.vlsolutions.swing.toolbars.ToolBarPersistence
- Runnable
public class ToolBarPersistence
extends java.lang.Object
implements Runnable
This class contains methods to keep a set of toolbars persistent.
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.
ToolBarPersistence
public ToolBarPersistence(Object mainClass,
ToolBarContainer container)
Construct a new set of persistent toolbars.
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 persistent
handleUnloadedToolBar
protected void handleUnloadedToolBar(VLToolBar toolbar)
loadToolBarLayout
public void loadToolBarLayout()
throws IOException,
ParserConfigurationException,
SAXException
Load the toolbar configuration.
run
public void run()
Save the toolbar configuration.
Masks all errors.
don't call this method directly : it is used by the shudown hook.
saveToolBarLayout
public void saveToolBarLayout()
throws IOException
Save the toolbar configuration.
© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications