com.partnersoft.system
Class PreferenceManager

java.lang.Object
  extended by com.partnersoft.system.PreferenceManager

public class PreferenceManager
extends java.lang.Object

Lots of convenience methods for storing and retrieving user preferences.

Author:
Paul Reavis Copyright 2004 Partner Software, Inc.

Constructor Summary
PreferenceManager()
           
 
Method Summary
 void clearPartnerPreferences()
          Blows away all com/partnersoft preferences.
 java.lang.Object deserialize(java.lang.String path)
           
 java.util.prefs.Preferences getNode(java.lang.String path)
          Returns a preference node for the given sub-path.
 void manageJSplitPanePreferences(java.lang.String name, javax.swing.JSplitPane pane)
          Keeps track of the divider position in a JSplitPane.
 void manageWindowPreferences(java.lang.String name, java.awt.Window window)
          Keeps track of the configured size and location of the window, using the given name as a key.
 Cog retrieveCog(java.lang.String path)
           
 void serialize(java.lang.String path, java.lang.Object whatnot)
           
static PreferenceManager singleton()
           
 void storeCog(java.lang.String path, Cog cog)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferenceManager

public PreferenceManager()
Method Detail

singleton

public static PreferenceManager singleton()

getNode

public java.util.prefs.Preferences getNode(java.lang.String path)
Returns a preference node for the given sub-path. Separate sub-paths with slashes (/).


clearPartnerPreferences

public void clearPartnerPreferences()
Blows away all com/partnersoft preferences.


manageWindowPreferences

public void manageWindowPreferences(java.lang.String name,
                                    java.awt.Window window)
Keeps track of the configured size and location of the window, using the given name as a key. If a preference is already stored, sets up the window to match. As the window is moved and sized, stores that info for next time.


manageJSplitPanePreferences

public void manageJSplitPanePreferences(java.lang.String name,
                                        javax.swing.JSplitPane pane)
Keeps track of the divider position in a JSplitPane.


storeCog

public void storeCog(java.lang.String path,
                     Cog cog)

retrieveCog

public Cog retrieveCog(java.lang.String path)

serialize

public void serialize(java.lang.String path,
                      java.lang.Object whatnot)

deserialize

public java.lang.Object deserialize(java.lang.String path)