From c5363c948cfdfe5f3078fc0ae866e0de64761b6b Mon Sep 17 00:00:00 2001 From: hassany Date: Wed, 12 Mar 2014 21:51:15 +0100 Subject: [PATCH] Extend documentation --- .../wsf_js_widget/kernel/webcontrol/wsf_control.e | 2 +- .../kernel/webcontrol/wsf_dynamic_multi_control.e | 8 +++++++- .../kernel/webcontrol/wsf_multi_control.e | 14 ++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e index 96ceddd4..953fa39f 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e @@ -211,7 +211,7 @@ feature -- Properties control_name_prefix: STRING_32 assign set_control_name_prefix -- Used to avoid name conflicts since the children stateful controls of stateless controls are appended to the parent - -- control state and therefore could have the same name + -- control state and therefore could have the same name (Stateless multi controls do not add a hierarchy level) set_control_name_prefix (p: STRING_32) -- Set the control name prefix diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_dynamic_multi_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_dynamic_multi_control.e index f5b0f4aa..7e73e3c6 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_dynamic_multi_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_dynamic_multi_control.e @@ -1,5 +1,8 @@ note - description: "Summary description for {WSF_DYNAMIC_MULTI_CONTROL}." + description: "[ + Dynamic Mutli controls are multicontrols in which the subcontrols can be added or removed + on a callback. This is achived by ''serializing'' the subcrontrols using the tag array. + ]" author: "" date: "$Date$" revision: "$Revision$" @@ -125,10 +128,13 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management feature create_control_from_tag (tag: STRING_32): detachable G + -- This function should return a control based on the tag string. The output of this function + -- should only be based on the tag argument. deferred end add_control_from_tag (tag: STRING_32) + -- Adds a control based on the tag local item: WSF_JSON_OBJECT do diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e index 45a90e61..569c3ed1 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e @@ -55,6 +55,8 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management end load_subcontrol_state (newstate: JSON_OBJECT) + -- load the new state in to the subcontrols + -- If the subcontrol is a stateless multicontrol x. We load the controls_state in to the subcontrols of x directly. (Stateless multi controls do not add a hierarchy level) do across controls as c @@ -86,6 +88,8 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management end read_subcontrol_state (controls_state: JSON_OBJECT) + -- Read add subcontrol state in to the controls_state json object. + -- If the subcontrol is a stateless multicontrol x. We add the state of the subcontrols of x directly to controls_state. (Stateless multi controls do not add a hierarchy level) do across controls as c @@ -99,7 +103,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management end read_state_changes (states: WSF_JSON_OBJECT) - -- Read states_changes in subcontrols + -- Read states_changes in subcontrols and add them to the states json object under `control name > "controls" local sub_states: WSF_JSON_OBJECT control_state: WSF_JSON_OBJECT @@ -118,15 +122,17 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management end end - read_subcontrol_state_changes (states: WSF_JSON_OBJECT) + read_subcontrol_state_changes (sub_states: WSF_JSON_OBJECT) + -- Read add subcontrol changes in to the sub_states json object. + -- If the subcontrol is a stateless multicontrol x. We add the state changes of subcontrols of x directly to sub_states. (Stateless multi controls do not add a hierarchy level) do across controls as c loop if attached {WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]} c.item as cont then - cont.read_subcontrol_state_changes (states) + cont.read_subcontrol_state_changes (sub_states) elseif attached {WSF_CONTROL} c.item as cont then - cont.read_state_changes (states) + cont.read_state_changes (sub_states) end end end