net.sf.jfilesync.settings
Class TProgramSettings

java.lang.Object
  extended by net.sf.jfilesync.settings.TProgramSettings

public class TProgramSettings
extends java.lang.Object

TProgramSettings is the object instance of all settings in the config.xml.


Nested Class Summary
(package private) static class TProgramSettings.ProgramOption
           
 
Field Summary
private  org.w3c.dom.Document config
           
private static java.util.logging.Logger logger
           
static int OPTION_CLOSE_COPY_DIALOG
           
static int OPTION_CONFIRM_EDITOR_OPEN
           
static int OPTION_CONFIRM_EDITOR_SIZE
           
static int OPTION_CONFIRM_PASSWORD
           
static int OPTION_CONNECT_TO_LOCAL
           
static int OPTION_CUSTOM_PATH
           
static int OPTION_DIR_OPEN_DOUBLE_CLICK
           
static int OPTION_DO_NOT_PROMPT_FOR_EXIT
           
static int OPTION_EXPERT_MODE
           
static int OPTION_FILE_SIZE_BYTES
           
static int OPTION_FILE_TABLE_CASE_INSENSITIVE
           
static int OPTION_FOLLOW_SYMLINKS_COPY
           
static int OPTION_FOLLOW_SYMLINKS_SYNC
           
static int OPTION_GURU_MODE
           
static int OPTION_HIDDEN_FILES
           
static int OPTION_LOOK_AND_FEEL_CLASS
           
static int OPTION_MASTER_PASSWORD
           
static int OPTION_PERMISSIONS_DIR
           
static int OPTION_PERMISSIONS_FILE
           
static int OPTION_PRESERVE_MTIME
           
static int OPTION_PRESERVE_PERM
           
static int OPTION_TAB_FONT_SIZE
           
static int OPTION_TAB_TITLE_LENGTH
           
static int OPTION_TABLE_STYLE
           
static int OPTION_THEME
           
static int OPTION_USE_CUSTOM_PATH
           
static int OPTION_USE_GNU_FOR_LOCAL
           
static int OPTION_USER_LANG
           
private  java.util.HashMap<java.lang.Integer,TProgramSettings.ProgramOption> optionHash
           
private static int VALUE_BOOL
           
private static int VALUE_INT
           
private static int VALUE_STRING
           
private static java.lang.String XML_OPTION
           
private static java.lang.String XML_OPTION_KEY
           
private static java.lang.String XML_OPTION_VALUE
           
private static java.lang.String XML_PARAM
           
 
Constructor Summary
TProgramSettings(org.w3c.dom.Document config)
           
 
Method Summary
protected  void addProgramOption(TProgramSettings.ProgramOption opt)
           
protected  void castAndSetValue(TProgramSettings.ProgramOption option, java.lang.String valueString)
           
protected  void defineOptions()
           
protected  TProgramSettings.ProgramOption findOption(int keyID)
           
 boolean getBooleanOption(int keyID)
           
 int getIntegerOption(int keyID)
           
protected  org.w3c.dom.Element getOptionElement(org.w3c.dom.Document config, java.lang.String optionKey)
           
 java.lang.String getStringOption(int keyID)
           
protected  void readKeyValueOptions()
           
