bill.util.config.gui
Class ConConfiguration

java.lang.Object
  |
  +--bill.util.config.Configuration
        |
        +--bill.util.config.gui.ConConfiguration

public class ConConfiguration
extends Configuration

This class extends the standard Configuration class to provide some GUI specific functionality.


Fields inherited from class bill.util.config.Configuration
_currentSection, _fileName, _sectionNames, _sections, ENTRY_CONFLICT_APPEND, ENTRY_CONFLICT_DISCARD, ENTRY_CONFLICT_OVERWRITE, SECTION_CONFLICT_APPEND, SECTION_CONFLICT_DISCARD, SECTION_CONFLICT_INCLUDE, SECTION_CONFLICT_OVERWRITE
 
Constructor Summary
ConConfiguration(String fileName, ConfigurationGUI gui)
          Class creator.
 
Method Summary
 void addAFile(String logicalName, String physicalName)
          Add the specified configuration file to the list of defined configuration files.
 String getFileLocation(String logicalName)
          Determines the location (directory and file name) for the specified logical file.
 Vector getFileNames()
          Creates a list of all logical names of the configuration files contained in the current project configuration file.
 boolean isModified()
          Checks to see if the configuration data defined has been modified since it's last saved.
 void removeAFile(String logicalName, String physicalName)
          Remove the specified configuration file from the list of defined configuration files.
 boolean save(String fileName)
          Method to save the configuration back to a file.
 void setModified(boolean modified)
          Sets the modification indicator as indicated.
 
Methods inherited from class bill.util.config.Configuration
addSection, addSection, addSectionEntry, addSectionEntry, getEntryNames, getFileName, getNumberOfEntries, getNumberOfSections, getSection, getSection, getSectionConflictMode, getSectionEntry, getSectionEntry, getSectionEntryConflictMode, getSectionEntryQuantity, getSectionEntryQuantity, getSectionEntryValue, getSectionEntryValue, getSectionEntryValue, getSectionEntryValue, getSectionEntryValueAsInteger, getSectionEntryValueAsInteger, getSectionEntryValueAsInteger, getSectionEntryValueAsInteger, getSectionNames, getSectionQuantity, getSections, indexOf, indexOf, isSection, isSection, isSectionEntry, merge, mergeSections, mergeSections, mergeSections, mergeSections, removeSection, removeSection, removeSectionEntry, renameSection, save, setFileName, setSectionConflictMode, setSectionEntryConflictMode, setSectionEntryValue, swapSections, swapSections, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConConfiguration

public ConConfiguration(String fileName,
                        ConfigurationGUI gui)
                 throws FileNotFoundException,
                        IOException,
                        ConfigurationException
Class creator. Initializes class variables.
Parameters:
fileName - Name of the configuration file to process.
gui - The ConfigurationGUI instance that is creating us. Used during the save process to determine the individual project configuration files that we need to save. For the project configuration file this has a value, but for the project's individual configuration files it is null .
Throws:
FileNotFoundException - Indicates the file name passed in does not exist or cannot be accessed.
IOException - File was found but an error occurred while reading it.
ConfigurationException - A processing error was encountered while reading the configuration file, typically a syntax error.
Method Detail

getFileNames

public Vector getFileNames()
Creates a list of all logical names of the configuration files contained in the current project configuration file.
Returns:
The list of all the logical file names in this project configuration file.

addAFile

public void addAFile(String logicalName,
                     String physicalName)
              throws ConfigurationException
Add the specified configuration file to the list of defined configuration files.
Parameters:
logicalName - The logical name of the configuration file to be added
physicalName - The physical name of the configuration file to be added.

removeAFile

public void removeAFile(String logicalName,
                        String physicalName)
Remove the specified configuration file from the list of defined configuration files.
Parameters:
logicalName - The logical name of the configuration file to be removed
physicalName - The physical name of the configuration file to be removed.

getFileLocation

public String getFileLocation(String logicalName)
Determines the location (directory and file name) for the specified logical file.
Parameters:
logicalName - The logical file name to find the location for
Returns:
The file location for the specified logical file name.

isModified

public boolean isModified()
Checks to see if the configuration data defined has been modified since it's last saved.
Returns:
true if the data has been modified, false otherwise.

setModified

public void setModified(boolean modified)
Sets the modification indicator as indicated. This indicator is used to signal whether the configuration data defined here has been changed since it's last save occurred.
Parameters:
modified - The value to set the modification indicator to.

save

public boolean save(String fileName)
Method to save the configuration back to a file. Calls super.save () to do the actual file write. Then checks to see if we are a project configuration file. If we are, then loops through the list of the individual configuration files and calls save on each of them.
Parameters:
fileName - File name to save the configuration file under.
Returns:
true if the save is successful, false otherwise.