litesoft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
package com.temp.client.foundation.widget.input;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
import com.temp.client.foundation.widget.NameToID;
import com.temp.client.foundation.widget.input.fieldsupport.AbstractInputField;
import com.temp.client.foundation.widget.input.fieldsupport.InputWidgetChangeFilter;
import com.temp.client.foundation.widget.input.fieldsupport.InputWidgetValidator;
import com.temp.shared.externalization.E13nData;
import com.temp.shared.externalization.E13nResolver;
import com.temp.shared.externalization.OptionallyPrefixingE13nResolver;
import com.temp.shared.utils.Enableable;
import java.util.ArrayList;
import java.util.List;
/**
* This is not a "real" Widget backed InputField, but a Proxy to a number of RadioButtonInputFields
*/
public class RadioButtonGroupInputField<T> extends AbstractInputField<T, RadioButtonGroupInputField<T>> {
private final Panel container;
private final String groupName;
private final List<RadioButtonInputField> radioButtons = new ArrayList<RadioButtonInputField>();
private E13nResolver resolver = null;
public RadioButtonGroupInputField(Panel container, //
RadioButtonInputField radioButton1, //
RadioButtonInputField radioButton2, //
RadioButtonInputField... additionalRadioButtons) {
this.container = container;
groupName = radioButton1.getGroup();
ChangeListener<Boolean> listener = new ChangeListener<Boolean>() {
@Override
public void changed(InputField<Boolean> radioButton) {
System.out.println("RadioButtonGroupInputField.changed: " + radioButton.getName());
}
};
add(radioButton1, listener);
add(radioButton2, listener);
if (additionalRadioButtons != null) {
for (RadioButtonInputField radioButton : additionalRadioButtons) {
add(radioButton, listener);
}
}
}
private void add(RadioButtonInputField radioButton, ChangeListener<Boolean> listener) {
//To change body of created methods use File | Settings | File Templates.
}
@Override
public String getName() {
return groupName;
}
@Override
public void setName(String name) {
throw new IllegalStateException("Name Not Settable, Determined automatically");
}
@Override
public void init(E13nResolver parentResolver) {
resolver = new OptionallyPrefixingE13nResolver(groupName, parentResolver);
for (RadioButtonInputField radioButton : radioButtons) {
radioButton.init(resolver);
}
}
@Override
public boolean isRunMode() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void reset() {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void revert() {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public boolean isChanged() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public Boolean isFocused() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public boolean isErrored() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public boolean validate() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public boolean setFocused() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public E13nResolver getE13nResolver() {
assertBuildMode("E13nResolver");
return resolver;
}
@Override
public NameToID addNamedWidgetsTo(NameToID nameToID) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
protected Enableable getEnableable() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
protected Panel getContainer() {
return container;
}
@Override
protected void updateErrorLabel(Widget errorLabel, E13nData error) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public T setCurrentValue(T value) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public T getCurrentValue() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public T getBaseValue() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public InputWidgetChangeFilter<T> getInput() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public InputWidgetValidator<T> getValidator() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public Widget getErrorLabel() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public Widget getHelpWidget() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
}
|
Revision |
Author |
Commited |
Message |
633
|
GeorgeS
|
Thu 19 Apr, 2012 02:30:46 +0000 |
|