1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.internal.component.Properties;
4 import org.rcfaces.core.component.capability.IClosableCapability;
5 import org.apache.commons.logging.LogFactory;
6 import org.rcfaces.core.component.capability.ICloseEventCapability;
7 import org.rcfaces.core.internal.tools.TabbedPaneTools;
8 import org.rcfaces.core.component.capability.IPreSelectionEventCapability;
9 import org.rcfaces.core.component.capability.IShowValueCapability;
10 import javax.faces.context.FacesContext;
11 import org.rcfaces.core.component.TabComponent;
12 import javax.el.ValueExpression;
13 import java.util.HashSet;
14 import org.apache.commons.logging.Log;
15 import org.rcfaces.core.component.iterator.ITabIterator;
16 import org.rcfaces.core.component.CardBoxComponent;
17 import java.util.Set;
18 import java.util.Arrays;
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 public class TabbedPaneComponent extends CardBoxComponent implements
63 ICloseEventCapability,
64 IClosableCapability,
65 IPreSelectionEventCapability,
66 IShowValueCapability {
67
68 private static final Log LOG = LogFactory.getLog(TabbedPaneComponent.class);
69
70 public static final String COMPONENT_TYPE="org.rcfaces.core.tabbedPane";
71
72 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(CardBoxComponent.CAMELIA_ATTRIBUTES);
73 static {
74 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"closeListener","showValue","closable","preSelectionListener"}));
75 }
76
77 public TabbedPaneComponent() {
78 setRendererType(COMPONENT_TYPE);
79 }
80
81 public TabbedPaneComponent(String componentId) {
82 this();
83 setId(componentId);
84 }
85
86 public ITabIterator listTabs() {
87
88
89 return TabbedPaneTools.listTabs(this);
90
91 }
92
93 public TabComponent getSelectedTab() {
94
95
96 return (TabComponent)getSelectedCard();
97
98 }
99
100 public TabComponent getSelectedTab(FacesContext facesContext) {
101
102
103 return (TabComponent)getSelectedCard(facesContext);
104
105 }
106
107 public void select(TabComponent tab) {
108
109
110 super.select(tab);
111
112 }
113
114 public final void addCloseListener(org.rcfaces.core.event.ICloseListener listener) {
115 addFacesListener(listener);
116 }
117
118 public final void removeCloseListener(org.rcfaces.core.event.ICloseListener listener) {
119 removeFacesListener(listener);
120 }
121
122 public final javax.faces.event.FacesListener [] listCloseListeners() {
123 return getFacesListeners(org.rcfaces.core.event.ICloseListener.class);
124 }
125
126 public boolean isClosable() {
127 return isClosable(null);
128 }
129
130
131
132
133 public boolean isClosable(javax.faces.context.FacesContext facesContext) {
134 return engine.getBoolProperty(Properties.CLOSABLE, false, facesContext);
135 }
136
137
138
139
140
141 public final boolean isClosableSetted() {
142 return engine.isPropertySetted(Properties.CLOSABLE);
143 }
144
145 public void setClosable(boolean closable) {
146 engine.setProperty(Properties.CLOSABLE, closable);
147 }
148
149 public final void addPreSelectionListener(org.rcfaces.core.event.IPreSelectionListener listener) {
150 addFacesListener(listener);
151 }
152
153 public final void removePreSelectionListener(org.rcfaces.core.event.IPreSelectionListener listener) {
154 removeFacesListener(listener);
155 }
156
157 public final javax.faces.event.FacesListener [] listPreSelectionListeners() {
158 return getFacesListeners(org.rcfaces.core.event.IPreSelectionListener.class);
159 }
160
161 public java.lang.Object getShowValue() {
162 return getShowValue(null);
163 }
164
165
166
167
168 public java.lang.Object getShowValue(javax.faces.context.FacesContext facesContext) {
169 return engine.getProperty(Properties.SHOW_VALUE, facesContext);
170 }
171
172
173
174
175
176 public final boolean isShowValueSetted() {
177 return engine.isPropertySetted(Properties.SHOW_VALUE);
178 }
179
180 public void setShowValue(java.lang.Object showValue) {
181 engine.setProperty(Properties.SHOW_VALUE, showValue);
182 }
183
184 protected Set getCameliaFields() {
185 return CAMELIA_ATTRIBUTES;
186 }
187 }