|
@@ -1,14 +1,10 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.input; |
2 |
2 |
|
|
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; |
|
3 |
+ |
import com.google.gwt.user.client.ui.*; |
|
4 |
+ |
import com.temp.client.foundation.widget.input.fieldsupport.*; |
|
5 |
+ |
import com.temp.client.foundation.widget.input.support.*; |
|
6 |
+ |
import com.temp.shared.*; |
|
7 |
+ |
import com.temp.shared.utils.*; |
12 |
8 |
|
|
13 |
9 |
|
/** |
14 |
10 |
|
* An interface for an Input Field. |
|
@@ -53,31 +49,18 @@ |
53 |
49 |
|
* |
54 |
50 |
|
* @param <T> the data type returned by this InputField |
55 |
51 |
|
*/ |
56 |
|
- |
public interface InputField<T> extends HasName, |
57 |
|
- |
Enableable, |
58 |
|
- |
Visible { |
|
52 |
+ |
public interface InputField<T> extends FormEngineMember, HasName, Visible { |
59 |
53 |
|
interface ChangeListener<T2> { |
60 |
54 |
|
void changed(InputField<T2> field); |
61 |
55 |
|
} |
62 |
56 |
|
|
63 |
|
- |
// Only callable in Builder Mode |
|
57 |
+ |
// Only callable in Builder Mode: |
64 |
58 |
|
|
65 |
59 |
|
// For HasName - The Name MUST be set before the call to init (transition to run mode) |
66 |
60 |
|
|
67 |
61 |
|
InputField<T> name(String name); |
68 |
62 |
|
|
69 |
|
- |
/** |
70 |
|
- |
* The 'Builder' to 'Run' state transition method fully constructs/populates the InputField's Widget / container. |
71 |
|
- |
* <p/> |
72 |
|
- |
* Only callable ONCE and only in Builder Mode! |
73 |
|
- |
* |
74 |
|
- |
* @return this for method chaining |
75 |
|
- |
*/ |
76 |
|
- |
InputField<T> init(E13nResolver resolver); |
77 |
|
- |
|
78 |
|
- |
// Callable anytime |
79 |
|
- |
|
80 |
|
- |
boolean isRunMode(); |
|
63 |
+ |
// Callable anytime: |
81 |
64 |
|
|
82 |
65 |
|
InputField<T> add(ChangeListener<T> changeListener); |
83 |
66 |
|
|
|
@@ -105,12 +88,7 @@ |
105 |
88 |
|
|
106 |
89 |
|
InputField<T> invisible(); |
107 |
90 |
|
|
108 |
|
- |
// Only callable in Run Mode |
109 |
|
- |
|
110 |
|
- |
/** |
111 |
|
- |
* Reset the value as if <code>setCurrentValue( null )</code> has been called. |
112 |
|
- |
*/ |
113 |
|
- |
void reset(); |
|
91 |
+ |
// Only callable in Run Mode: |
114 |
92 |
|
|
115 |
93 |
|
/** |
116 |
94 |
|
* set the Current value and the "Base" value (the "Base" value is what "change" is determined from). |
|
@@ -136,42 +114,6 @@ |
136 |
114 |
|
*/ |
137 |
115 |
|
T getBaseValue(); |
138 |
116 |
|
|
139 |
|
- |
/** |
140 |
|
- |
* revert to the "Base" value |
141 |
|
- |
*/ |
142 |
|
- |
void revert(); |
143 |
|
- |
|
144 |
|
- |
/** |
145 |
|
- |
* Return if the Current Value is different than the Base Value |
146 |
|
- |
*/ |
147 |
|
- |
boolean isChanged(); |
148 |
|
- |
|
149 |
|
- |
/** |
150 |
|
- |
* Return if the Field has Focus (or null indicating that the Focus state is not tracked) |
151 |
|
- |
*/ |
152 |
|
- |
Boolean isFocused(); |
153 |
|
- |
|
154 |
|
- |
/** |
155 |
|
- |
* Return if the Current Value is rejected by any of the ValueValidator(s) |
156 |
|
- |
*/ |
157 |
|
- |
boolean isErrored(); |
158 |
|
- |
|
159 |
|
- |
/** |
160 |
|
- |
* Validate the Current Value, and "manage" the Error Label appropriately. |
161 |
|
- |
* <p/> |
162 |
|
- |
* Error Labels are set to a NBSP & Cloaked when the field is not in Error, and Visible w/ the appropriate E13n data when the field is in Error. |
163 |
|
- |
* |
164 |
|
- |
* @return true if <code>isErrored() == false</code>. |
165 |
|
- |
*/ |
166 |
|
- |
boolean validate(); |
167 |
|
- |
|
168 |
|
- |
/** |
169 |
|
- |
* Pull the Focus to this Field (return false if the field is "thought" to be currently un-focusable, e.g. Not Visible, Disabled, or has no Focusable components) |
170 |
|
- |
*/ |
171 |
|
- |
boolean setFocused(); |
172 |
|
- |
|
173 |
|
- |
E13nResolver getE13nResolver(); |
174 |
|
- |
|
175 |
117 |
|
Widget getInputWidget(); |
176 |
118 |
|
|
177 |
119 |
|
InputWidgetChangeFilter<T> getInput(); |
|
@@ -187,6 +129,4 @@ |
187 |
129 |
|
Widget getErrorLabel(); |
188 |
130 |
|
|
189 |
131 |
|
Widget getHelpWidget(); |
190 |
|
- |
|
191 |
|
- |
NameToID addNamedWidgetsTo(NameToID nameToID); |
192 |
132 |
|
} |