net.sourceforge.geeboss.model.settings
Class SettingsFactory

java.lang.Object
  extended by net.sourceforge.geeboss.model.settings.SettingsFactory

public class SettingsFactory
extends java.lang.Object

Old settings management class This should all be moved to the settings class

Author:
Frederic BORRY

Constructor Summary
SettingsFactory()
          Instantiate a new SettingsFactory
SettingsFactory(org.w3c.dom.Document document)
          Instantiate a new SettingsFactory with a Document
 
Method Summary
 boolean getBoolean(java.lang.String element, boolean init)
          Get the state of a value from the user.xml
 java.lang.String getValue(java.lang.String element, java.lang.String attribute)
          Load a value from the XML settings document
 java.lang.String getValue(java.lang.String element, java.lang.String attribute, java.lang.String init)
          Load a value from the XML settings document
 java.lang.String getValue(java.lang.String element, java.lang.String attribute, java.lang.String init, boolean trim)
          Load a value from the XML settings document
static boolean isValidUserXML(org.w3c.dom.Document document)
          Check if the given document is a valid "user.xml"
static boolean isValidUserXML(java.io.InputStream inputStream)
          Check if the file at the given inputstream is a valid "user.xml"
static boolean isValidUserXML(java.lang.String path)
          Check if the file at the given path is a valid "user.xml"
 void loadHotKeys()
          Load the hotkeys
 java.util.HashMap<java.lang.String,int[]> loadSashWeights()
          Load weights of the SashForms
 java.util.HashMap<java.lang.String,java.lang.Object> loadShellBounds()
          Load the bounds of the shell
static void saveUserSettings(java.util.Hashtable sashWeights, java.util.Hashtable shellBounds)
          Save the user settings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SettingsFactory

public SettingsFactory()
Instantiate a new SettingsFactory


SettingsFactory

public SettingsFactory(org.w3c.dom.Document document)
Instantiate a new SettingsFactory with a Document

Parameters:
document - The configuration XML
Method Detail

isValidUserXML

public static boolean isValidUserXML(org.w3c.dom.Document document)
Check if the given document is a valid "user.xml"

Parameters:
document - The document to check for valid user xml
Returns:
true if document is valid

isValidUserXML

public static boolean isValidUserXML(java.io.InputStream inputStream)
Check if the file at the given inputstream is a valid "user.xml"

Parameters:
inputStream - InputStream holding the contents of the XML
Returns:
true if file is valid

isValidUserXML

public static boolean isValidUserXML(java.lang.String path)
Check if the file at the given path is a valid "user.xml"

Parameters:
path - Path to the import file
Returns:
true if file is valid

saveUserSettings

public static void saveUserSettings(java.util.Hashtable sashWeights,
                                    java.util.Hashtable shellBounds)
Save the user settings

Parameters:
sashWeights - The sash weights
shellBounds - The shell bounds

getBoolean

public boolean getBoolean(java.lang.String element,
                          boolean init)
Get the state of a value from the user.xml

Parameters:
element - The Name of the Element
init - Initial value
Returns:
boolean true or false

getValue

public java.lang.String getValue(java.lang.String element,
                                 java.lang.String attribute)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
Returns:
String The value of the attribute or the init String

getValue

public java.lang.String getValue(java.lang.String element,
                                 java.lang.String attribute,
                                 java.lang.String init)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
init - The initial value if attribute is not found
Returns:
String The value of the attribute or the init String

getValue

public java.lang.String getValue(java.lang.String element,
                                 java.lang.String attribute,
                                 java.lang.String init,
                                 boolean trim)
Load a value from the XML settings document

Parameters:
element - The element's name
attribute - The attribute's name
init - The initial value if attribute is not found
trim - If true the text is trimmed
Returns:
String The value of the attribute or the init String

loadHotKeys

public void loadHotKeys()
Load the hotkeys


loadSashWeights

public java.util.HashMap<java.lang.String,int[]> loadSashWeights()
Load weights of the SashForms

Returns:
Hashtable With the sash weights

loadShellBounds

public java.util.HashMap<java.lang.String,java.lang.Object> loadShellBounds()
Load the bounds of the shell

Returns:
The Bounds of the shell


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.