com.groovemanager.core
Class ConfigManager

java.lang.Object
  extended by com.groovemanager.core.ConfigManager

public class ConfigManager
extends java.lang.Object

This class is used to maintain configuration settings. A default implementation can always be accessed through ConfigManager.getDefault(), but ConfigManager can also be subclassed to adapt its behaviour.

Author:
Manu Robledo

Field Summary
static ConfigManager DEFAULT_CONFIG_MANAGER
          The default implementation of ConfigManager
static java.lang.String DEFAULT_FILENAME
          The default filename of the configuration file
protected  org.eclipse.jface.preference.PreferenceStore prefStore
          The PreferenceStore used by this ConfigManager
 
Constructor Summary
ConfigManager(java.io.File confFile)
          Constructs a new ConfigManager which stores its settings in the given file
 
Method Summary
protected static boolean checkPage(java.lang.String page, java.lang.String[] pages)
          Check, if the given page name is contained inside the given Array of page names
private static ConfigManager createDefault()
          Create the default ConfigManager instance
protected  org.eclipse.jface.preference.PreferenceManager createPrefManager(java.lang.String[] pages)
          Create a preference Manager, which contains the Preference Pages according to the specified Keys and can be used for PreferenceDialogs
static ConfigManager getDefault()
          Get the default Config Manager.
 org.eclipse.jface.preference.PreferenceManager getPrefManager(java.lang.String[] pageKeys)
          Get a preference Manager, which contains the Preference Pages according to the specified Keys and can be used for PreferenceDialogs
 org.eclipse.jface.preference.PreferenceStore getPrefStore()
          Get the Preference Store connected to this ConfigManager instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG_MANAGER

public static final ConfigManager DEFAULT_CONFIG_MANAGER
The default implementation of ConfigManager


DEFAULT_FILENAME

public static final java.lang.String DEFAULT_FILENAME
The default filename of the configuration file

See Also:
Constant Field Values

prefStore

protected org.eclipse.jface.preference.PreferenceStore prefStore
The PreferenceStore used by this ConfigManager

Constructor Detail

ConfigManager

public ConfigManager(java.io.File confFile)
              throws java.io.IOException
Constructs a new ConfigManager which stores its settings in the given file

Parameters:
confFile - The config File
Throws:
java.io.IOException - If an I/O-Error Occurs
Method Detail

checkPage

protected static boolean checkPage(java.lang.String page,
                                   java.lang.String[] pages)
Check, if the given page name is contained inside the given Array of page names

Parameters:
page - The page name to be chekced for
pages - An Array of valid page names
Returns:
true, if the page name was contained inside the Array, false otherwise

createDefault

private static ConfigManager createDefault()
Create the default ConfigManager instance

Returns:
the default ConfigManager instance

createPrefManager

protected org.eclipse.jface.preference.PreferenceManager createPrefManager(java.lang.String[] pages)
Create a preference Manager, which contains the Preference Pages according to the specified Keys and can be used for PreferenceDialogs

Parameters:
pages - The keys of the pages which the PreferenceManager should contain
Returns:
A new PreferenceManager containing the pages specified by the keys

getDefault

public static ConfigManager getDefault()
Get the default Config Manager.

Returns:
The default Config Manager. In fact it just returns DEFAULT_CONFIG_MANAGER

getPrefManager

public org.eclipse.jface.preference.PreferenceManager getPrefManager(java.lang.String[] pageKeys)
Get a preference Manager, which contains the Preference Pages according to the specified Keys and can be used for PreferenceDialogs

Parameters:
pageKeys - The keys of the pages which the PreferenceManager should contain
Returns:
A new PreferenceManager containing the pages specified by the keys

getPrefStore

public org.eclipse.jface.preference.PreferenceStore getPrefStore()
Get the Preference Store connected to this ConfigManager instance

Returns:
The PreferenceStore