1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.component.iterator.IMenuIterator;
4 import org.rcfaces.core.internal.component.Properties;
5 import org.rcfaces.core.component.familly.IContentAccessors;
6 import org.rcfaces.core.component.capability.IStatesImageCapability;
7 import java.lang.String;
8 import org.apache.commons.logging.LogFactory;
9 import org.rcfaces.core.component.capability.IAccessKeyCapability;
10 import org.rcfaces.core.internal.tools.MenuTools;
11 import org.rcfaces.core.component.TabbedPaneComponent;
12 import javax.faces.context.FacesContext;
13 import org.rcfaces.core.internal.tools.ImageAccessorTools;
14 import org.rcfaces.core.component.IMenuComponent;
15 import org.rcfaces.core.component.capability.ITextDirectionCapability;
16 import javax.el.ValueExpression;
17 import org.rcfaces.core.component.capability.IDisabledCapability;
18 import java.util.HashSet;
19 import org.apache.commons.logging.Log;
20 import org.rcfaces.core.component.CardComponent;
21 import java.util.Set;
22 import java.util.Arrays;
23 import org.rcfaces.core.internal.capability.IImageAccessorsCapability;
24 import org.rcfaces.core.component.capability.IMenuCapability;
25 import org.rcfaces.core.component.capability.ITextCapability;
26 import org.rcfaces.core.component.capability.IFontCapability;
27
28
29
30
31 public class TabComponent extends CardComponent implements
32 ITextCapability,
33 ITextDirectionCapability,
34 IFontCapability,
35 IDisabledCapability,
36 IStatesImageCapability,
37 IAccessKeyCapability,
38 IMenuCapability,
39 IImageAccessorsCapability {
40
41 private static final Log LOG = LogFactory.getLog(TabComponent.class);
42
43 public static final String COMPONENT_TYPE="org.rcfaces.core.tab";
44
45 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(CardComponent.CAMELIA_ATTRIBUTES);
46 static {
47 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"disabledImageURL","text","fontName","accessKey","hoverImageURL","fontBold","fontSize","textDirection","selectedImageURL","fontItalic","fontUnderline","disabled","imageURL"}));
48 }
49
50 public TabComponent() {
51 setRendererType(COMPONENT_TYPE);
52 }
53
54 public TabComponent(String componentId) {
55 this();
56 setId(componentId);
57 }
58
59 public IContentAccessors getImageAccessors(FacesContext facesContext) {
60
61
62 return ImageAccessorTools.createImageAccessors(facesContext, this, engine);
63
64 }
65
66 public TabbedPaneComponent getTabbedPane() {
67
68
69 return (TabbedPaneComponent)getCardBox();
70
71 }
72
73 public java.lang.String getText() {
74 return getText(null);
75 }
76
77
78
79
80 public java.lang.String getText(javax.faces.context.FacesContext facesContext) {
81 return engine.getStringProperty(Properties.TEXT, facesContext);
82 }
83
84
85
86
87
88 public final boolean isTextSetted() {
89 return engine.isPropertySetted(Properties.TEXT);
90 }
91
92 public void setText(java.lang.String text) {
93 engine.setProperty(Properties.TEXT, text);
94 }
95
96 public int getTextDirection() {
97 return getTextDirection(null);
98 }
99
100
101
102
103 public int getTextDirection(javax.faces.context.FacesContext facesContext) {
104 return engine.getIntProperty(Properties.TEXT_DIRECTION,0, facesContext);
105 }
106
107
108
109
110
111 public final boolean isTextDirectionSetted() {
112 return engine.isPropertySetted(Properties.TEXT_DIRECTION);
113 }
114
115 public void setTextDirection(int textDirection) {
116 engine.setProperty(Properties.TEXT_DIRECTION, textDirection);
117 }
118
119 public java.lang.Boolean getFontBold() {
120 return getFontBold(null);
121 }
122
123
124
125
126 public java.lang.Boolean getFontBold(javax.faces.context.FacesContext facesContext) {
127 return engine.getBooleanProperty(Properties.FONT_BOLD, facesContext);
128 }
129
130
131
132
133
134 public final boolean isFontBoldSetted() {
135 return engine.isPropertySetted(Properties.FONT_BOLD);
136 }
137
138 public void setFontBold(java.lang.Boolean fontBold) {
139 engine.setProperty(Properties.FONT_BOLD, fontBold);
140 }
141
142 public java.lang.Boolean getFontItalic() {
143 return getFontItalic(null);
144 }
145
146
147
148
149 public java.lang.Boolean getFontItalic(javax.faces.context.FacesContext facesContext) {
150 return engine.getBooleanProperty(Properties.FONT_ITALIC, facesContext);
151 }
152
153
154
155
156
157 public final boolean isFontItalicSetted() {
158 return engine.isPropertySetted(Properties.FONT_ITALIC);
159 }
160
161 public void setFontItalic(java.lang.Boolean fontItalic) {
162 engine.setProperty(Properties.FONT_ITALIC, fontItalic);
163 }
164
165 public java.lang.String getFontName() {
166 return getFontName(null);
167 }
168
169
170
171
172 public java.lang.String getFontName(javax.faces.context.FacesContext facesContext) {
173 return engine.getStringProperty(Properties.FONT_NAME, facesContext);
174 }
175
176
177
178
179
180 public final boolean isFontNameSetted() {
181 return engine.isPropertySetted(Properties.FONT_NAME);
182 }
183
184 public void setFontName(java.lang.String fontName) {
185 engine.setProperty(Properties.FONT_NAME, fontName);
186 }
187
188 public java.lang.String getFontSize() {
189 return getFontSize(null);
190 }
191
192
193
194
195 public java.lang.String getFontSize(javax.faces.context.FacesContext facesContext) {
196 return engine.getStringProperty(Properties.FONT_SIZE, facesContext);
197 }
198
199
200
201
202
203 public final boolean isFontSizeSetted() {
204 return engine.isPropertySetted(Properties.FONT_SIZE);
205 }
206
207 public void setFontSize(java.lang.String fontSize) {
208 engine.setProperty(Properties.FONT_SIZE, fontSize);
209 }
210
211 public java.lang.Boolean getFontUnderline() {
212 return getFontUnderline(null);
213 }
214
215
216
217
218 public java.lang.Boolean getFontUnderline(javax.faces.context.FacesContext facesContext) {
219 return engine.getBooleanProperty(Properties.FONT_UNDERLINE, facesContext);
220 }
221
222
223
224
225
226 public final boolean isFontUnderlineSetted() {
227 return engine.isPropertySetted(Properties.FONT_UNDERLINE);
228 }
229
230 public void setFontUnderline(java.lang.Boolean fontUnderline) {
231 engine.setProperty(Properties.FONT_UNDERLINE, fontUnderline);
232 }
233
234 public boolean isDisabled() {
235 return isDisabled(null);
236 }
237
238
239
240
241 public boolean isDisabled(javax.faces.context.FacesContext facesContext) {
242 return engine.getBoolProperty(Properties.DISABLED, false, facesContext);
243 }
244
245
246
247
248
249 public final boolean isDisabledSetted() {
250 return engine.isPropertySetted(Properties.DISABLED);
251 }
252
253 public void setDisabled(boolean disabled) {
254 engine.setProperty(Properties.DISABLED, disabled);
255 }
256
257 public java.lang.String getDisabledImageURL() {
258 return getDisabledImageURL(null);
259 }
260
261
262
263
264 public java.lang.String getDisabledImageURL(javax.faces.context.FacesContext facesContext) {
265 return engine.getStringProperty(Properties.DISABLED_IMAGE_URL, facesContext);
266 }
267
268
269
270
271
272 public final boolean isDisabledImageURLSetted() {
273 return engine.isPropertySetted(Properties.DISABLED_IMAGE_URL);
274 }
275
276 public void setDisabledImageURL(java.lang.String disabledImageURL) {
277 engine.setProperty(Properties.DISABLED_IMAGE_URL, disabledImageURL);
278 }
279
280 public java.lang.String getHoverImageURL() {
281 return getHoverImageURL(null);
282 }
283
284
285
286
287 public java.lang.String getHoverImageURL(javax.faces.context.FacesContext facesContext) {
288 return engine.getStringProperty(Properties.HOVER_IMAGE_URL, facesContext);
289 }
290
291
292
293
294
295 public final boolean isHoverImageURLSetted() {
296 return engine.isPropertySetted(Properties.HOVER_IMAGE_URL);
297 }
298
299 public void setHoverImageURL(java.lang.String hoverImageURL) {
300 engine.setProperty(Properties.HOVER_IMAGE_URL, hoverImageURL);
301 }
302
303 public java.lang.String getSelectedImageURL() {
304 return getSelectedImageURL(null);
305 }
306
307
308
309
310 public java.lang.String getSelectedImageURL(javax.faces.context.FacesContext facesContext) {
311 return engine.getStringProperty(Properties.SELECTED_IMAGE_URL, facesContext);
312 }
313
314
315
316
317
318 public final boolean isSelectedImageURLSetted() {
319 return engine.isPropertySetted(Properties.SELECTED_IMAGE_URL);
320 }
321
322 public void setSelectedImageURL(java.lang.String selectedImageURL) {
323 engine.setProperty(Properties.SELECTED_IMAGE_URL, selectedImageURL);
324 }
325
326 public java.lang.String getImageURL() {
327 return getImageURL(null);
328 }
329
330
331
332
333 public java.lang.String getImageURL(javax.faces.context.FacesContext facesContext) {
334 return engine.getStringProperty(Properties.IMAGE_URL, facesContext);
335 }
336
337
338
339
340
341 public final boolean isImageURLSetted() {
342 return engine.isPropertySetted(Properties.IMAGE_URL);
343 }
344
345 public void setImageURL(java.lang.String imageURL) {
346 engine.setProperty(Properties.IMAGE_URL, imageURL);
347 }
348
349 public IContentAccessors getImageAccessors() {
350
351
352 return getImageAccessors(null);
353
354 }
355
356 public java.lang.String getAccessKey() {
357 return getAccessKey(null);
358 }
359
360
361
362
363 public java.lang.String getAccessKey(javax.faces.context.FacesContext facesContext) {
364 return engine.getStringProperty(Properties.ACCESS_KEY, facesContext);
365 }
366
367
368
369
370
371 public final boolean isAccessKeySetted() {
372 return engine.isPropertySetted(Properties.ACCESS_KEY);
373 }
374
375 public void setAccessKey(java.lang.String accessKey) {
376 engine.setProperty(Properties.ACCESS_KEY, accessKey);
377 }
378
379 public IMenuComponent getMenu() {
380
381
382 return MenuTools.getMenu(this);
383
384 }
385
386 public IMenuComponent getMenu(String menuId) {
387
388
389 return MenuTools.getMenu(this, menuId);
390
391 }
392
393 public IMenuIterator listMenus() {
394
395
396 return MenuTools.listMenus(this);
397
398 }
399
400 protected Set getCameliaFields() {
401 return CAMELIA_ATTRIBUTES;
402 }
403 }