1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.component.iterator.IMenuIterator;
4 import org.rcfaces.core.component.capability.IScrollableCapability;
5 import org.rcfaces.core.internal.component.Properties;
6 import org.apache.commons.logging.LogFactory;
7 import java.lang.String;
8 import org.rcfaces.core.internal.tools.MenuTools;
9 import org.rcfaces.core.component.capability.IBorderCapability;
10 import org.rcfaces.core.component.AbstractDataComponent;
11 import org.rcfaces.core.component.capability.IShowValueCapability;
12 import org.rcfaces.core.component.capability.IBorderTypeCapability;
13 import org.rcfaces.core.component.IMenuComponent;
14 import javax.el.ValueExpression;
15 import java.util.HashSet;
16 import org.apache.commons.logging.Log;
17 import java.util.Set;
18 import java.util.Arrays;
19 import org.rcfaces.core.component.capability.IMenuCapability;
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 public class ComponentsListComponent extends AbstractDataComponent implements
57 IMenuCapability,
58 IBorderCapability,
59 IBorderTypeCapability,
60 IScrollableCapability,
61 IShowValueCapability {
62
63 private static final Log LOG = LogFactory.getLog(ComponentsListComponent.class);
64
65 public static final String COMPONENT_TYPE="org.rcfaces.core.componentsList";
66
67 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractDataComponent.CAMELIA_ATTRIBUTES);
68 static {
69 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"showValue","columnStyleClass","verticalScrollPosition","borderType","horizontalScrollPosition","rowStyleClass","rowCountVar","border","rowIndexVar","columnNumber"}));
70 }
71
72 public ComponentsListComponent() {
73 setRendererType(COMPONENT_TYPE);
74 }
75
76 public ComponentsListComponent(String componentId) {
77 this();
78 setId(componentId);
79 }
80
81 public IMenuComponent getMenu() {
82
83
84 return MenuTools.getMenu(this);
85
86 }
87
88 public IMenuComponent getMenu(String menuId) {
89
90
91 return MenuTools.getMenu(this, menuId);
92
93 }
94
95 public IMenuIterator listMenus() {
96
97
98 return MenuTools.listMenus(this);
99
100 }
101
102 public boolean isBorder() {
103 return isBorder(null);
104 }
105
106
107
108
109 public boolean isBorder(javax.faces.context.FacesContext facesContext) {
110 return engine.getBoolProperty(Properties.BORDER, true, facesContext);
111 }
112
113
114
115
116
117 public final boolean isBorderSetted() {
118 return engine.isPropertySetted(Properties.BORDER);
119 }
120
121 public void setBorder(boolean border) {
122 engine.setProperty(Properties.BORDER, border);
123 }
124
125 public java.lang.String getBorderType() {
126 return getBorderType(null);
127 }
128
129
130
131
132 public java.lang.String getBorderType(javax.faces.context.FacesContext facesContext) {
133 return engine.getStringProperty(Properties.BORDER_TYPE, facesContext);
134 }
135
136
137
138
139
140 public final boolean isBorderTypeSetted() {
141 return engine.isPropertySetted(Properties.BORDER_TYPE);
142 }
143
144 public void setBorderType(java.lang.String borderType) {
145 engine.setProperty(Properties.BORDER_TYPE, borderType);
146 }
147
148 public int getHorizontalScrollPosition() {
149 return getHorizontalScrollPosition(null);
150 }
151
152
153
154
155 public int getHorizontalScrollPosition(javax.faces.context.FacesContext facesContext) {
156 return engine.getIntProperty(Properties.HORIZONTAL_SCROLL_POSITION,0, facesContext);
157 }
158
159
160
161
162
163 public final boolean isHorizontalScrollPositionSetted() {
164 return engine.isPropertySetted(Properties.HORIZONTAL_SCROLL_POSITION);
165 }
166
167 public void setHorizontalScrollPosition(int horizontalScrollPosition) {
168 engine.setProperty(Properties.HORIZONTAL_SCROLL_POSITION, horizontalScrollPosition);
169 }
170
171 public int getVerticalScrollPosition() {
172 return getVerticalScrollPosition(null);
173 }
174
175
176
177
178 public int getVerticalScrollPosition(javax.faces.context.FacesContext facesContext) {
179 return engine.getIntProperty(Properties.VERTICAL_SCROLL_POSITION,0, facesContext);
180 }
181
182
183
184
185
186 public final boolean isVerticalScrollPositionSetted() {
187 return engine.isPropertySetted(Properties.VERTICAL_SCROLL_POSITION);
188 }
189
190 public void setVerticalScrollPosition(int verticalScrollPosition) {
191 engine.setProperty(Properties.VERTICAL_SCROLL_POSITION, verticalScrollPosition);
192 }
193
194 public java.lang.Object getShowValue() {
195 return getShowValue(null);
196 }
197
198
199
200
201 public java.lang.Object getShowValue(javax.faces.context.FacesContext facesContext) {
202 return engine.getProperty(Properties.SHOW_VALUE, facesContext);
203 }
204
205
206
207
208
209 public final boolean isShowValueSetted() {
210 return engine.isPropertySetted(Properties.SHOW_VALUE);
211 }
212
213 public void setShowValue(java.lang.Object showValue) {
214 engine.setProperty(Properties.SHOW_VALUE, showValue);
215 }
216
217
218
219
220
221 public String getRowCountVar() {
222 return getRowCountVar(null);
223 }
224
225
226
227
228
229 public String getRowCountVar(javax.faces.context.FacesContext facesContext) {
230 return engine.getStringProperty(Properties.ROW_COUNT_VAR, facesContext);
231 }
232
233
234
235
236
237 public void setRowCountVar(String rowCountVar) {
238 engine.setProperty(Properties.ROW_COUNT_VAR, rowCountVar);
239 }
240
241
242
243
244
245
246
247
248
249 public boolean isRowCountVarSetted() {
250 return engine.isPropertySetted(Properties.ROW_COUNT_VAR);
251 }
252
253
254
255
256
257 public String getRowIndexVar() {
258 return getRowIndexVar(null);
259 }
260
261
262
263
264
265 public String getRowIndexVar(javax.faces.context.FacesContext facesContext) {
266 return engine.getStringProperty(Properties.ROW_INDEX_VAR, facesContext);
267 }
268
269
270
271
272
273 public void setRowIndexVar(String rowIndexVar) {
274 engine.setProperty(Properties.ROW_INDEX_VAR, rowIndexVar);
275 }
276
277
278
279
280
281
282
283
284
285 public boolean isRowIndexVarSetted() {
286 return engine.isPropertySetted(Properties.ROW_INDEX_VAR);
287 }
288
289
290
291
292
293 public int getColumnNumber() {
294 return getColumnNumber(null);
295 }
296
297
298
299
300
301 public int getColumnNumber(javax.faces.context.FacesContext facesContext) {
302 return engine.getIntProperty(Properties.COLUMN_NUMBER, 0, facesContext);
303 }
304
305
306
307
308
309 public void setColumnNumber(int columnNumber) {
310 engine.setProperty(Properties.COLUMN_NUMBER, columnNumber);
311 }
312
313
314
315
316
317
318
319
320
321 public boolean isColumnNumberSetted() {
322 return engine.isPropertySetted(Properties.COLUMN_NUMBER);
323 }
324
325
326
327
328
329 public String getRowStyleClass() {
330 return getRowStyleClass(null);
331 }
332
333
334
335
336
337 public String getRowStyleClass(javax.faces.context.FacesContext facesContext) {
338 return engine.getStringProperty(Properties.ROW_STYLE_CLASS, facesContext);
339 }
340
341
342
343
344
345 public void setRowStyleClass(String rowStyleClass) {
346 engine.setProperty(Properties.ROW_STYLE_CLASS, rowStyleClass);
347 }
348
349
350
351
352
353
354
355
356
357 public boolean isRowStyleClassSetted() {
358 return engine.isPropertySetted(Properties.ROW_STYLE_CLASS);
359 }
360
361
362
363
364
365 public String getColumnStyleClass() {
366 return getColumnStyleClass(null);
367 }
368
369
370
371
372
373 public String getColumnStyleClass(javax.faces.context.FacesContext facesContext) {
374 return engine.getStringProperty(Properties.COLUMN_STYLE_CLASS, facesContext);
375 }
376
377
378
379
380
381 public void setColumnStyleClass(String columnStyleClass) {
382 engine.setProperty(Properties.COLUMN_STYLE_CLASS, columnStyleClass);
383 }
384
385
386
387
388
389
390
391
392
393 public boolean isColumnStyleClassSetted() {
394 return engine.isPropertySetted(Properties.COLUMN_STYLE_CLASS);
395 }
396
397 protected Set getCameliaFields() {
398 return CAMELIA_ATTRIBUTES;
399 }
400 }