|
@@ -1,59 +1,59 @@ |
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.ui.def.nonpublic.support.*; |
5 |
|
- |
|
6 |
|
- |
import com.google.gwt.user.client.ui.*; |
7 |
|
- |
|
8 |
|
- |
public abstract class AbstractFormActionAdapter extends AbstractFormComponentAdapter |
9 |
|
- |
implements FormActionAdapter { |
10 |
|
- |
private String mActionID; |
11 |
|
- |
private Boolean mInputChangeStateEnablement; |
12 |
|
- |
private Boolean mInputErrorStateEnablement; |
13 |
|
- |
|
14 |
|
- |
protected AbstractFormActionAdapter( FormInstanceComponentHandler pComponentHandler, String pActionID, |
15 |
|
- |
Boolean pInputChangeStateEnablement, Boolean pInputErrorStateEnablement ) { |
16 |
|
- |
super( pComponentHandler ); |
17 |
|
- |
mActionID = pActionID; |
18 |
|
- |
mInputChangeStateEnablement = pInputChangeStateEnablement; |
19 |
|
- |
mInputErrorStateEnablement = pInputErrorStateEnablement; |
20 |
|
- |
} |
21 |
|
- |
|
22 |
|
- |
protected AbstractFormActionAdapter( FormInstanceComponentHandler pComponentHandler, String pActionID, |
23 |
|
- |
UiActionable pDef ) { |
24 |
|
- |
this( pComponentHandler, pActionID, pDef.getInputChangeStateEnablement(), pDef.getInputErrorStateEnablement() ); |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
public final Widget init() { |
28 |
|
- |
mComponentFormHandler.addActionAdapter( this ); |
29 |
|
- |
if ( Boolean.TRUE.equals( mInputChangeStateEnablement ) || |
30 |
|
- |
Boolean.TRUE.equals( mInputErrorStateEnablement ) ) { |
31 |
|
- |
setEnabled( false ); |
32 |
|
- |
} |
33 |
|
- |
return initWidget(); |
34 |
|
- |
} |
35 |
|
- |
|
36 |
|
- |
abstract protected Widget initWidget(); |
37 |
|
- |
|
38 |
|
- |
public String getActionID() { |
39 |
|
- |
return mActionID; |
40 |
|
- |
} |
41 |
|
- |
|
42 |
|
- |
public Boolean getInputChangeStateEnablement() { |
43 |
|
- |
return mInputChangeStateEnablement; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
public Boolean getInputErrorStateEnablement() { |
47 |
|
- |
return mInputErrorStateEnablement; |
48 |
|
- |
} |
49 |
|
- |
|
50 |
|
- |
// The following is public for testing |
51 |
|
- |
|
52 |
|
- |
public void actionRequested( boolean pInputAction ) { |
53 |
|
- |
mComponentFormHandler.actionRequested( this, pInputAction ); |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
public String toString() { |
57 |
|
- |
return "FormActionAdapter(" + getActionID() + ")"; |
58 |
|
- |
} |
59 |
|
- |
} |
|
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.ui.def.nonpublic.support.*; |
|
5 |
+ |
|
|
6 |
+ |
import com.google.gwt.user.client.ui.*; |
|
7 |
+ |
|
|
8 |
+ |
public abstract class AbstractFormActionAdapter extends AbstractFormComponentAdapter |
|
9 |
+ |
implements FormActionAdapter { |
|
10 |
+ |
private String mActionID; |
|
11 |
+ |
private Boolean mInputChangeStateEnablement; |
|
12 |
+ |
private Boolean mInputErrorStateEnablement; |
|
13 |
+ |
|
|
14 |
+ |
protected AbstractFormActionAdapter( FormInstanceComponentHandler pComponentHandler, String pActionID, |
|
15 |
+ |
Boolean pInputChangeStateEnablement, Boolean pInputErrorStateEnablement ) { |
|
16 |
+ |
super( pComponentHandler ); |
|
17 |
+ |
mActionID = pActionID; |
|
18 |
+ |
mInputChangeStateEnablement = pInputChangeStateEnablement; |
|
19 |
+ |
mInputErrorStateEnablement = pInputErrorStateEnablement; |
|
20 |
+ |
} |
|
21 |
+ |
|
|
22 |
+ |
protected AbstractFormActionAdapter( FormInstanceComponentHandler pComponentHandler, String pActionID, |
|
23 |
+ |
UiActionable pDef ) { |
|
24 |
+ |
this( pComponentHandler, pActionID, pDef.getInputChangeStateEnablement(), pDef.getInputErrorStateEnablement() ); |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
public final Widget init() { |
|
28 |
+ |
mComponentFormHandler.addActionAdapter( this ); |
|
29 |
+ |
if ( Boolean.TRUE.equals( mInputChangeStateEnablement ) || |
|
30 |
+ |
Boolean.TRUE.equals( mInputErrorStateEnablement ) ) { |
|
31 |
+ |
setEnabled( false ); |
|
32 |
+ |
} |
|
33 |
+ |
return initWidget(); |
|
34 |
+ |
} |
|
35 |
+ |
|
|
36 |
+ |
abstract protected Widget initWidget(); |
|
37 |
+ |
|
|
38 |
+ |
public String getActionID() { |
|
39 |
+ |
return mActionID; |
|
40 |
+ |
} |
|
41 |
+ |
|
|
42 |
+ |
public Boolean getInputChangeStateEnablement() { |
|
43 |
+ |
return mInputChangeStateEnablement; |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
public Boolean getInputErrorStateEnablement() { |
|
47 |
+ |
return mInputErrorStateEnablement; |
|
48 |
+ |
} |
|
49 |
+ |
|
|
50 |
+ |
// The following is public for testing |
|
51 |
+ |
|
|
52 |
+ |
public void actionRequested( boolean pInputAction ) { |
|
53 |
+ |
mComponentFormHandler.actionRequested( this, pInputAction ); |
|
54 |
+ |
} |
|
55 |
+ |
|
|
56 |
+ |
public String toString() { |
|
57 |
+ |
return "FormActionAdapter(" + getActionID() + ")"; |
|
58 |
+ |
} |
|
59 |
+ |
} |