protected  void readOption(TProgramSettings.ProgramOption option, org.w3c.dom.Element optionElem)
           
 void setProgramOption(int keyID, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_PARAM

private static final java.lang.String XML_PARAM
See Also:
Constant Field Values

XML_OPTION

private static final java.lang.String XML_OPTION
See Also:
Constant Field Values

XML_OPTION_KEY

private static final java.lang.String XML_OPTION_KEY
See Also:
Constant Field Values

XML_OPTION_VALUE

private static final java.lang.String XML_OPTION_VALUE
See Also:
Constant Field Values

OPTION_HIDDEN_FILES

public static final int OPTION_HIDDEN_FILES
See Also:
Constant Field Values

OPTION_TABLE_STYLE

public static final int OPTION_TABLE_STYLE
See Also:
Constant Field Values

OPTION_USER_LANG

public static final int OPTION_USER_LANG
See Also:
Constant Field Values

OPTION_CLOSE_COPY_DIALOG

public static final int OPTION_CLOSE_COPY_DIALOG
See Also:
Constant Field Values

OPTION_CONFIRM_PASSWORD

public static final int OPTION_CONFIRM_PASSWORD
See Also:
Constant Field Values

OPTION_THEME

public static final int OPTION_THEME
See Also:
Constant Field Values

OPTION_DIR_OPEN_DOUBLE_CLICK

public static final int OPTION_DIR_OPEN_DOUBLE_CLICK
See Also:
Constant Field Values

OPTION_CONFIRM_EDITOR_OPEN

public static final int OPTION_CONFIRM_EDITOR_OPEN
See Also:
Constant Field Values

OPTION_CONFIRM_EDITOR_SIZE

public static final int OPTION_CONFIRM_EDITOR_SIZE
See Also:
Constant Field Values

OPTION_GURU_MODE

public static final int OPTION_GURU_MODE
See Also:
Constant Field Values

OPTION_PRESERVE_MTIME

public static final int OPTION_PRESERVE_MTIME
See Also:
Constant Field Values

OPTION_PERMISSIONS_DIR

public static final int OPTION_PERMISSIONS_DIR
See Also:
Constant Field Values

OPTION_PERMISSIONS_FILE

public static final int OPTION_PERMISSIONS_FILE
See Also:
Constant Field Values

OPTION_FILE_SIZE_BYTES

public static final int OPTION_FILE_SIZE_BYTES
See Also:
Constant Field Values

OPTION_PRESERVE_PERM

public static final int OPTION_PRESERVE_PERM
See Also:
Constant Field Values

OPTION_FOLLOW_SYMLINKS_COPY

public static final int OPTION_FOLLOW_SYMLINKS_COPY
See Also:
Constant Field Values

OPTION_FOLLOW_SYMLINKS_SYNC

public static final int OPTION_FOLLOW_SYMLINKS_SYNC
See Also:
Constant Field Values

OPTION_TAB_TITLE_LENGTH

public static final int OPTION_TAB_TITLE_LENGTH
See Also:
Constant Field Values

OPTION_TAB_FONT_SIZE

public static final int OPTION_TAB_FONT_SIZE
See Also:
Constant Field Values

OPTION_LOOK_AND_FEEL_CLASS

public static final int OPTION_LOOK_AND_FEEL_CLASS
See Also:
Constant Field Values

OPTION_CONNECT_TO_LOCAL

public static final int OPTION_CONNECT_TO_LOCAL
See Also:
Constant Field Values

OPTION_USE_GNU_FOR_LOCAL

public static final int OPTION_USE_GNU_FOR_LOCAL
See Also:
Constant Field Values

OPTION_USE_CUSTOM_PATH

public static final int OPTION_USE_CUSTOM_PATH
See Also:
Constant Field Values

OPTION_CUSTOM_PATH

public static final int OPTION_CUSTOM_PATH
See Also:
Constant Field Values

OPTION_MASTER_PASSWORD

public static final int OPTION_MASTER_PASSWORD
See Also:
Constant Field Values

OPTION_FILE_TABLE_CASE_INSENSITIVE

public static final int OPTION_FILE_TABLE_CASE_INSENSITIVE
See Also:
Constant Field Values

OPTION_DO_NOT_PROMPT_FOR_EXIT

public static final int OPTION_DO_NOT_PROMPT_FOR_EXIT
See Also:
Constant Field Values

OPTION_EXPERT_MODE

public static final int OPTION_EXPERT_MODE
See Also:
Constant Field Values

VALUE_INT

private static final int VALUE_INT
See Also:
Constant Field Values

VALUE_STRING

private static final int VALUE_STRING
See Also:
Constant Field Values

VALUE_BOOL

private static final int VALUE_BOOL
See Also:
Constant Field Values

optionHash

private final java.util.HashMap<java.lang.Integer,TProgramSettings.ProgramOption> optionHash

config

private final org.w3c.dom.Document config

logger

private static java.util.logging.Logger logger
Constructor Detail

TProgramSettings

public TProgramSettings(org.w3c.dom.Document config)
Method Detail

defineOptions

protected void defineOptions()

addProgramOption

protected void addProgramOption(TProgramSettings.ProgramOption opt)

readKeyValueOptions

protected void readKeyValueOptions()
                            throws SettingsTypeException
Throws:
SettingsTypeException

findOption

protected TProgramSettings.ProgramOption findOption(int keyID)

getOptionElement

protected org.w3c.dom.Element getOptionElement(org.w3c.dom.Document config,
                                               java.lang.String optionKey)

readOption

protected void readOption(TProgramSettings.ProgramOption option,
                          org.w3c.dom.Element optionElem)
                   throws SettingsTypeException
Throws:
SettingsTypeException

castAndSetValue

protected void castAndSetValue(TProgramSettings.ProgramOption option,
                               java.lang.String valueString)
                        throws SettingsTypeException
Throws:
SettingsTypeException

setProgramOption

public void setProgramOption(int keyID,
                             java.lang.String value)
                      throws SettingsTypeException
Throws:
SettingsTypeException

getIntegerOption

public int getIntegerOption(int keyID)
                     throws SettingsTypeException
Throws:
SettingsTypeException

getBooleanOption

public boolean getBooleanOption(int keyID)
                         throws SettingsTypeException
Throws:
SettingsTypeException

getStringOption

public java.lang.String getStringOption(int keyID)
                                 throws SettingsTypeException
Throws:
SettingsTypeException