|
@@ -1,35 +1,35 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.forms.server.support.mdconstruction; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.forms.server.support.*; |
5 |
|
- |
import org.litesoft.GWT.forms.server.support.nonpublic.*; |
6 |
|
- |
import org.litesoft.core.simpletypes.*; |
7 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
8 |
|
- |
import org.litesoft.ui_1_5.def.*; |
9 |
|
- |
|
10 |
|
- |
public class ComboBoxFormAMD { |
11 |
|
- |
public static final ComboBoxFormAMD INSTANCE = new ComboBoxFormAMD(); |
12 |
|
- |
|
13 |
|
- |
public AMDconverterPair create( CreateAMDParamsPlus pParams, FormSendableDataConverter pConverter, |
14 |
|
- |
SimpleKeyValuePair[] pMDoptions ) { |
15 |
|
- |
SimpleKeyValuePair optionZero = createNoSendOptionZero( pParams ); |
16 |
|
- |
return new AMDconverterPair( pConverter, // |
17 |
|
- |
new ComboBoxMetaData( pParams.getUsage(), pParams.isDisabled(), // |
18 |
|
- |
pParams.getFieldLabel(), // |
19 |
|
- |
pParams.getFieldTooltip(), // |
20 |
|
- |
pParams.isRequired(), // |
21 |
|
- |
pParams.getErrorTextForRequired(), // |
22 |
|
- |
optionZero, pMDoptions ) ); |
23 |
|
- |
} |
24 |
|
- |
|
25 |
|
- |
public static SimpleKeyValuePair createNoSendOptionZero( CreateAMDParamsPlus pParams ) { |
26 |
|
- |
if ( pParams.isRequired() ) { |
27 |
|
- |
String value = pParams.getHintValue( UI.Hints.COMBO_REQUIRED_DEFAULT ); |
28 |
|
- |
if ( value != null ) { |
29 |
|
- |
return new StringKeyValuePair( value ); |
30 |
|
- |
} |
31 |
|
- |
} |
32 |
|
- |
String value = pParams.getHintValue( UI.Hints.COMBO_DEFAULT ); |
33 |
|
- |
return (value != null) ? new StringKeyValuePair( value ) : null; |
34 |
|
- |
} |
35 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.forms.server.support.mdconstruction; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.forms.server.support.*; |
|
5 |
+ |
import org.litesoft.GWT.forms.server.support.nonpublic.*; |
|
6 |
+ |
import org.litesoft.core.simpletypes.*; |
|
7 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
8 |
+ |
import org.litesoft.ui_1_5.def.*; |
|
9 |
+ |
|
|
10 |
+ |
public class ComboBoxFormAMD { |
|
11 |
+ |
public static final ComboBoxFormAMD INSTANCE = new ComboBoxFormAMD(); |
|
12 |
+ |
|
|
13 |
+ |
public AMDconverterPair create( CreateAMDParamsPlus pParams, FormSendableDataConverter pConverter, |
|
14 |
+ |
SimpleKeyValuePair[] pMDoptions ) { |
|
15 |
+ |
SimpleKeyValuePair optionZero = createNoSendOptionZero( pParams ); |
|
16 |
+ |
return new AMDconverterPair( pConverter, // |
|
17 |
+ |
new ComboBoxMetaData( pParams.getUsage(), pParams.isDisabled(), // |
|
18 |
+ |
pParams.getFieldLabel(), // |
|
19 |
+ |
pParams.getFieldTooltip(), // |
|
20 |
+ |
pParams.isRequired(), // |
|
21 |
+ |
pParams.getErrorTextForRequired(), // |
|
22 |
+ |
optionZero, pMDoptions ) ); |
|
23 |
+ |
} |
|
24 |
+ |
|
|
25 |
+ |
public static SimpleKeyValuePair createNoSendOptionZero( CreateAMDParamsPlus pParams ) { |
|
26 |
+ |
if ( pParams.isRequired() ) { |
|
27 |
+ |
String value = pParams.getHintValue( UI.Hints.COMBO_REQUIRED_DEFAULT ); |
|
28 |
+ |
if ( value != null ) { |
|
29 |
+ |
return new StringKeyValuePair( value ); |
|
30 |
+ |
} |
|
31 |
+ |
} |
|
32 |
+ |
String value = pParams.getHintValue( UI.Hints.COMBO_DEFAULT ); |
|
33 |
+ |
return (value != null) ? new StringKeyValuePair( value ) : null; |
|
34 |
+ |
} |
|
35 |
+ |
} |