|
@@ -1,114 +1,91 @@ |
1 |
1 |
|
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
2 |
|
package org.litesoft.GWT.forms.client.nonpublic; |
3 |
3 |
|
|
4 |
|
- |
import java.io.*; |
5 |
|
- |
|
6 |
4 |
|
import org.litesoft.GWT.client.widgets.*; |
7 |
5 |
|
import org.litesoft.ui.def.nonpublic.support.*; |
8 |
6 |
|
|
9 |
7 |
|
import com.google.gwt.user.client.ui.*; |
10 |
8 |
|
|
11 |
|
- |
public class TabSubFormRowCarrier implements SubFormRowCarrier |
12 |
|
- |
{ |
|
9 |
+ |
import java.io.*; |
|
10 |
+ |
|
|
11 |
+ |
public class TabSubFormRowCarrier implements SubFormRowCarrier { |
13 |
12 |
|
private SizeableSelectorPanel mSelectorPanel; |
14 |
13 |
|
|
15 |
|
- |
public TabSubFormRowCarrier( SizeableSelectorPanel pSelectorPanel ) |
16 |
|
- |
{ |
|
14 |
+ |
public TabSubFormRowCarrier( SizeableSelectorPanel pSelectorPanel ) { |
17 |
15 |
|
mSelectorPanel = pSelectorPanel; |
18 |
16 |
|
} |
19 |
17 |
|
|
20 |
|
- |
public void dispose() |
21 |
|
- |
{ |
22 |
|
- |
if ( mSelectorPanel != null ) |
23 |
|
- |
{ |
|
18 |
+ |
public void dispose() { |
|
19 |
+ |
if ( mSelectorPanel != null ) { |
24 |
20 |
|
clear(); |
25 |
21 |
|
mSelectorPanel = null; |
26 |
22 |
|
} |
27 |
23 |
|
} |
28 |
24 |
|
|
29 |
|
- |
public void clear() |
30 |
|
- |
{ |
|
25 |
+ |
public void clear() { |
31 |
26 |
|
int zTabCount = mSelectorPanel.getTabCount(); |
32 |
|
- |
while ( --zTabCount >= 0 ) |
33 |
|
- |
{ |
|
27 |
+ |
while ( --zTabCount >= 0 ) { |
34 |
28 |
|
mSelectorPanel.removeTab( zTabCount ); |
35 |
29 |
|
} |
36 |
30 |
|
} |
37 |
31 |
|
|
38 |
|
- |
public void remove( Widget pWidget ) |
39 |
|
- |
{ |
|
32 |
+ |
public void remove( Widget pWidget ) { |
40 |
33 |
|
int zIndex = mSelectorPanel.indexOfTabBodyWith( pWidget ); |
41 |
|
- |
if ( zIndex != -1 ) |
42 |
|
- |
{ |
|
34 |
+ |
if ( zIndex != -1 ) { |
43 |
35 |
|
mSelectorPanel.removeTab( zIndex ); |
44 |
36 |
|
} |
45 |
37 |
|
} |
46 |
38 |
|
|
47 |
|
- |
public void insert( Widget pWidget, int pBeforeIndex ) |
48 |
|
- |
{ |
|
39 |
+ |
public void insert( Widget pWidget, int pBeforeIndex ) { |
49 |
40 |
|
int zIndex = mSelectorPanel.indexOfTabBodyWith( pWidget ); |
50 |
|
- |
if ( zIndex == -1 ) |
51 |
|
- |
{ |
|
41 |
+ |
if ( zIndex == -1 ) { |
52 |
42 |
|
int zTabCount = mSelectorPanel.getTabCount(); |
53 |
43 |
|
mSelectorPanel.insertTab( pBeforeIndex, "Tab: " + zTabCount, pWidget ); |
54 |
|
- |
} |
55 |
|
- |
else if ( pBeforeIndex != zIndex ) |
56 |
|
- |
{ |
|
44 |
+ |
} else if ( pBeforeIndex != zIndex ) { |
57 |
45 |
|
mSelectorPanel.moveTab( zIndex, pBeforeIndex ); |
58 |
46 |
|
} |
59 |
47 |
|
} |
60 |
48 |
|
|
61 |
|
- |
public void membershipChangesComplete() |
62 |
|
- |
{ |
|
49 |
+ |
public void membershipChangesComplete() { |
63 |
50 |
|
mSelectorPanel.relayoutFromHereDown(); |
64 |
51 |
|
} |
65 |
52 |
|
|
66 |
53 |
|
public FormAttributeAdapter createTabAttributeAdapter( FormInstanceComponentHandler pComponentHandler, |
67 |
54 |
|
AttributeMetaData pTabAttributeMetaData, |
68 |
|
- |
Widget pWidget ) |
69 |
|
- |
{ |
|
55 |
+ |
Widget pWidget ) { |
70 |
56 |
|
return new MyFormAdapter( pComponentHandler, pTabAttributeMetaData, pWidget ); |
71 |
57 |
|
} |
72 |
58 |
|
|
73 |
|
- |
private final class MyFormAdapter extends AbstractFormAttributeAdapter |
74 |
|
- |
{ |
|
59 |
+ |
private final class MyFormAdapter extends AbstractFormAttributeAdapter { |
75 |
60 |
|
private Widget mWidget; |
76 |
61 |
|
|
77 |
62 |
|
public MyFormAdapter( FormInstanceComponentHandler pComponentHandler, AttributeMetaData pMD, |
78 |
|
- |
Widget pWidget ) |
79 |
|
- |
{ |
|
63 |
+ |
Widget pWidget ) { |
80 |
64 |
|
super( pComponentHandler, pMD, new NullFormComponent() ); |
81 |
65 |
|
mWidget = pWidget; |
82 |
66 |
|
} |
83 |
67 |
|
|
84 |
|
- |
protected Widget initWidget() |
85 |
|
- |
{ |
|
68 |
+ |
protected Widget initWidget() { |
86 |
69 |
|
return null; |
87 |
70 |
|
} |
88 |
71 |
|
|
89 |
|
- |
protected Object convertSendableToComponentValue( Serializable pValue ) |
90 |
|
- |
{ |
|
72 |
+ |
protected Object convertSendableToComponentValue( Serializable pValue ) { |
91 |
73 |
|
return pValue; |
92 |
74 |
|
} |
93 |
75 |
|
|
94 |
|
- |
protected String convertComponentValueToString( Object pValue ) |
95 |
|
- |
{ |
|
76 |
+ |
protected String convertComponentValueToString( Object pValue ) { |
96 |
77 |
|
return null; |
97 |
78 |
|
} |
98 |
79 |
|
|
99 |
|
- |
protected Object convertStringToComponentValue( String pValue ) |
100 |
|
- |
{ |
|
80 |
+ |
protected Object convertStringToComponentValue( String pValue ) { |
101 |
81 |
|
return null; |
102 |
82 |
|
} |
103 |
83 |
|
|
104 |
|
- |
protected void setComponentCurrentValue( Object pNewComponentCurrentValue ) |
105 |
|
- |
{ |
|
84 |
+ |
protected void setComponentCurrentValue( Object pNewComponentCurrentValue ) { |
106 |
85 |
|
super.setComponentCurrentValue( pNewComponentCurrentValue ); |
107 |
|
- |
if ( pNewComponentCurrentValue != null ) |
108 |
|
- |
{ |
|
86 |
+ |
if ( pNewComponentCurrentValue != null ) { |
109 |
87 |
|
int zIndex = mSelectorPanel.indexOfTabBodyWith( mWidget ); |
110 |
|
- |
if ( zIndex != -1 ) |
111 |
|
- |
{ |
|
88 |
+ |
if ( zIndex != -1 ) { |
112 |
89 |
|
mSelectorPanel.setTabText( zIndex, pNewComponentCurrentValue.toString() ); |
113 |
90 |
|
} |
114 |
91 |
|
} |