|
@@ -1,50 +1,50 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.forms.client.components.factories.others; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.forms.client.components.*; |
5 |
|
- |
import org.litesoft.GWT.forms.client.components.factories.*; |
6 |
|
- |
import org.litesoft.GWT.forms.client.nonpublic.*; |
7 |
|
- |
import org.litesoft.ui.def.*; |
8 |
|
- |
import org.litesoft.ui.def.nonpublic.*; |
9 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
10 |
|
- |
|
11 |
|
- |
import com.google.gwt.user.client.ui.*; |
12 |
|
- |
|
13 |
|
- |
import java.io.*; |
14 |
|
- |
|
15 |
|
- |
public class UiHiddenAttributeWidgetFactory |
16 |
|
- |
implements FormComponentFactory { |
17 |
|
- |
public Widget create( FormInstanceComponentHandler pComponentHandler, UiDef pUiDef, |
18 |
|
- |
FormMetaData pFormMetaData, boolean pHasHorizontalPeer ) { |
19 |
|
- |
UiHiddenAttributeDef zDef = (UiHiddenAttributeDef) pUiDef; |
20 |
|
- |
AttributeMetaData zMD = pFormMetaData.getAttribute( zDef ); |
21 |
|
- |
if ( zMD == null ) { |
22 |
|
- |
throw new IllegalStateException( "Metadata required for a " + zDef ); |
23 |
|
- |
} |
24 |
|
- |
return new MyFormAdapter( pComponentHandler, zMD, new NullFormComponent() ).init(); |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
private static final class MyFormAdapter |
28 |
|
- |
extends AbstractFormAttributeAdapter { |
29 |
|
- |
public MyFormAdapter( FormInstanceComponentHandler pComponentHandler, // |
30 |
|
- |
AttributeMetaData pMD, IFormComponent pComponent ) { |
31 |
|
- |
super( pComponentHandler, pMD, pComponent ); |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
protected Widget initWidget() { |
35 |
|
- |
return null; |
36 |
|
- |
} |
37 |
|
- |
|
38 |
|
- |
protected Object convertSendableToComponentValue( Serializable pValue ) { |
39 |
|
- |
return pValue; |
40 |
|
- |
} |
41 |
|
- |
|
42 |
|
- |
protected String convertComponentValueToString( Object pValue ) { |
43 |
|
- |
return null; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
protected Object convertStringToComponentValue( String pValue ) { |
47 |
|
- |
return null; |
48 |
|
- |
} |
49 |
|
- |
} |
50 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.forms.client.components.factories.others; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.forms.client.components.*; |
|
5 |
+ |
import org.litesoft.GWT.forms.client.components.factories.*; |
|
6 |
+ |
import org.litesoft.GWT.forms.client.nonpublic.*; |
|
7 |
+ |
import org.litesoft.ui.def.*; |
|
8 |
+ |
import org.litesoft.ui.def.nonpublic.*; |
|
9 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
10 |
+ |
|
|
11 |
+ |
import com.google.gwt.user.client.ui.*; |
|
12 |
+ |
|
|
13 |
+ |
import java.io.*; |
|
14 |
+ |
|
|
15 |
+ |
public class UiHiddenAttributeWidgetFactory |
|
16 |
+ |
implements FormComponentFactory { |
|
17 |
+ |
public Widget create( FormInstanceComponentHandler pComponentHandler, UiDef pUiDef, |
|
18 |
+ |
FormMetaData pFormMetaData, boolean pHasHorizontalPeer ) { |
|
19 |
+ |
UiHiddenAttributeDef zDef = (UiHiddenAttributeDef) pUiDef; |
|
20 |
+ |
AttributeMetaData zMD = pFormMetaData.getAttribute( zDef ); |
|
21 |
+ |
if ( zMD == null ) { |
|
22 |
+ |
throw new IllegalStateException( "Metadata required for a " + zDef ); |
|
23 |
+ |
} |
|
24 |
+ |
return new MyFormAdapter( pComponentHandler, zMD, new NullFormComponent() ).init(); |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
private static final class MyFormAdapter |
|
28 |
+ |
extends AbstractFormAttributeAdapter { |
|
29 |
+ |
public MyFormAdapter( FormInstanceComponentHandler pComponentHandler, // |
|
30 |
+ |
AttributeMetaData pMD, IFormComponent pComponent ) { |
|
31 |
+ |
super( pComponentHandler, pMD, pComponent ); |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
protected Widget initWidget() { |
|
35 |
+ |
return null; |
|
36 |
+ |
} |
|
37 |
+ |
|
|
38 |
+ |
protected Object convertSendableToComponentValue( Serializable pValue ) { |
|
39 |
+ |
return pValue; |
|
40 |
+ |
} |
|
41 |
+ |
|
|
42 |
+ |
protected String convertComponentValueToString( Object pValue ) { |
|
43 |
+ |
return null; |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
protected Object convertStringToComponentValue( String pValue ) { |
|
47 |
+ |
return null; |
|
48 |
+ |
} |
|
49 |
+ |
} |
|
50 |
+ |
} |