|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bill.util.gui.ProjectConfiguration
Class responsible for reading and writing the project configuration file. This gives the project some state, so key information is not lost between executions of the project. The file stores the following:
Look and Feel
The look and feel the user last selected.
Last Directory
The last directory the user read or wrote a
save file to. This is used to set the file selection dialog to this
directory when it is created instead of it using a default directory.
Last x Files
The last x files the user opened or saved.
These will be displayed in the file menu as options for the user to open.
Highlighting
Indicates whether required input fields should be
highlighted as a visual indication to the user.
Tool Tips
Indicates whether floating tool tips (hover help)
should be displayed to the user.
Field Summary | |
protected Configuration |
_parser
The parsed project data configuration file |
static String |
ITEM_HIGHLIGHTING
Entry within the config document representing the highlighting state |
static String |
ITEM_LAST_DIRECTORY
Entry within the config document representing the last directory accessed |
static String |
ITEM_LAST_FILE
Entry within the config document representing the most recent files used. |
static String |
ITEM_LOOK_FEEL
Entry within the config document representing the look & feel |
static String |
ITEM_MAX_LAST_FILES
Entry within the config document representing the maximum number of "last files" to store |
static String |
ITEM_TOOL_TIPS
Entry within the config document representing the tool tips |
static String |
SECTION_PROJECT
Top level section within the config document |
Constructor Summary | |
ProjectConfiguration()
Default class instance creator. |
|
ProjectConfiguration(String fileName)
Default class instance creator. |
Method Summary | |
String |
getConfigEntry(String entry)
Retrieves the value of the specified configuration entry from the project configuration file. |
boolean |
getConfigEntryAsBoolean(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as a boolean value. |
double |
getConfigEntryAsDouble(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as a double value. |
float |
getConfigEntryAsFloat(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as a float value. |
int |
getConfigEntryAsInteger(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as an integer value. |
int |
getConfigEntryAsInteger(String entry,
int radix)
Retrieves the value of the specified configuration entry from the project configuration file as an integer value. |
long |
getConfigEntryAsLong(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as a numeric long value. |
long |
getConfigEntryAsLong(String entry,
int radix)
Retrieves the value of the specified configuration entry from the project configuration file as a numeric long value. |
short |
getConfigEntryAsShort(String entry)
Retrieves the value of the specified configuration entry from the project configuration file as a numeric short value. |
short |
getConfigEntryAsShort(String entry,
int radix)
Retrieves the value of the specified configuration entry from the project configuration file as a numeric short value. |
Configuration |
getConfiguration()
Retrieves the configuration information associated with this project. |
String |
getFileName()
Getter for the name of the project config save file we are working with. |
String |
getLastDirectory()
Gets the string that specifies the last save file directory accessed. |
Vector |
getLastFiles()
Getter for the list of last save files that have been defined. |
String |
getLookFeel()
Gets the string that specifies the look and feel the user last used. |
int |
getMaxLastFiles()
Gets the value that specifies the maximum number of last used files to keep track of. |
boolean |
isHighlighting()
Determines if required fields should be highlighted or not. |
boolean |
isToolTips()
Determines if tool tips should be displayed or not. |
static void |
main(String[] args)
|
void |
save()
Controls the saving of the project configuration information to a file. |
void |
setConfigEntry(String entry,
boolean value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
double value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
float value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
int value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
long value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
short value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setConfigEntry(String entry,
String value)
Sets the value of the specified configuration entry in the project configuration file. |
void |
setFileName(String name)
Setter for the project data save file name. |
void |
setHighlighting(boolean highlight)
Sets the indicator that specifies whether required fields should be highlighted or not. |
void |
setLastDirectory(String directory)
Sets the string that specifies the last save file directory the user accessed. |
void |
setLastFiles(Vector files)
Setter for the vector of last save files. |
void |
setLookFeel(String lookFeel)
Sets the string that specifies the last look & feel the user used. |
void |
setMaxLastFiles(int number)
Sets the string that specifies the maximum number of last used files to keep track of. |
void |
setToolTips(boolean toolTips)
Sets the indicator that specifies whether tooltips should be displayed or not. |
void |
updateLastFileList(String name)
Updates the list of last names. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String SECTION_PROJECT
public static final String ITEM_LOOK_FEEL
public static final String ITEM_TOOL_TIPS
public static final String ITEM_HIGHLIGHTING
public static final String ITEM_LAST_DIRECTORY
public static final String ITEM_MAX_LAST_FILES
public static final String ITEM_LAST_FILE
protected Configuration _parser
Constructor Detail |
public ProjectConfiguration()
public ProjectConfiguration(String fileName)
fileName
- Name of the navigation config file to read.Method Detail |
public Configuration getConfiguration()
public String getFileName()
public Vector getLastFiles()
public String getConfigEntry(String entry)
entry
- The name of the entry to retrieve the value ofnull
if the entry does
not exist.public boolean getConfigEntryAsBoolean(String entry)
entry
- The name of the entry to retrieve the value offalse
if the
entry does not exist.public double getConfigEntryAsDouble(String entry)
entry
- The name of the entry to retrieve the value of0
if the
entry does not exist.public float getConfigEntryAsFloat(String entry)
entry
- The name of the entry to retrieve the value of0
if the
entry does not exist.public int getConfigEntryAsInteger(String entry)
entry
- The name of the entry to retrieve the value of0
if the
entry does not exist.public int getConfigEntryAsInteger(String entry, int radix)
entry
- The name of the entry to retrieve the value ofradix
- The radix to be used0
if the
entry does not exist.public long getConfigEntryAsLong(String entry)
entry
- The name of the entry to retrieve the value of0
if the
entry does not exist.public long getConfigEntryAsLong(String entry, int radix)
entry
- The name of the entry to retrieve the value ofradix
- The radix to be used0
if the
entry does not exist.public short getConfigEntryAsShort(String entry)
entry
- The name of the entry to retrieve the value of0
if the
entry does not exist.public short getConfigEntryAsShort(String entry, int radix)
entry
- The name of the entry to retrieve the value ofradix
- The radix to be used0
if the
entry does not exist.public String getLastDirectory()
public String getLookFeel()
public int getMaxLastFiles()
public boolean isToolTips()
true
indicates tooltips should be
displayed, false
indicates they should not.public boolean isHighlighting()
true
indicates highlighting should be
used, false
indicates it should not.public void setLastFiles(Vector files)
files
- Vector of last files to use.public void setFileName(String name)
name
- Name to set the data file name to.public void setConfigEntry(String entry, String value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, boolean value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, double value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, float value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, int value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, long value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setConfigEntry(String entry, short value)
entry
- The name of the entry to set the value ofvalue
- The value to set the entry topublic void setLastDirectory(String directory)
directory
- The directory name.public void setLookFeel(String lookFeel)
lookFeel
- The look & feel name.public void setMaxLastFiles(int number)
number
- The maximum number of last used files.public void setToolTips(boolean toolTips)
toolTips
- Value to set the display tooltips indicator to.public void setHighlighting(boolean highlight)
highlight
- Value to set the highlighting indicator to.public void updateLastFileList(String name)
name
- The name of the file to add to the list.public void save() throws Exception
Exception
- If the save fails in the Configuration class.Configuration.save()
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |