Changes between Version 14 and Version 15 of GROUP_TEMPLATES_R3
- Timestamp:
- 09/24/09 23:08:01 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GROUP_TEMPLATES_R3
v14 v15 6 6 7 7 == Overview == 8 In order to improve usability of the templates, introduce a HUDthat appears when user adds an object as a template. There the user should select which of the options will be templated.8 In 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. 9 9 == Task requirements == 10 10 * Create a dialog that pops up when the "Add to template" halo is clicked. The dialog should contain … … 94 94 95 95 = Design = 96 === HUDand HALO ===97 * An AddTemplate Hudshould 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 HUDis 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: 101 101 {{{ 102 102 Class<? extends ResourceR4> resClass = ResourceR4.getClassByKind(ResourceR4.KEY_KIND.get(access)); 103 SubEntryNames subKeyNames = this.getSubEntryNames(resClass);104 103 List<TemplatedKey<?>> tempKeys = ResourceR4.getKnownTemplatedKeys(resClass); 105 104 }}} 106 * The HUDshould 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. 107 106 108 107 === BoundCheckBox === … … 111 110 * It should contain a list property of BoundCheckBox, called subControls. 112 111 * 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 === HUDlogic ===112 TemplateIntegrationTest 113 === Dialog logic === 115 114 * The Add buttons will do the following (let's say that a frame is selected): 116 115 * 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. 119 118 * Add the new frame to the frameTemplates list of the current book. 120 119 * The same applies if a page is selected. 121 * The Cancel button closes the HUD.120 * The Cancel button closes the dialog. 122 121 * The Select all/none buttons iterate over the checkboxes and set the appropriate state. 122 123 Test: [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] 123 124 124 125 = Implementation =