Changes between Version 14 and Version 15 of GROUP_TEMPLATES_R3


Ignore:
Timestamp:
09/24/09 23:08:01 (16 years ago)
Author:
jani
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GROUP_TEMPLATES_R3

    v14 v15  
    66 
    77== Overview == 
    8 In order to improve usability of the templates, introduce a HUD that appears when user adds an object as a template. There the user should select which of the options will be templated. 
     8In order to improve usability of the templates, introduce a dialog that appears when user adds an object as a template. There the user should select which of the options will be templated. 
    99== Task requirements == 
    1010 * Create a dialog that pops up when the "Add to template" halo is clicked. The dialog should contain 
     
    9494 
    9595= Design = 
    96 === HUD and HALO === 
    97  * An AddTemplateHud should be introduced. It should contain the controls from the wireframe in the analysis. 
    98  * The old AddTemplateHaloButton should be changed to HudHaloButton. 
    99  * The HUD should contain a list of TemplatedKeys. If the HUD is displayed when a single frame is selected, the list should contain the templated keys of the frame, otherwise - the templated keys of the current page. 
    100  * The list of TemplatedKeys can be obtained with the following code: 
     96=== Dialog and HALO === 
     97 * An AddTemplate Dialog should be introduced. It should contain the controls from the wireframe in the analysis. 
     98 * The old AddTemplateHaloButton should invoke the dialog. 
     99 * The dialog should contain a list of TemplatedKeys. If the dialog is displayed when a single frame is selected, the list should contain the templated keys of the frame, otherwise - the templated keys of the current page. 
     100 * The list of TemplatedKeys can be obtained with the following code. Maybe, ResourceH is a good place for such a method: 
    101101{{{ 
    102102Class<? extends ResourceR4> resClass = ResourceR4.getClassByKind(ResourceR4.KEY_KIND.get(access)); 
    103 SubEntryNames subKeyNames = this.getSubEntryNames(resClass); 
    104103List<TemplatedKey<?>> tempKeys = ResourceR4.getKnownTemplatedKeys(resClass); 
    105104}}} 
    106  * The HUD should contain a BaseSwingVisualElement which will contain the list of checkboxes. It will depend on the list of TemplatedKeys. 
     105 * The dialog should contain a BaseSwingVisualElement which will contain the list of checkboxes. It will depend on the list of TemplatedKeys. 
    107106 
    108107=== BoundCheckBox === 
     
    111110   * It should contain a list property of BoundCheckBox, called subControls. 
    112111   * Its state should be auto-computed based on the state of the sub controls. If all checkboxes are checked, the main one is checked. If all are unchecked, the main one is unchecked. Otherwise it is grayed out, indicating a mix of the states of the sub controls. 
    113  
    114 === HUD logic === 
     112TemplateIntegrationTest 
     113=== Dialog logic === 
    115114 * The Add buttons will do the following (let's say that a frame is selected): 
    116115  * Create a new resource of a frame kind. 
    117   * Iterate over the checkboxes of the HUD and if set, set the appropriate key of the resource to USE_TEMPLATE mode, or CUSTOM otherwise. 
    118   * Set the selected frame as a template of the newly created one. 
     116  * Iterate over the checkboxes of the dialog and if NOT set, set the appropriate raw value of the key to the default one. This will be the indicator that this templated key is not going to be applied. By default, all raw values of the keys are null. 
     117  * Set the selected frame as a template of the newly created one. By iterating over all the TemplatedKeys, check the raw values of the template. If the value is null, then set the raw value of the key to null and remove the lock (if any). This will ensure that the mode is set to USE TEMPLATE. 
    119118  * Add the new frame to the frameTemplates list of the current book. 
    120119  * The same applies if a page is selected. 
    121  * The Cancel button closes the HUD. 
     120 * The Cancel button closes the dialog. 
    122121 * The Select all/none buttons iterate over the checkboxes and set the appropriate state. 
     122 
     123Test: [source:/branches/private/jani/GROUP_TEMPLATES_R3/sophie2-platform/modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/keys/TemplateIntegrationTest.java TemplateIntegrationTest] 
    123124 
    124125= Implementation =