|
@@ -1,94 +1,94 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.forms.client.nonpublic; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
5 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
6 |
|
- |
|
7 |
|
- |
public abstract class AbstractFormInstanceComponentHandlerWithAttributes extends AbstractFormInstanceComponentHandler |
8 |
|
- |
implements RelSubFormInstanceParentable { |
9 |
|
- |
// Attribute Management |
10 |
|
- |
protected AttributeAdapterManager mAttributeAdapters = new AttributeAdapterManager(); |
11 |
|
- |
|
12 |
|
- |
public void addAttributeAdapter( FormAttributeAdapter pAttributeAdapter ) { |
13 |
|
- |
mAttributeAdapters.add( pAttributeAdapter ); |
14 |
|
- |
} |
15 |
|
- |
|
16 |
|
- |
protected void LLdisposeAttributes( UberFormInstanceComponentHandler pUberHandler ) { |
17 |
|
- |
mAttributeAdapters.dispose(); |
18 |
|
- |
mAttributeAdapters = null; |
19 |
|
- |
} |
20 |
|
- |
|
21 |
|
- |
protected boolean LLsetInputDisabledOnUs( String pAttributeName, boolean pDisabled ) { |
22 |
|
- |
return mAttributeAdapters.setInputDisabled( pAttributeName, pDisabled ); |
23 |
|
- |
} |
24 |
|
- |
|
25 |
|
- |
protected void LLapplyOnUs( AttributeUpdateFormData[] pAttributeUpdatesNonNullOrEmpty ) { |
26 |
|
- |
mAttributeAdapters.apply( getFormDataRowKey(), pAttributeUpdatesNonNullOrEmpty ); |
27 |
|
- |
} |
28 |
|
- |
|
29 |
|
- |
protected boolean LLanyUserInitiatedRowChangeOnUs() { |
30 |
|
- |
return false; |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
protected boolean LLrecalcAnyAttributesOnUs( FormAttributeAdapter.BooleanValueAccessor pValueAccessor ) { |
34 |
|
- |
return mAttributeAdapters.recalcAnyAttributes( pValueAccessor ); |
35 |
|
- |
} |
36 |
|
- |
|
37 |
|
- |
protected void LLpublishAnyPendingAttributeChangesOnUs() { |
38 |
|
- |
mAttributeAdapters.publishAnyPendingAttributeChanges(); |
39 |
|
- |
} |
40 |
|
- |
|
41 |
|
- |
// Child Component Handler Management |
42 |
|
- |
private RelSubFormInstanceChildManager mChildManager = new RelSubFormInstanceChildManager(); |
43 |
|
- |
|
44 |
|
- |
public void addChild( RelSubFormInstanceComponentHandlerImpl pComponentHandler ) { |
45 |
|
- |
mChildManager.addChild( pComponentHandler ); |
46 |
|
- |
} |
47 |
|
- |
|
48 |
|
- |
protected void LLapplyOnChildren( ActionUpdateFormData[] pActionUpdates ) { |
49 |
|
- |
mChildManager.apply( pActionUpdates ); |
50 |
|
- |
} |
51 |
|
- |
|
52 |
|
- |
protected void LLupdateInputStateOnChildren( boolean pAnyChanged, boolean pAnyErrors ) { |
53 |
|
- |
mChildManager.updateInputState( pAnyChanged, pAnyErrors ); |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
protected boolean LLsetActionDisabledOnChildren( FormDataRowKey pFormDataRowKey, String pActionID, boolean pDisabled ) { |
57 |
|
- |
return mChildManager.setActionDisabled( pFormDataRowKey, pActionID, pDisabled ); |
58 |
|
- |
} |
59 |
|
- |
|
60 |
|
- |
protected boolean LLsetInputDisabledOnChildren( FormDataRowKey pFormDataRowKey, String pAttributeName, boolean pDisabled ) { |
61 |
|
- |
return mChildManager.setInputDisabled( pFormDataRowKey, pAttributeName, pDisabled ); |
62 |
|
- |
} |
63 |
|
- |
|
64 |
|
- |
protected void LLapplyOnChildren( AttributeUpdateFormData[] pAttributeUpdates ) { |
65 |
|
- |
mChildManager.apply( pAttributeUpdates ); |
66 |
|
- |
} |
67 |
|
- |
|
68 |
|
- |
protected boolean LLanyUserInitiatedRowChangeOnChildren() { |
69 |
|
- |
return mChildManager.anyUserInitiatedRowChange(); |
70 |
|
- |
} |
71 |
|
- |
|
72 |
|
- |
protected boolean LLrecalcAnyAttributesOnChildren( FormAttributeAdapter.BooleanValueAccessor pValueAccessor ) { |
73 |
|
- |
return mChildManager.recalcAnyAttributes( pValueAccessor ); |
74 |
|
- |
} |
75 |
|
- |
|
76 |
|
- |
protected void LLpublishAnyPendingAttributeChangesOnChildren() { |
77 |
|
- |
mChildManager.publishAnyPendingAttributeChanges(); |
78 |
|
- |
} |
79 |
|
- |
|
80 |
|
- |
public void apply( RelSubFormRowKeys[] pList, boolean pFullUpdate, boolean pUserInitiatedAddOrRemoveRow ) { |
81 |
|
- |
if ( isActive() && Objects.isNotNullOrEmpty( pList ) ) { |
82 |
|
- |
mChildManager.apply( pList, pFullUpdate, pUserInitiatedAddOrRemoveRow ); |
83 |
|
- |
} |
84 |
|
- |
} |
85 |
|
- |
|
86 |
|
- |
// General |
87 |
|
- |
protected void LLdispose( UberFormInstanceComponentHandler pUberHandler ) { |
88 |
|
- |
mChildManager.dispose( pUberHandler ); |
89 |
|
- |
|
90 |
|
- |
super.LLdispose( pUberHandler ); |
91 |
|
- |
|
92 |
|
- |
LLdisposeAttributes( pUberHandler ); |
93 |
|
- |
} |
94 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.forms.client.nonpublic; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
5 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
6 |
+ |
|
|
7 |
+ |
public abstract class AbstractFormInstanceComponentHandlerWithAttributes extends AbstractFormInstanceComponentHandler |
|
8 |
+ |
implements RelSubFormInstanceParentable { |
|
9 |
+ |
// Attribute Management |
|
10 |
+ |
protected AttributeAdapterManager mAttributeAdapters = new AttributeAdapterManager(); |
|
11 |
+ |
|
|
12 |
+ |
public void addAttributeAdapter( FormAttributeAdapter pAttributeAdapter ) { |
|
13 |
+ |
mAttributeAdapters.add( pAttributeAdapter ); |
|
14 |
+ |
} |
|
15 |
+ |
|
|
16 |
+ |
protected void LLdisposeAttributes( UberFormInstanceComponentHandler pUberHandler ) { |
|
17 |
+ |
mAttributeAdapters.dispose(); |
|
18 |
+ |
mAttributeAdapters = null; |
|
19 |
+ |
} |
|
20 |
+ |
|
|
21 |
+ |
protected boolean LLsetInputDisabledOnUs( String pAttributeName, boolean pDisabled ) { |
|
22 |
+ |
return mAttributeAdapters.setInputDisabled( pAttributeName, pDisabled ); |
|
23 |
+ |
} |
|
24 |
+ |
|
|
25 |
+ |
protected void LLapplyOnUs( AttributeUpdateFormData[] pAttributeUpdatesNonNullOrEmpty ) { |
|
26 |
+ |
mAttributeAdapters.apply( getFormDataRowKey(), pAttributeUpdatesNonNullOrEmpty ); |
|
27 |
+ |
} |
|
28 |
+ |
|
|
29 |
+ |
protected boolean LLanyUserInitiatedRowChangeOnUs() { |
|
30 |
+ |
return false; |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
protected boolean LLrecalcAnyAttributesOnUs( FormAttributeAdapter.BooleanValueAccessor pValueAccessor ) { |
|
34 |
+ |
return mAttributeAdapters.recalcAnyAttributes( pValueAccessor ); |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
protected void LLpublishAnyPendingAttributeChangesOnUs() { |
|
38 |
+ |
mAttributeAdapters.publishAnyPendingAttributeChanges(); |
|
39 |
+ |
} |
|
40 |
+ |
|
|
41 |
+ |
// Child Component Handler Management |
|
42 |
+ |
private RelSubFormInstanceChildManager mChildManager = new RelSubFormInstanceChildManager(); |
|
43 |
+ |
|
|
44 |
+ |
public void addChild( RelSubFormInstanceComponentHandlerImpl pComponentHandler ) { |
|
45 |
+ |
mChildManager.addChild( pComponentHandler ); |
|
46 |
+ |
} |
|
47 |
+ |
|
|
48 |
+ |
protected void LLapplyOnChildren( ActionUpdateFormData[] pActionUpdates ) { |
|
49 |
+ |
mChildManager.apply( pActionUpdates ); |
|
50 |
+ |
} |
|
51 |
+ |
|
|
52 |
+ |
protected void LLupdateInputStateOnChildren( boolean pAnyChanged, boolean pAnyErrors ) { |
|
53 |
+ |
mChildManager.updateInputState( pAnyChanged, pAnyErrors ); |
|
54 |
+ |
} |
|
55 |
+ |
|
|
56 |
+ |
protected boolean LLsetActionDisabledOnChildren( FormDataRowKey pFormDataRowKey, String pActionID, boolean pDisabled ) { |
|
57 |
+ |
return mChildManager.setActionDisabled( pFormDataRowKey, pActionID, pDisabled ); |
|
58 |
+ |
} |
|
59 |
+ |
|
|
60 |
+ |
protected boolean LLsetInputDisabledOnChildren( FormDataRowKey pFormDataRowKey, String pAttributeName, boolean pDisabled ) { |
|
61 |
+ |
return mChildManager.setInputDisabled( pFormDataRowKey, pAttributeName, pDisabled ); |
|
62 |
+ |
} |
|
63 |
+ |
|
|
64 |
+ |
protected void LLapplyOnChildren( AttributeUpdateFormData[] pAttributeUpdates ) { |
|
65 |
+ |
mChildManager.apply( pAttributeUpdates ); |
|
66 |
+ |
} |
|
67 |
+ |
|
|
68 |
+ |
protected boolean LLanyUserInitiatedRowChangeOnChildren() { |
|
69 |
+ |
return mChildManager.anyUserInitiatedRowChange(); |
|
70 |
+ |
} |
|
71 |
+ |
|
|
72 |
+ |
protected boolean LLrecalcAnyAttributesOnChildren( FormAttributeAdapter.BooleanValueAccessor pValueAccessor ) { |
|
73 |
+ |
return mChildManager.recalcAnyAttributes( pValueAccessor ); |
|
74 |
+ |
} |
|
75 |
+ |
|
|
76 |
+ |
protected void LLpublishAnyPendingAttributeChangesOnChildren() { |
|
77 |
+ |
mChildManager.publishAnyPendingAttributeChanges(); |
|
78 |
+ |
} |
|
79 |
+ |
|
|
80 |
+ |
public void apply( RelSubFormRowKeys[] pList, boolean pFullUpdate, boolean pUserInitiatedAddOrRemoveRow ) { |
|
81 |
+ |
if ( isActive() && Currently.isNotNullOrEmpty( pList ) ) { |
|
82 |
+ |
mChildManager.apply( pList, pFullUpdate, pUserInitiatedAddOrRemoveRow ); |
|
83 |
+ |
} |
|
84 |
+ |
} |
|
85 |
+ |
|
|
86 |
+ |
// General |
|
87 |
+ |
protected void LLdispose( UberFormInstanceComponentHandler pUberHandler ) { |
|
88 |
+ |
mChildManager.dispose( pUberHandler ); |
|
89 |
+ |
|
|
90 |
+ |
super.LLdispose( pUberHandler ); |
|
91 |
+ |
|
|
92 |
+ |
LLdisposeAttributes( pUberHandler ); |
|
93 |
+ |
} |
|
94 |
+ |
} |