|
@@ -1,59 +1,59 @@ |
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.GWT.client.widgets.nonpublic.*; |
5 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
6 |
|
- |
|
7 |
|
- |
import com.google.gwt.user.client.ui.*; |
8 |
|
- |
|
9 |
|
- |
public class VerticalSubFormRowCarrier implements SubFormRowCarrier { |
10 |
|
- |
private AbstractSizeableVerticalRegularPanel mRowContainer; |
11 |
|
- |
private Widget mEmptyFiller = null; |
12 |
|
- |
|
13 |
|
- |
public VerticalSubFormRowCarrier( AbstractSizeableVerticalRegularPanel pRowContainer ) { |
14 |
|
- |
mRowContainer = pRowContainer; |
15 |
|
- |
addEmptyEntry(); |
16 |
|
- |
} |
17 |
|
- |
|
18 |
|
- |
public void dispose() { |
19 |
|
- |
if ( mRowContainer != null ) { |
20 |
|
- |
mRowContainer.clear(); |
21 |
|
- |
mRowContainer = null; |
22 |
|
- |
} |
23 |
|
- |
mEmptyFiller = null; |
24 |
|
- |
} |
25 |
|
- |
|
26 |
|
- |
public void clear() { |
27 |
|
- |
mRowContainer.clear(); |
28 |
|
- |
addEmptyEntry(); |
29 |
|
- |
} |
30 |
|
- |
|
31 |
|
- |
public void remove( Widget pWidget ) { |
32 |
|
- |
if ( mRowContainer.remove( pWidget ) ) { |
33 |
|
- |
if ( mRowContainer.getWidgetCount() == 0 ) { |
34 |
|
- |
addEmptyEntry(); |
35 |
|
- |
} |
36 |
|
- |
} |
37 |
|
- |
} |
38 |
|
- |
|
39 |
|
- |
public void insert( Widget pWidget, int pBeforeIndex ) { |
40 |
|
- |
mRowContainer.insert( pWidget, pBeforeIndex ); |
41 |
|
- |
if ( mEmptyFiller != null ) { |
42 |
|
- |
mRowContainer.remove( mEmptyFiller ); |
43 |
|
- |
mEmptyFiller = null; |
44 |
|
- |
} |
45 |
|
- |
} |
46 |
|
- |
|
47 |
|
- |
public void membershipChangesComplete() { |
48 |
|
- |
mRowContainer.relayoutFromHereDown(); |
49 |
|
- |
} |
50 |
|
- |
|
51 |
|
- |
public FormAttributeAdapter createTabAttributeAdapter( FormInstanceComponentHandler pComponentHandler, |
52 |
|
- |
AttributeMetaData pTabAttributeMetaData, Widget pWidget ) { |
53 |
|
- |
return null; |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
private void addEmptyEntry() { |
57 |
|
- |
mRowContainer.add( mEmptyFiller = new Label( " " ) ); |
58 |
|
- |
} |
59 |
|
- |
} |
|
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.GWT.client.widgets.nonpublic.*; |
|
5 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
6 |
+ |
|
|
7 |
+ |
import com.google.gwt.user.client.ui.*; |
|
8 |
+ |
|
|
9 |
+ |
public class VerticalSubFormRowCarrier implements SubFormRowCarrier { |
|
10 |
+ |
private AbstractSizeableVerticalRegularPanel mRowContainer; |
|
11 |
+ |
private Widget mEmptyFiller = null; |
|
12 |
+ |
|
|
13 |
+ |
public VerticalSubFormRowCarrier( AbstractSizeableVerticalRegularPanel pRowContainer ) { |
|
14 |
+ |
mRowContainer = pRowContainer; |
|
15 |
+ |
addEmptyEntry(); |
|
16 |
+ |
} |
|
17 |
+ |
|
|
18 |
+ |
public void dispose() { |
|
19 |
+ |
if ( mRowContainer != null ) { |
|
20 |
+ |
mRowContainer.clear(); |
|
21 |
+ |
mRowContainer = null; |
|
22 |
+ |
} |
|
23 |
+ |
mEmptyFiller = null; |
|
24 |
+ |
} |
|
25 |
+ |
|
|
26 |
+ |
public void clear() { |
|
27 |
+ |
mRowContainer.clear(); |
|
28 |
+ |
addEmptyEntry(); |
|
29 |
+ |
} |
|
30 |
+ |
|
|
31 |
+ |
public void remove( Widget pWidget ) { |
|
32 |
+ |
if ( mRowContainer.remove( pWidget ) ) { |
|
33 |
+ |
if ( mRowContainer.getWidgetCount() == 0 ) { |
|
34 |
+ |
addEmptyEntry(); |
|
35 |
+ |
} |
|
36 |
+ |
} |
|
37 |
+ |
} |
|
38 |
+ |
|
|
39 |
+ |
public void insert( Widget pWidget, int pBeforeIndex ) { |
|
40 |
+ |
mRowContainer.insert( pWidget, pBeforeIndex ); |
|
41 |
+ |
if ( mEmptyFiller != null ) { |
|
42 |
+ |
mRowContainer.remove( mEmptyFiller ); |
|
43 |
+ |
mEmptyFiller = null; |
|
44 |
+ |
} |
|
45 |
+ |
} |
|
46 |
+ |
|
|
47 |
+ |
public void membershipChangesComplete() { |
|
48 |
+ |
mRowContainer.relayoutFromHereDown(); |
|
49 |
+ |
} |
|
50 |
+ |
|
|
51 |
+ |
public FormAttributeAdapter createTabAttributeAdapter( FormInstanceComponentHandler pComponentHandler, |
|
52 |
+ |
AttributeMetaData pTabAttributeMetaData, Widget pWidget ) { |
|
53 |
+ |
return null; |
|
54 |
+ |
} |
|
55 |
+ |
|
|
56 |
+ |
private void addEmptyEntry() { |
|
57 |
+ |
mRowContainer.add( mEmptyFiller = new Label( " " ) ); |
|
58 |
+ |
} |
|
59 |
+ |
} |