Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/OldClient/src/org/litesoft/GWT/forms/client/nonpublic/TabSubFormRowCarrier.java

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