Changes between Version 8 and Version 9 of PLUGIN_SUPPORT_LIB_CONFIGURING_R1
- Timestamp:
- 06/12/09 17:20:51 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PLUGIN_SUPPORT_LIB_CONFIGURING_R1
v8 v9 55 55 == How to demo == 56 56 * Open Sophie. 57 * Maximize the main window.58 57 * Open the bug report form (in Help menu) and enter a valid e-mail address. 59 58 * Close the form. 60 59 * Restart Sophie. 61 * Show that the main window is maximized.62 60 * Open the bug report and show the saved e-mail address. 63 61 64 62 = Design = 65 * Package {{{org.sophie2.base.config}}}.63 * New module {{{org.sophie2.base.config}}}. 66 64 67 65 * Immutable generic class {{{ConfigKey<T>}}} that encapsulates all of the information about a key: 68 66 * name (of the key) - String 69 * configuration file - File67 * configuration file - String - relative path. For example, if the file is "distrib/conf/a/b.conf", this should be "a/b.conf". 70 68 * default value (if the key is not present in the file) - T 71 69 * schema (for the persistence) - String, for example "imm:int|storage|decimal" 70 71 * Class {{{BaseConfigModule}}}. 72 * Extension point of type {{{ConfigKey<?>}}}. 72 73 73 74 * Class {{{ConfigEntry}}} that extends {{{ListEntry}}} … … 79 80 * list property of {{{ConfigEntry}}}s that stores all key-value pairs in that file. 80 81 * {{{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. 82 * {{{void setValue(ConfigKey<T> key, T value)}}} - sets the value in the list. 83 83 84 * Class {{{ConfigurationPersister}}} that loads/saves configuration files from/to Storage. 84 * Package {{{org.sophie2.base.config.persistence 85 * 86 87 * Class {{{ConfigurationStoragePersister}}} that loads/saves configuration files from/to Storage. 85 88 * 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 89 * entry 90 * key - attribute 91 * value - text content of entry 92 * entry 93 * key - attribute 94 * value - text content of entry 93 95 * Schema: "configuration|storage|conf" 96 * When reading, iterate over all registered extensions - config keys - for the given configuration file. 94 97 * Class {{{ConfigurationFilePersister}}} that loads/saves Storage from/to *.conf files. 95 * Create an XML tag for each of the above storage nodes (configuration, entry, etc.) 98 * Use the same structure as the storage for the XML file. 99 * Name the root tag "configuration". 96 100 * Schema: "storage|xml|conf" 97 101 * Register the persisters as extensions. … … 102 106 * Given the file name in the key, finds the corresponding Configuration and then returns the result of Configuration.getValue. 103 107 * {{{setValue(ConfigKey<T> key, T value)}}} 104 * Given the file name in the key, finds the corresponding Configuration and sets the new value for that key. 108 * Given the file name in the key, finds the corresponding Configuration and sets the new value for that key. Saves the configuration using the persister (see below). 109 * When a Configuration for a given file is constructed, all entries are read from that file and stored in the list. 105 110 106 * Implement at least one of the following: 107 * In {{{BugReportLogic}}} 108 * Remove the file "distrib/email" and create a new one "distrib/conf/org.sophie2.main.func.help.conf". 109 * Create a ConfigKey {{{userEmail}}}. 110 * Remove the method {{{readEmail}}} and use {{{getValue}}} in ConfigurationManager. 111 * In {{{SAVE_EMAIL}}} use {{{setValue}}} in ConfigurationManager. 112 * In {{{MDMainWindow}}} 113 * Create a ConfigKey {{{windowSize}}} of type {{{ImmSize}}} and set its default value to (1200, 900). 114 * Remove the constants WINDOW_WIDTH, WINDOW_HEIGHT. 115 * In {{{globalContainer}}} set the JFrame's size according to the value of the configuration key. 111 * In {{{BugReportLogic}}} 112 * Remove the file "distrib/email" and create a new one "distrib/conf/org.sophie2.main.func.help.conf". 113 * Create a ConfigKey {{{userEmail}}} and add it as an extension for the help module. 114 * Remove the method {{{readEmail}}} and use {{{getValue}}} in ConfigurationManager. 115 * In {{{SAVE_EMAIL}}} use {{{setValue}}} in ConfigurationManager. 116 116 117 117 * [3228], [3238], [3284] 118 118 119 119 = Implementation = 120 ^(Describe and link the implementation results here (from the wiki or the repository).)^ 120 * [3228], [3238], [3284], 121 121 122 122 = Testing =