1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.component.capability.ISelectionEventCapability;
4 import org.rcfaces.core.internal.component.Properties;
5 import java.lang.String;
6 import org.apache.commons.logging.LogFactory;
7 import org.rcfaces.core.component.capability.IRequiredCapability;
8 import org.rcfaces.core.component.capability.IFocusStyleClassCapability;
9 import org.rcfaces.core.internal.converter.FilterPropertiesConverter;
10 import javax.el.ValueExpression;
11 import java.util.HashSet;
12 import org.apache.commons.logging.Log;
13 import org.rcfaces.core.component.capability.IFilterCapability;
14 import org.rcfaces.core.model.IFilterProperties;
15 import java.util.Set;
16 import java.util.Arrays;
17 import org.rcfaces.core.component.AbstractInputComponent;
18 import org.rcfaces.core.component.capability.ISeverityStyleClassCapability;
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 public class ComboComponent extends AbstractInputComponent implements
52 ISelectionEventCapability,
53 IRequiredCapability,
54 IFocusStyleClassCapability,
55 ISeverityStyleClassCapability,
56 IFilterCapability {
57
58 private static final Log LOG = LogFactory.getLog(ComboComponent.class);
59
60 public static final String COMPONENT_TYPE="org.rcfaces.core.combo";
61
62 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractInputComponent.CAMELIA_ATTRIBUTES);
63 static {
64 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"focusStyleClass","selectionListener","filterProperties","fatalStyleClass","warnStyleClass","errorStyleClass","infoStyleClass","styleClass","required"}));
65 }
66 protected static final String CAMELIA_VALUE_ALIAS="value";
67
68 public ComboComponent() {
69 setRendererType(COMPONENT_TYPE);
70 }
71
72 public ComboComponent(String componentId) {
73 this();
74 setId(componentId);
75 }
76
77 public void setFilterProperties(String properties) {
78
79
80 IFilterProperties filterProperties=(IFilterProperties)FilterPropertiesConverter.SINGLETON.getAsObject(null, this, properties);
81
82 setFilterProperties(filterProperties);
83
84 }
85
86 public final void addSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
87 addFacesListener(listener);
88 }
89
90 public final void removeSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
91 removeFacesListener(listener);
92 }
93
94 public final javax.faces.event.FacesListener [] listSelectionListeners() {
95 return getFacesListeners(org.rcfaces.core.event.ISelectionListener.class);
96 }
97
98 public java.lang.String getFocusStyleClass() {
99 return getFocusStyleClass(null);
100 }
101
102
103
104
105 public java.lang.String getFocusStyleClass(javax.faces.context.FacesContext facesContext) {
106 return engine.getStringProperty(Properties.FOCUS_STYLE_CLASS, facesContext);
107 }
108
109
110
111
112
113 public final boolean isFocusStyleClassSetted() {
114 return engine.isPropertySetted(Properties.FOCUS_STYLE_CLASS);
115 }
116
117 public void setFocusStyleClass(java.lang.String focusStyleClass) {
118 engine.setProperty(Properties.FOCUS_STYLE_CLASS, focusStyleClass);
119 }
120
121 public java.lang.String getErrorStyleClass() {
122 return getErrorStyleClass(null);
123 }
124
125
126
127
128 public java.lang.String getErrorStyleClass(javax.faces.context.FacesContext facesContext) {
129 return engine.getStringProperty(Properties.ERROR_STYLE_CLASS, facesContext);
130 }
131
132
133
134
135
136 public final boolean isErrorStyleClassSetted() {
137 return engine.isPropertySetted(Properties.ERROR_STYLE_CLASS);
138 }
139
140 public void setErrorStyleClass(java.lang.String errorStyleClass) {
141 engine.setProperty(Properties.ERROR_STYLE_CLASS, errorStyleClass);
142 }
143
144 public java.lang.String getFatalStyleClass() {
145 return getFatalStyleClass(null);
146 }
147
148
149
150
151 public java.lang.String getFatalStyleClass(javax.faces.context.FacesContext facesContext) {
152 return engine.getStringProperty(Properties.FATAL_STYLE_CLASS, facesContext);
153 }
154
155
156
157
158
159 public final boolean isFatalStyleClassSetted() {
160 return engine.isPropertySetted(Properties.FATAL_STYLE_CLASS);
161 }
162
163 public void setFatalStyleClass(java.lang.String fatalStyleClass) {
164 engine.setProperty(Properties.FATAL_STYLE_CLASS, fatalStyleClass);
165 }
166
167 public java.lang.String getInfoStyleClass() {
168 return getInfoStyleClass(null);
169 }
170
171
172
173
174 public java.lang.String getInfoStyleClass(javax.faces.context.FacesContext facesContext) {
175 return engine.getStringProperty(Properties.INFO_STYLE_CLASS, facesContext);
176 }
177
178
179
180
181
182 public final boolean isInfoStyleClassSetted() {
183 return engine.isPropertySetted(Properties.INFO_STYLE_CLASS);
184 }
185
186 public void setInfoStyleClass(java.lang.String infoStyleClass) {
187 engine.setProperty(Properties.INFO_STYLE_CLASS, infoStyleClass);
188 }
189
190 public java.lang.String getWarnStyleClass() {
191 return getWarnStyleClass(null);
192 }
193
194
195
196
197 public java.lang.String getWarnStyleClass(javax.faces.context.FacesContext facesContext) {
198 return engine.getStringProperty(Properties.WARN_STYLE_CLASS, facesContext);
199 }
200
201
202
203
204
205 public final boolean isWarnStyleClassSetted() {
206 return engine.isPropertySetted(Properties.WARN_STYLE_CLASS);
207 }
208
209 public void setWarnStyleClass(java.lang.String warnStyleClass) {
210 engine.setProperty(Properties.WARN_STYLE_CLASS, warnStyleClass);
211 }
212
213 public org.rcfaces.core.model.IFilterProperties getFilterProperties() {
214 return getFilterProperties(null);
215 }
216
217
218
219
220 public org.rcfaces.core.model.IFilterProperties getFilterProperties(javax.faces.context.FacesContext facesContext) {
221 return (org.rcfaces.core.model.IFilterProperties)engine.getProperty(Properties.FILTER_PROPERTIES, facesContext);
222 }
223
224
225
226
227
228 public final boolean isFilterPropertiesSetted() {
229 return engine.isPropertySetted(Properties.FILTER_PROPERTIES);
230 }
231
232 public void setFilterProperties(org.rcfaces.core.model.IFilterProperties filterProperties) {
233 engine.setProperty(Properties.FILTER_PROPERTIES, filterProperties);
234 }
235
236 protected Set getCameliaFields() {
237 return CAMELIA_ATTRIBUTES;
238 }
239
240 protected String getCameliaValueAlias() {
241 return CAMELIA_VALUE_ALIAS;
242 }
243 }