|
@@ -1,10 +1,14 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.input; |
2 |
2 |
|
|
3 |
|
- |
import com.google.gwt.user.client.ui.*; |
4 |
|
- |
import com.temp.client.foundation.widget.input.fieldsupport.*; |
5 |
|
- |
import com.temp.shared.*; |
6 |
|
- |
import com.temp.shared.externalization.*; |
7 |
|
- |
import com.temp.shared.utils.*; |
|
3 |
+ |
import com.google.gwt.user.client.ui.HasName; |
|
4 |
+ |
import com.google.gwt.user.client.ui.Widget; |
|
5 |
+ |
import com.temp.client.foundation.widget.NameToID; |
|
6 |
+ |
import com.temp.client.foundation.widget.input.fieldsupport.InputWidgetChangeFilter; |
|
7 |
+ |
import com.temp.client.foundation.widget.input.fieldsupport.InputWidgetValidator; |
|
8 |
+ |
import com.temp.shared.ValueValidator; |
|
9 |
+ |
import com.temp.shared.externalization.E13nResolver; |
|
10 |
+ |
import com.temp.shared.utils.Enableable; |
|
11 |
+ |
import com.temp.shared.utils.Visible; |
8 |
12 |
|
|
9 |
13 |
|
/** |
10 |
14 |
|
* An interface for an Input Field. |
|
@@ -19,7 +23,7 @@ |
19 |
23 |
|
* The transition between the states is one way ('Builder' to 'Run') and is a result of the call to 'init'. |
20 |
24 |
|
* <p/> |
21 |
25 |
|
* An Input Field has the following: |
22 |
|
- |
* |
|
26 |
+ |
* <p/> |
23 |
27 |
|
* <ul> |
24 |
28 |
|
* <li>Name</li> |
25 |
29 |
|
* <li>Base Value **,</li> |
|
@@ -38,7 +42,7 @@ |
38 |
42 |
|
* <li>HelpWidget</li> |
39 |
43 |
|
* </ol> |
40 |
44 |
|
* </ul> |
41 |
|
- |
* |
|
45 |
+ |
* <p/> |
42 |
46 |
|
* ** - These values are "normalized" in both directions (to & from the underlying Input Widget(s)). |
43 |
47 |
|
* This means that a value set and then fetched may be different (however a value fetched, then set, |
44 |
48 |
|
* then fetched should match the original value fetched)! For String based input fields the normalization |
|
@@ -50,19 +54,17 @@ |
50 |
54 |
|
* @param <T> the data type returned by this InputField |
51 |
55 |
|
*/ |
52 |
56 |
|
public interface InputField<T> extends HasName, |
53 |
|
- |
Enableable, |
54 |
|
- |
Visible |
55 |
|
- |
{ |
56 |
|
- |
interface ChangeListener<T2> |
57 |
|
- |
{ |
58 |
|
- |
void changed( InputField<T2> field ); |
|
57 |
+ |
Enableable, |
|
58 |
+ |
Visible { |
|
59 |
+ |
interface ChangeListener<T2> { |
|
60 |
+ |
void changed(InputField<T2> field); |
59 |
61 |
|
} |
60 |
62 |
|
|
61 |
63 |
|
// Only callable in Builder Mode |
62 |
64 |
|
|
63 |
65 |
|
// For HasName - The Name MUST be set before the call to init (transition to run mode) |
64 |
66 |
|
|
65 |
|
- |
InputField<T> name( String name ); |
|
67 |
+ |
InputField<T> name(String name); |
66 |
68 |
|
|
67 |
69 |
|
/** |
68 |
70 |
|
* The 'Builder' to 'Run' state transition method fully constructs/populates the InputField's Widget / container. |
|
@@ -71,23 +73,23 @@ |
71 |
73 |
|
* |
72 |
74 |
|
* @return this for method chaining |
73 |
75 |
|
*/ |
74 |
|
- |
InputField<T> init( E13nResolver resolver ); |
|
76 |
+ |
InputField<T> init(E13nResolver resolver); |
75 |
77 |
|
|
76 |
78 |
|
// Callable anytime |
77 |
79 |
|
|
78 |
80 |
|
boolean isRunMode(); |
79 |
81 |
|
|
80 |
|
- |
InputField<T> add( ChangeListener<T> changeListener ); |
|
82 |
+ |
InputField<T> add(ChangeListener<T> changeListener); |
81 |
83 |
|
|
82 |
|
- |
boolean remove( ChangeListener<T> changeListener ); |
|
84 |
+ |
boolean remove(ChangeListener<T> changeListener); |
83 |
85 |
|
|
84 |
86 |
|
void removeAllChangeListeners(); |
85 |
87 |
|
|
86 |
88 |
|
ValueValidator<T>[] getValidators(); |
87 |
89 |
|
|
88 |
|
- |
InputField<T> add( ValueValidator<T> validator ); |
|
90 |
+ |
InputField<T> add(ValueValidator<T> validator); |
89 |
91 |
|
|
90 |
|
- |
InputField<T> add( ValueValidator<T>... additionalValidators ); |
|
92 |
+ |
InputField<T> add(ValueValidator<T>... additionalValidators); |
91 |
93 |
|
|
92 |
94 |
|
// For Enableable |
93 |
95 |
|
|
|
@@ -118,7 +120,7 @@ |
118 |
120 |
|
* @param value null OK |
119 |
121 |
|
* @return "normalized" round-tripped value (null possible) as if <code>getCurrentValue()</code> was called. |
120 |
122 |
|
*/ |
121 |
|
- |
T setCurrentValue( T value ); |
|
123 |
+ |
T setCurrentValue(T value); |
122 |
124 |
|
|
123 |
125 |
|
/** |
124 |
126 |
|
* Returned the "normalized" Current value. |
|
@@ -185,4 +187,6 @@ |
185 |
187 |
|
Widget getErrorLabel(); |
186 |
188 |
|
|
187 |
189 |
|
Widget getHelpWidget(); |
|
190 |
+ |
|
|
191 |
+ |
NameToID addNamedWidgetsTo(NameToID nameToID); |
188 |
192 |
|
} |