1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.internal.component.Properties;
4 import org.rcfaces.core.component.familly.IContentAccessors;
5 import org.apache.commons.logging.LogFactory;
6 import org.rcfaces.core.component.capability.IForegroundBackgroundColorCapability;
7 import java.lang.String;
8 import javax.el.ValueExpression;
9 import java.util.HashSet;
10 import org.apache.commons.logging.Log;
11 import org.rcfaces.core.component.UIImageItemComponent;
12 import java.util.Set;
13 import java.util.Arrays;
14 import org.rcfaces.core.component.capability.IExpandImageCapability;
15 import org.rcfaces.core.component.capability.ITextCapability;
16
17 public abstract class ExpandableItemComponent extends UIImageItemComponent implements
18 IForegroundBackgroundColorCapability,
19 ITextCapability,
20 IExpandImageCapability {
21
22 private static final Log LOG = LogFactory.getLog(ExpandableItemComponent.class);
23
24 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(UIImageItemComponent.CAMELIA_ATTRIBUTES);
25 static {
26 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"selectedImageURL","disabledImageURL","text","backgroundColor","hoverImageURL","imageURL","expandedImageURL","foregroundColor"}));
27 }
28
29
30 public void setText(String text) {
31
32
33 setItemLabel(text);
34
35 }
36
37 public String getText() {
38
39
40 return getItemLabel();
41
42 }
43
44 public java.lang.String getBackgroundColor() {
45 return getBackgroundColor(null);
46 }
47
48
49
50
51 public java.lang.String getBackgroundColor(javax.faces.context.FacesContext facesContext) {
52 return engine.getStringProperty(Properties.BACKGROUND_COLOR, facesContext);
53 }
54
55
56
57
58
59 public final boolean isBackgroundColorSetted() {
60 return engine.isPropertySetted(Properties.BACKGROUND_COLOR);
61 }
62
63 public void setBackgroundColor(java.lang.String backgroundColor) {
64 engine.setProperty(Properties.BACKGROUND_COLOR, backgroundColor);
65 }
66
67 public java.lang.String getForegroundColor() {
68 return getForegroundColor(null);
69 }
70
71
72
73
74 public java.lang.String getForegroundColor(javax.faces.context.FacesContext facesContext) {
75 return engine.getStringProperty(Properties.FOREGROUND_COLOR, facesContext);
76 }
77
78
79
80
81
82 public final boolean isForegroundColorSetted() {
83 return engine.isPropertySetted(Properties.FOREGROUND_COLOR);
84 }
85
86 public void setForegroundColor(java.lang.String foregroundColor) {
87 engine.setProperty(Properties.FOREGROUND_COLOR, foregroundColor);
88 }
89
90
91
92
93
94 public final boolean isTextSetted() {
95 return engine.isPropertySetted(Properties.TEXT);
96 }
97
98 public java.lang.String getExpandedImageURL() {
99 return getExpandedImageURL(null);
100 }
101
102
103
104
105 public java.lang.String getExpandedImageURL(javax.faces.context.FacesContext facesContext) {
106 return engine.getStringProperty(Properties.EXPANDED_IMAGE_URL, facesContext);
107 }
108
109
110
111
112
113 public final boolean isExpandedImageURLSetted() {
114 return engine.isPropertySetted(Properties.EXPANDED_IMAGE_URL);
115 }
116
117 public void setExpandedImageURL(java.lang.String expandedImageURL) {
118 engine.setProperty(Properties.EXPANDED_IMAGE_URL, expandedImageURL);
119 }
120
121 protected Set getCameliaFields() {
122 return CAMELIA_ATTRIBUTES;
123 }
124
125 public void setValueExpression(String name, ValueExpression binding) {
126 if (Properties.TEXT.equals(name)) {
127 name=Properties.ITEM_LABEL;
128 }
129 super.setValueExpression(name, binding);
130 }
131 }