Changes between Version 3 and Version 4 of PLUGIN_SUPPORT_LIB_CONFIGURING_R1


Ignore:
Timestamp:
06/05/09 17:05:34 (16 years ago)
Author:
mitex
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PLUGIN_SUPPORT_LIB_CONFIGURING_R1

    v3 v4  
    7777 * Class {{{Configuration}}} - represents a single configuration file. 
    7878  * configuration file - File 
    79   * list of {{{ConfigEntry}}}s that stores all key-value pairs in that file. 
    80   * get......... returns the default value........ 
     79  * list property of {{{ConfigEntry}}}s that stores all key-value pairs in that file. 
     80  * {{{T getValue(ConfigKey<T> key)}}} - searches the list for a given entry and returns the corresponding value or the default value for the key. 
     81  * {{{void setValue(ConfigKey<T> key, T value)}}} - sets the value in the list and saves the configuration using the persister (see below). 
     82  * When a Configuration for a given file is constructed, all entries are read from that file and stored in the list. 
    8183 
    8284 * Class {{{ConfigurationPersister}}} that loads/saves configuration files. 
    83   * .......... 
     85  * Use the following structure for the storage, where "value" is the storage for the value of the configuration key, created with the according persister: 
     86   * configuration 
     87    * entry 
     88     * key 
     89     * value 
     90    * entry 
     91     * key 
     92     * value 
    8493  * Register the persister as an extension. 
    8594 
    8695 * Singleton class {{{ConfigurationManager}}}. 
    87   * {{{T get(ConfigKey<T> key)}}} 
    88    * Given the file name in the key, finds the corresponding Configuration and then returns the value for that key. 
    89   * {{{set(ConfigKey<T> key, T value)}}} 
    90    * Given the file name in the key, finds the corresponding Configuration. 
    91    * Sets the new value for that key. 
    92    * Saves the configuration using the persister. 
    93   * Map<String, Configuration>, which maps Configuration objects to configuration file names. 
     96  * list of entries (String, Configuration), which maps Configuration objects to configuration file names. 
     97  * {{{T getValue(ConfigKey<T> key)}}} 
     98   * Given the file name in the key, finds the corresponding Configuration and then returns the result of Configuration.getValue. 
     99  * {{{setValue(ConfigKey<T> key, T value)}}} 
     100   * Given the file name in the key, finds the corresponding Configuration and sets the new value for that key. 
     101 
     102 * Implement at least one of the following: 
     103  * In {{{BugReportLogic}}} 
     104   * Remove the file "distrib/email" and create a new one "distrib/conf/org.sophie2.main.func.help.conf". 
     105   * Create a ConfigKey {{{userEmail}}}. 
     106   * Remove the method {{{readEmail}}} and use {{{getValue}}} in ConfigurationManager. 
     107   * In {{{SAVE_EMAIL}}} use {{{setValue}}} in ConfigurationManager. 
     108  * In {{{MDMainWindow}}} 
     109   * Create a ConfigKey {{{windowSize}}} of type {{{ImmSize}}} and set its default value to (1200, 900). 
     110   * Remove the constants WINDOW_WIDTH, WINDOW_HEIGHT. 
     111   * In {{{globalContainer}}} set the JFrame's size according to the value of the configuration key. 
    94112 
    95113= Implementation =