litesoft
Diff Revisions
627
vs
628
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/input/fieldsupport/InputFieldAccessor.java
|
@@ -1,8 +1,9 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.input.fieldsupport; |
2 |
2 |
|
|
3 |
3 |
|
import com.google.gwt.user.client.ui.*; |
|
4 |
+ |
import com.temp.shared.utils.*; |
4 |
5 |
|
|
5 |
|
- |
public class InputFieldAccessor<T> |
|
6 |
+ |
public class InputFieldAccessor<T> implements Enableable |
6 |
7 |
|
{ |
7 |
8 |
|
private final Widget inputWidget; |
8 |
9 |
|
private final InputWidgetValidator<T> validator; |
|
@@ -15,6 +16,18 @@ |
15 |
16 |
|
this.inputWidget = inputWidget; |
16 |
17 |
|
} |
17 |
18 |
|
|
|
19 |
+ |
@Override |
|
20 |
+ |
public boolean isEnabled() |
|
21 |
+ |
{ |
|
22 |
+ |
return getEnableable().isEnabled(); |
|
23 |
+ |
} |
|
24 |
+ |
|
|
25 |
+ |
@Override |
|
26 |
+ |
public void setEnabled( boolean enabled ) |
|
27 |
+ |
{ |
|
28 |
+ |
getEnableable().setEnabled( enabled ); |
|
29 |
+ |
} |
|
30 |
+ |
|
18 |
31 |
|
public Widget getInputWidget() |
19 |
32 |
|
{ |
20 |
33 |
|
return inputWidget; |
|
@@ -34,4 +47,9 @@ |
34 |
47 |
|
{ |
35 |
48 |
|
return input; |
36 |
49 |
|
} |
|
50 |
+ |
|
|
51 |
+ |
private Enableable getEnableable() |
|
52 |
+ |
{ |
|
53 |
+ |
return (inputWidget instanceof Enableable) ? (Enableable)inputWidget : Enableable.ALWAYS_ENABLED; |
|
54 |
+ |
} |
37 |
55 |
|
} |