|
@@ -1,100 +1,100 @@ |
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.*; |
6 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
7 |
|
- |
|
8 |
|
- |
import com.google.gwt.user.client.ui.*; |
9 |
|
- |
|
10 |
|
- |
public class RelSubFormRowInstanceComponentHandlerImpl |
11 |
|
- |
extends AbstractFormInstanceComponentHandlerWithAttributes |
12 |
|
- |
implements RelSubFormRowInstanceComponentHandler { |
13 |
|
- |
private RelSubFormInstanceComponentHandlerImpl mParent; |
14 |
|
- |
private String mRowObjectKey; |
15 |
|
- |
private int mRowIndex; |
16 |
|
- |
private FormDataRowKey mFormDataRowKey; |
17 |
|
- |
private Widget mWidget = null; |
18 |
|
- |
|
19 |
|
- |
public RelSubFormRowInstanceComponentHandlerImpl( RelSubFormInstanceComponentHandlerImpl pParent, |
20 |
|
- |
String pRowObjectKey, int pRowIndex ) { |
21 |
|
- |
Objects.assertNotNull( "Parent", mParent = pParent ); |
22 |
|
- |
mRowObjectKey = Strings.assertNotNullNotEmpty( "RowObjectKey", pRowObjectKey ); |
23 |
|
- |
mRowIndex = pRowIndex; |
24 |
|
- |
mFormDataRowKey = new FormDataRowKey( getFormUniqueID(), mRowObjectKey ); |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
public void init( Widget pWidget ) { |
28 |
|
- |
Objects.assertNotNull( "Widget", mWidget = pWidget ); |
29 |
|
- |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
30 |
|
- |
zRowContainer.insert( mWidget, mRowIndex ); |
31 |
|
- |
zRowContainer.membershipChangesComplete(); |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
public void createTabAttributeAdapter( AttributeMetaData pTabAttributeMetaData ) { |
35 |
|
- |
SubFormRowCarrier zCarrier = mParent.getRowCarrier(); |
36 |
|
- |
addAttributeAdapter( zCarrier.createTabAttributeAdapter( this, pTabAttributeMetaData, mWidget ) ); |
37 |
|
- |
} |
38 |
|
- |
|
39 |
|
- |
public RelSubFormInstanceComponentHandler createRelSubFormInstanceComponentHandler( |
40 |
|
- |
UiRelSubFormDef pSubFormDef, FormMetaData pSubFormMetaData, SubFormRowCarrier pRowCarrier ) { |
41 |
|
- |
RelSubFormTypeHelper zTypeHelper = |
42 |
|
- |
mParent.getRelSubFormTypeHelperFor( pSubFormDef, pSubFormMetaData ); |
43 |
|
- |
return new RelSubFormInstanceComponentHandlerImpl( this, zTypeHelper, pRowCarrier ); |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
public UberFormInstanceComponentHandler getUberHandler() { |
47 |
|
- |
return mParent.getUberHandler(); |
48 |
|
- |
} |
49 |
|
- |
|
50 |
|
- |
public Integer getFormUniqueID() { |
51 |
|
- |
return mParent.getFormUniqueID(); |
52 |
|
- |
} |
53 |
|
- |
|
54 |
|
- |
public FormDataRowKey getFormDataRowKey() { |
55 |
|
- |
return mFormDataRowKey; |
56 |
|
- |
} |
57 |
|
- |
|
58 |
|
- |
public FormDataRowKey getParentFormDataRowKey() { |
59 |
|
- |
return mParent.getFormDataRowKey(); |
60 |
|
- |
} |
61 |
|
- |
|
62 |
|
- |
// Child Component Handler Management |
63 |
|
- |
protected void LLdispose( UberFormInstanceComponentHandler pUberHandler ) { |
64 |
|
- |
super.LLdispose( pUberHandler ); |
65 |
|
- |
|
66 |
|
- |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
67 |
|
- |
zRowContainer.remove( mWidget ); |
68 |
|
- |
zRowContainer.membershipChangesComplete(); |
69 |
|
- |
|
70 |
|
- |
mParent = null; |
71 |
|
- |
mRowObjectKey = null; |
72 |
|
- |
mWidget = null; |
73 |
|
- |
} |
74 |
|
- |
|
75 |
|
- |
public String getRowObjectKey() { |
76 |
|
- |
return mRowObjectKey; |
77 |
|
- |
} |
78 |
|
- |
|
79 |
|
- |
public int getRowIndex() { |
80 |
|
- |
return mRowIndex; |
81 |
|
- |
} |
82 |
|
- |
|
83 |
|
- |
public void setRowIndex( int pRowIndex ) { |
84 |
|
- |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
85 |
|
- |
zRowContainer.insert( mWidget, mRowIndex = pRowIndex ); // auto removes from current parent |
86 |
|
- |
zRowContainer.membershipChangesComplete(); |
87 |
|
- |
} |
88 |
|
- |
|
89 |
|
- |
public void decRowIndex() { |
90 |
|
- |
mRowIndex--; |
91 |
|
- |
} |
92 |
|
- |
|
93 |
|
- |
public void incRowIndex() { |
94 |
|
- |
mRowIndex++; |
95 |
|
- |
} |
96 |
|
- |
|
97 |
|
- |
public Widget getWidget() { |
98 |
|
- |
return mWidget; |
99 |
|
- |
} |
100 |
|
- |
} |
|
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.*; |
|
6 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
7 |
+ |
|
|
8 |
+ |
import com.google.gwt.user.client.ui.*; |
|
9 |
+ |
|
|
10 |
+ |
public class RelSubFormRowInstanceComponentHandlerImpl |
|
11 |
+ |
extends AbstractFormInstanceComponentHandlerWithAttributes |
|
12 |
+ |
implements RelSubFormRowInstanceComponentHandler { |
|
13 |
+ |
private RelSubFormInstanceComponentHandlerImpl mParent; |
|
14 |
+ |
private String mRowObjectKey; |
|
15 |
+ |
private int mRowIndex; |
|
16 |
+ |
private FormDataRowKey mFormDataRowKey; |
|
17 |
+ |
private Widget mWidget = null; |
|
18 |
+ |
|
|
19 |
+ |
public RelSubFormRowInstanceComponentHandlerImpl( RelSubFormInstanceComponentHandlerImpl pParent, |
|
20 |
+ |
String pRowObjectKey, int pRowIndex ) { |
|
21 |
+ |
Confirm.isNotNull( "Parent", mParent = pParent ); |
|
22 |
+ |
mRowObjectKey = Confirm.significant( "RowObjectKey", pRowObjectKey ); |
|
23 |
+ |
mRowIndex = pRowIndex; |
|
24 |
+ |
mFormDataRowKey = new FormDataRowKey( getFormUniqueID(), mRowObjectKey ); |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
public void init( Widget pWidget ) { |
|
28 |
+ |
Confirm.isNotNull( "Widget", mWidget = pWidget ); |
|
29 |
+ |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
|
30 |
+ |
zRowContainer.insert( mWidget, mRowIndex ); |
|
31 |
+ |
zRowContainer.membershipChangesComplete(); |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
public void createTabAttributeAdapter( AttributeMetaData pTabAttributeMetaData ) { |
|
35 |
+ |
SubFormRowCarrier zCarrier = mParent.getRowCarrier(); |
|
36 |
+ |
addAttributeAdapter( zCarrier.createTabAttributeAdapter( this, pTabAttributeMetaData, mWidget ) ); |
|
37 |
+ |
} |
|
38 |
+ |
|
|
39 |
+ |
public RelSubFormInstanceComponentHandler createRelSubFormInstanceComponentHandler( |
|
40 |
+ |
UiRelSubFormDef pSubFormDef, FormMetaData pSubFormMetaData, SubFormRowCarrier pRowCarrier ) { |
|
41 |
+ |
RelSubFormTypeHelper zTypeHelper = |
|
42 |
+ |
mParent.getRelSubFormTypeHelperFor( pSubFormDef, pSubFormMetaData ); |
|
43 |
+ |
return new RelSubFormInstanceComponentHandlerImpl( this, zTypeHelper, pRowCarrier ); |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
public UberFormInstanceComponentHandler getUberHandler() { |
|
47 |
+ |
return mParent.getUberHandler(); |
|
48 |
+ |
} |
|
49 |
+ |
|
|
50 |
+ |
public Integer getFormUniqueID() { |
|
51 |
+ |
return mParent.getFormUniqueID(); |
|
52 |
+ |
} |
|
53 |
+ |
|
|
54 |
+ |
public FormDataRowKey getFormDataRowKey() { |
|
55 |
+ |
return mFormDataRowKey; |
|
56 |
+ |
} |
|
57 |
+ |
|
|
58 |
+ |
public FormDataRowKey getParentFormDataRowKey() { |
|
59 |
+ |
return mParent.getFormDataRowKey(); |
|
60 |
+ |
} |
|
61 |
+ |
|
|
62 |
+ |
// Child Component Handler Management |
|
63 |
+ |
protected void LLdispose( UberFormInstanceComponentHandler pUberHandler ) { |
|
64 |
+ |
super.LLdispose( pUberHandler ); |
|
65 |
+ |
|
|
66 |
+ |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
|
67 |
+ |
zRowContainer.remove( mWidget ); |
|
68 |
+ |
zRowContainer.membershipChangesComplete(); |
|
69 |
+ |
|
|
70 |
+ |
mParent = null; |
|
71 |
+ |
mRowObjectKey = null; |
|
72 |
+ |
mWidget = null; |
|
73 |
+ |
} |
|
74 |
+ |
|
|
75 |
+ |
public String getRowObjectKey() { |
|
76 |
+ |
return mRowObjectKey; |
|
77 |
+ |
} |
|
78 |
+ |
|
|
79 |
+ |
public int getRowIndex() { |
|
80 |
+ |
return mRowIndex; |
|
81 |
+ |
} |
|
82 |
+ |
|
|
83 |
+ |
public void setRowIndex( int pRowIndex ) { |
|
84 |
+ |
SubFormRowCarrier zRowContainer = mParent.getRowCarrier(); |
|
85 |
+ |
zRowContainer.insert( mWidget, mRowIndex = pRowIndex ); // auto removes from current parent |
|
86 |
+ |
zRowContainer.membershipChangesComplete(); |
|
87 |
+ |
} |
|
88 |
+ |
|
|
89 |
+ |
public void decRowIndex() { |
|
90 |
+ |
mRowIndex--; |
|
91 |
+ |
} |
|
92 |
+ |
|
|
93 |
+ |
public void incRowIndex() { |
|
94 |
+ |
mRowIndex++; |
|
95 |
+ |
} |
|
96 |
+ |
|
|
97 |
+ |
public Widget getWidget() { |
|
98 |
+ |
return mWidget; |
|
99 |
+ |
} |
|
100 |
+ |
} |