|
@@ -1,30 +1,30 @@ |
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.forms.client.components.*; |
5 |
|
- |
import org.litesoft.ui.def.nonpublic.support.*; |
6 |
|
- |
|
7 |
|
- |
import java.io.*; |
8 |
|
- |
|
9 |
|
- |
public abstract class AbstractFormRequireableAttributeAdapter extends AbstractFormAttributeAdapter { |
10 |
|
- |
private boolean mRequired; |
11 |
|
- |
private String mErrorTextForRequired; |
12 |
|
- |
|
13 |
|
- |
protected AbstractFormRequireableAttributeAdapter( FormInstanceComponentHandler pComponentHandler, // |
14 |
|
- |
AttributeMetaData pMD, UiRequirableMetaData pRMD, |
15 |
|
- |
IFormComponent pComponent ) { |
16 |
|
- |
super( pComponentHandler, pMD, pComponent ); |
17 |
|
- |
mRequired = pRMD.isRequired(); |
18 |
|
- |
mErrorTextForRequired = pRMD.getErrorTextForRequired(); |
19 |
|
- |
} |
20 |
|
- |
|
21 |
|
- |
protected String transformErrorText( String pErrorText, Serializable pSendableCurrentValue, |
22 |
|
- |
Object pComponentCurrentValue ) { |
23 |
|
- |
String zErrorText = super.transformErrorText( pErrorText, // |
24 |
|
- |
pSendableCurrentValue, // |
25 |
|
- |
pComponentCurrentValue ); |
26 |
|
- |
return (mRequired && (zErrorText == null) && (pSendableCurrentValue == null)) ? // |
27 |
|
- |
mErrorTextForRequired : // |
28 |
|
- |
zErrorText; |
29 |
|
- |
} |
30 |
|
- |
} |
|
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.forms.client.components.*; |
|
5 |
+ |
import org.litesoft.ui.def.nonpublic.support.*; |
|
6 |
+ |
|
|
7 |
+ |
import java.io.*; |
|
8 |
+ |
|
|
9 |
+ |
public abstract class AbstractFormRequireableAttributeAdapter extends AbstractFormAttributeAdapter { |
|
10 |
+ |
private boolean mRequired; |
|
11 |
+ |
private String mErrorTextForRequired; |
|
12 |
+ |
|
|
13 |
+ |
protected AbstractFormRequireableAttributeAdapter( FormInstanceComponentHandler pComponentHandler, // |
|
14 |
+ |
AttributeMetaData pMD, UiRequirableMetaData pRMD, |
|
15 |
+ |
IFormComponent pComponent ) { |
|
16 |
+ |
super( pComponentHandler, pMD, pComponent ); |
|
17 |
+ |
mRequired = pRMD.isRequired(); |
|
18 |
+ |
mErrorTextForRequired = pRMD.getErrorTextForRequired(); |
|
19 |
+ |
} |
|
20 |
+ |
|
|
21 |
+ |
protected String transformErrorText( String pErrorText, Serializable pSendableCurrentValue, |
|
22 |
+ |
Object pComponentCurrentValue ) { |
|
23 |
+ |
String zErrorText = super.transformErrorText( pErrorText, // |
|
24 |
+ |
pSendableCurrentValue, // |
|
25 |
+ |
pComponentCurrentValue ); |
|
26 |
+ |
return (mRequired && (zErrorText == null) && (pSendableCurrentValue == null)) ? // |
|
27 |
+ |
mErrorTextForRequired : // |
|
28 |
+ |
zErrorText; |
|
29 |
+ |
} |
|
30 |
+ |
} |