|
@@ -1,33 +1,33 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.forms.server.support.nonpublic; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.forms.server.support.*; |
5 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
6 |
|
- |
import org.litesoft.configuration.*; |
7 |
|
- |
import org.litesoft.core.simpletypes.*; |
8 |
|
- |
|
9 |
|
- |
public abstract class AbstractNumericFormAMDFactory implements FormAttributeMetaDataFactory { |
10 |
|
- |
protected Configuration.CachedConfigInt mDefaultWidth; |
11 |
|
- |
|
12 |
|
- |
protected AbstractNumericFormAMDFactory( Configuration.CachedConfigInt pDefaultWidth ) { |
13 |
|
- |
mDefaultWidth = pDefaultWidth; |
14 |
|
- |
} |
15 |
|
- |
|
16 |
|
- |
protected Integer getDisplayCharsWidth( CreateAMDParamsPlus pParams ) { |
17 |
|
- |
return pParams.oneLineHintOveride( mDefaultWidth ); |
18 |
|
- |
} |
19 |
|
- |
|
20 |
|
- |
protected Integer getDecimalPlaces( CreateAMDParamsPlus pHintSource, Integer pDefaultDecimalPlaces ) { |
21 |
|
- |
String zDP = pHintSource.getHintValue( DECIMAL_PLACES ); |
22 |
|
- |
return Strings.isNullOrEmpty( zDP ) ? // |
23 |
|
- |
pDefaultDecimalPlaces : // |
24 |
|
- |
Integer.valueOf( zDP.trim() ); |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
protected NumericFormatControl getNumericFormatControl( CreateAMDParamsPlus pHintSource ) { |
28 |
|
- |
String zFC = pHintSource.getHintValue( FORMAT_CONTROL ); |
29 |
|
- |
return Strings.isNullOrEmpty( zFC ) ? // |
30 |
|
- |
NumericFormatControl.JUST_DOT : // |
31 |
|
- |
NumericFormatControl.rehydrate( zFC.trim() ); |
32 |
|
- |
} |
33 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.forms.server.support.nonpublic; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.forms.server.support.*; |
|
5 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
6 |
+ |
import org.litesoft.configuration.*; |
|
7 |
+ |
import org.litesoft.core.simpletypes.*; |
|
8 |
+ |
|
|
9 |
+ |
public abstract class AbstractNumericFormAMDFactory implements FormAttributeMetaDataFactory { |
|
10 |
+ |
protected Configuration.CachedConfigInt mDefaultWidth; |
|
11 |
+ |
|
|
12 |
+ |
protected AbstractNumericFormAMDFactory( Configuration.CachedConfigInt pDefaultWidth ) { |
|
13 |
+ |
mDefaultWidth = pDefaultWidth; |
|
14 |
+ |
} |
|
15 |
+ |
|
|
16 |
+ |
protected Integer getDisplayCharsWidth( CreateAMDParamsPlus pParams ) { |
|
17 |
+ |
return pParams.oneLineHintOveride( mDefaultWidth ); |
|
18 |
+ |
} |
|
19 |
+ |
|
|
20 |
+ |
protected Integer getDecimalPlaces( CreateAMDParamsPlus pHintSource, Integer pDefaultDecimalPlaces ) { |
|
21 |
+ |
String zDP = pHintSource.getHintValue( DECIMAL_PLACES ); |
|
22 |
+ |
return Currently.isNullOrEmpty( zDP ) ? // |
|
23 |
+ |
pDefaultDecimalPlaces : // |
|
24 |
+ |
Integer.valueOf( zDP.trim() ); |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
protected NumericFormatControl getNumericFormatControl( CreateAMDParamsPlus pHintSource ) { |
|
28 |
+ |
String zFC = pHintSource.getHintValue( FORMAT_CONTROL ); |
|
29 |
+ |
return Currently.isNullOrEmpty( zFC ) ? // |
|
30 |
+ |
NumericFormatControl.JUST_DOT : // |
|
31 |
+ |
NumericFormatControl.rehydrate( zFC.trim() ); |
|
32 |
+ |
} |
|
33 |
+ |
} |