Source Code Cross Referenced for TabSetBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package com.sun.rave.web.ui.component;
042:
043:        import java.io.IOException;
044:        import javax.faces.component.UIComponent;
045:        import javax.faces.context.FacesContext;
046:        import javax.faces.el.MethodBinding;
047:        import javax.faces.el.ValueBinding;
048:
049:        /**
050:         * <h3>About This Tag</h3>
051:         * 
052:         * <p>The TabSet renders a set of Tab children. It keeps track of the currently
053:         * selected child Tab as well as applying any specified ActionListener.</p>
054:         * 
055:         * <h3>Configuring the TabSet Tag</h3>
056:         * 
057:         * <p>The TabSet can currently be used in one of two ways: via a component binding to a
058:         * TabSet and group of child Tab components (defined in a backing bean); or by specifying the
059:         * TabSet and child Tabs directly in your JSP.</p><p>Examples of both are shown in the Examples
060:         * section below. It is anticipated that the component binding method will be more
061:         * common as this allows a single set of Tabs to be easily shared among many pages. In
062:         * either case, the initial selection for the TabSet component can be specified using the
063:         * &quot;selected&quot; property. Note that if an ActionListener is applied to the TabSet
064:         * component, it adds the specified ActionListener to each of its child Tab components action
065:         * listener lists.</p>
066:         * 
067:         * <h3>Facets</h3>
068:         * 
069:         * <p>None at this time</p>
070:         * 
071:         * <h3>Client Side Javascript Functions</h3>
072:         * 
073:         * <p>None at this time</p>
074:         * 
075:         * <h3>Examples</h3>
076:         * 
077:         * <p><strong>Example 1: Define the TabSet via a component binding</strong><br>
078:         * One way a TabSet component can be specified is via a JSF component binding to an instance
079:         * defined in a backing bean. The contents of the JSP in this case will simply be something
080:         * like:</p>
081:         * 
082:         * <p><code>&lt;ui:tabSet binding=&quot;#{TabSetBean.sportsTabSet}&quot; /&gt;</code></p>
083:         * 
084:         * <p>The code in the corresponding backing bean instance would look something like:</p>
085:         * 
086:         * <p><code>import java.util.List;<br>
087:         * import java.lang.Class;<br>
088:         * import javax.faces.FactoryFinder;<br>
089:         * import javax.faces.el.MethodBinding;<br>
090:         * import javax.faces.event.ActionEvent;<br>
091:         * import javax.faces.application.Application;<br>
092:         * import javax.faces.application.ApplicationFactory;<br>
093:         * import com.sun.rave.web.ui.component.Tab;<br>
094:         * import com.sun.rave.web.ui.component.TabSet;</p>
095:         * 
096:         * <p>public class TabSetBean {<br>
097:         * &nbsp;&nbsp;&nbsp; private TabSet sportsTabSet = null;<br>
098:         * <br>
099:         * &nbsp;&nbsp;&nbsp;  // Creates a new instance of TabSetBean //<br>
100:         * &nbsp;&nbsp;&nbsp; public TabSetBean() {<br>
101:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sportsTabSet = new TabSet();<br>
102:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List kids = sportsTabSet.getChildren();<br>
103:         * <br>
104:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tab level1Tab = new Tab(&quot;Baseball&quot;);<br>
105:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level1Tab.setId(&quot;Baseball&quot;);<br>
106:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tab level2Tab = addTab(level1Tab,
107:         * &quot;National&quot;); <br>
108:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Mets&quot;);<br>
109:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Pirates&quot;);<br>
110:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Cubs&quot;);<br>
111:         * <br>
112:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level2Tab = addTab(level1Tab,
113:         * &quot;American&quot;); <br>
114:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Yankees&quot;);<br>
115:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Tigers&quot;);<br>
116:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Mariners&quot;);<br>
117:         * <br>
118:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level2Tab = addTab(level1Tab, &quot;AAA&quot;);<br>
119:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Spinners&quot;);<br>
120:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Renegades&quot;);<br>
121:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Clippers&quot;); <br>
122:         * <br>
123:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kids.add(level1Tab);<br>
124:         * <br>
125:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level1Tab = new Tab(&quot;Football&quot;);<br>
126:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level1Tab.setId(&quot;Football&quot;);<br>
127:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level2Tab = addTab(level1Tab, &quot;NFC&quot;);
128:         * <br>
129:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Giants&quot;);<br>
130:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Bears&quot;);<br>
131:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Falcons&quot;);<br>
132:         * <br>
133:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level2Tab = addTab(level1Tab, &quot;AFC&quot;);
134:         * <br>
135:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Jets&quot;);<br>
136:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Patriots&quot;);<br>
137:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Colts&quot;);<br>
138:         * <br>
139:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level2Tab = addTab(level1Tab,
140:         * &quot;College&quot;);<br>
141:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Wolverines&quot;);<br>
142:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Hurricanes&quot;);<br>
143:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addTab(level2Tab, &quot;Buckeyes&quot;);<br>
144:         * <br>
145:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kids.add(level1Tab);<br>
146:         * <br>
147:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Class[] args = new Class[] { ActionEvent.class
148:         * };<br>
149:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MethodBinding binding =
150:         * createBinding(&quot;#{TabSetBean.tabClicked}&quot;, args);<br>
151:         * <br>
152:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sportsTabSet.setActionListener(binding); <br>
153:         * <br>
154:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sportsTabSet.setSelected(&quot;Jets&quot;);<br>
155:         * <br>
156:         * &nbsp;&nbsp;&nbsp; }<br>
157:         * <br>
158:         * &nbsp;&nbsp;&nbsp; private MethodBinding createBinding(String expr, Class[] args) { <br>
159:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ApplicationFactory factory =
160:         * (ApplicationFactory)<br>
161:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);<br>
162:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application app = factory.getApplication();<br>
163:         * <br>
164:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return app.createMethodBinding(expr, args);<br>
165:         * &nbsp;&nbsp;&nbsp; }<br>
166:         * <br>
167:         * &nbsp;&nbsp;&nbsp; private Tab addTab(Tab parent, String newTabLabel) {<br>
168:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tab tab = new Tab(newTabLabel);<br>
169:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tab.setId(newTabLabel); <br>
170:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parent.getChildren().add(tab);<br>
171:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return tab;<br>
172:         * &nbsp;&nbsp;&nbsp; } </p>
173:         * 
174:         * <p>&nbsp;&nbsp;&nbsp; public void tabClicked(ActionEvent event) {<br>
175:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String clickedTabId = event.getComponent().getId():<br>
176:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String selectedTabId = sportsTabSet.getSelected();<br>
177:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ... do sometehing based upon the clicked or
178:         * selected tab id ...<br>
179:         * &nbsp;&nbsp;&nbsp; }<br>
180:         * <br>
181:         * &nbsp;&nbsp;&nbsp; public TabSet getSportsTabSet() {<br>
182:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return sportsTabSet;<br>
183:         * &nbsp;&nbsp;&nbsp; }<br>
184:         * <br>
185:         * &nbsp;&nbsp;&nbsp; public void setSportsTabSet(TabSet tabs) {<br>
186:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sportsTabSet = tabs;<br>
187:         * &nbsp;&nbsp;&nbsp; }<br>
188:         * }</code></p>
189:         * 
190:         * <p><strong>Example 2: Define the TabSet in your JSP</strong><br>
191:         * A tabSet can also be defined directly in your JSP. The following example defines a set of tabs with
192:         * three level one tabs (labelled &quot;One&quot;, &quot;Two&quot; and &quot;Three&quot;). Each
193:         * level one tab also has two level two tab childeren (labelled &quot;XxxA&quot; and
194:         * &quot;XxxB&quot; where X is the top level tab number. The initially selected Tab for this
195:         * TabSet will be &quot;TwoA&quot;.</p>
196:         * 
197:         * <p><code>&lt;ui:tabSet selected=&quot;TwoA&quot;&gt;<br>
198:         * &nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;One&quot; text=&quot;One&quot;&gt;<br>
199:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;OneA&quot; text=&quot;One
200:         * A&quot; /&gt;<br>
201:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;OneB&quot; text=&quot;One
202:         * B&quot; /&gt;<br>
203:         * &nbsp;&nbsp;&nbsp; &lt;/ui:tab&gt;<br>
204:         * &nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;Two&quot; text=&quot;Two&quot;&gt;<br>
205:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;TwoA&quot; text=&quot;Two
206:         * A&quot; /&gt;<br>
207:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;TwoB&quot; text=&quot;Two
208:         * B&quot; /&gt;<br>
209:         * &nbsp;&nbsp;&nbsp; &lt;/ui:tab&gt;<br>
210:         * &nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;Three&quot; text=&quot;Three&quot;&gt;<br>
211:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;ThreeA&quot;
212:         * text=&quot;Three A&quot; /&gt;<br>
213:         * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:tab id=&quot;ThreeB&quot;
214:         * text=&quot;Three B&quot; /&gt;<br>
215:         * &nbsp;&nbsp;&nbsp; &lt;/ui:tab&gt; <br>
216:         * &lt;/ui:tabSet&gt;</code></p>
217:         * <p>Auto-generated component class.
218:         * Do <strong>NOT</strong> modify; all changes
219:         * <strong>will</strong> be lost!</p>
220:         */
221:
222:        public abstract class TabSetBase extends
223:                javax.faces.component.UINamingContainer {
224:
225:            /**
226:             * <p>Construct a new <code>TabSetBase</code>.</p>
227:             */
228:            public TabSetBase() {
229:                super ();
230:                setRendererType("com.sun.rave.web.ui.TabSet");
231:            }
232:
233:            /**
234:             * <p>Return the identifier of the component family to which this
235:             * component belongs.  This identifier, in conjunction with the value
236:             * of the <code>rendererType</code> property, may be used to select
237:             * the appropriate {@link Renderer} for this component instance.</p>
238:             */
239:            public String getFamily() {
240:                return "com.sun.rave.web.ui.TabSet";
241:            }
242:
243:            // actionListener
244:            private javax.faces.el.MethodBinding actionListener = null;
245:
246:            /**
247:             * <p>Use the actionListener attribute to cause the hyperlink to fire an
248:             *         event. The value must be an EL expression and it must evaluate to the 
249:             *         name of a public method that takes an ActionEvent parameter and returns
250:             *         void.</p>
251:             */
252:            public javax.faces.el.MethodBinding getActionListener() {
253:                if (this .actionListener != null) {
254:                    return this .actionListener;
255:                }
256:                ValueBinding _vb = getValueBinding("actionListener");
257:                if (_vb != null) {
258:                    return (javax.faces.el.MethodBinding) _vb
259:                            .getValue(getFacesContext());
260:                }
261:                return null;
262:            }
263:
264:            /**
265:             * <p>Use the actionListener attribute to cause the hyperlink to fire an
266:             *         event. The value must be an EL expression and it must evaluate to the 
267:             *         name of a public method that takes an ActionEvent parameter and returns
268:             *         void.</p>
269:             * @see #getActionListener()
270:             */
271:            public void setActionListener(
272:                    javax.faces.el.MethodBinding actionListener) {
273:                this .actionListener = actionListener;
274:            }
275:
276:            // lite
277:            private boolean lite = false;
278:            private boolean lite_set = false;
279:
280:            /**
281:             * <p>Render a style of tabs that isn't so visually "heavy".  This property
282:             *         must be used in conjunction with the "mini" property set to true
283:             *         in order to work.</p>
284:             */
285:            public boolean isLite() {
286:                if (this .lite_set) {
287:                    return this .lite;
288:                }
289:                ValueBinding _vb = getValueBinding("lite");
290:                if (_vb != null) {
291:                    Object _result = _vb.getValue(getFacesContext());
292:                    if (_result == null) {
293:                        return false;
294:                    } else {
295:                        return ((Boolean) _result).booleanValue();
296:                    }
297:                }
298:                return false;
299:            }
300:
301:            /**
302:             * <p>Render a style of tabs that isn't so visually "heavy".  This property
303:             *         must be used in conjunction with the "mini" property set to true
304:             *         in order to work.</p>
305:             * @see #isLite()
306:             */
307:            public void setLite(boolean lite) {
308:                this .lite = lite;
309:                this .lite_set = true;
310:            }
311:
312:            // mini
313:            private boolean mini = false;
314:            private boolean mini_set = false;
315:
316:            /**
317:             * <p>Specify "true" if this TabSet should have the mini style</p>
318:             */
319:            public boolean isMini() {
320:                if (this .mini_set) {
321:                    return this .mini;
322:                }
323:                ValueBinding _vb = getValueBinding("mini");
324:                if (_vb != null) {
325:                    Object _result = _vb.getValue(getFacesContext());
326:                    if (_result == null) {
327:                        return false;
328:                    } else {
329:                        return ((Boolean) _result).booleanValue();
330:                    }
331:                }
332:                return false;
333:            }
334:
335:            /**
336:             * <p>Specify "true" if this TabSet should have the mini style</p>
337:             * @see #isMini()
338:             */
339:            public void setMini(boolean mini) {
340:                this .mini = mini;
341:                this .mini_set = true;
342:            }
343:
344:            // selected
345:            private String selected = null;
346:
347:            /**
348:             * <p>The id of the selected tab</p>
349:             */
350:            public String getSelected() {
351:                if (this .selected != null) {
352:                    return this .selected;
353:                }
354:                ValueBinding _vb = getValueBinding("selected");
355:                if (_vb != null) {
356:                    return (String) _vb.getValue(getFacesContext());
357:                }
358:                return null;
359:            }
360:
361:            /**
362:             * <p>The id of the selected tab</p>
363:             * @see #getSelected()
364:             */
365:            public void setSelected(String selected) {
366:                this .selected = selected;
367:            }
368:
369:            // style
370:            private String style = null;
371:
372:            /**
373:             * <p>CSS style(s) to be applied when this component is rendered.</p>
374:             */
375:            public String getStyle() {
376:                if (this .style != null) {
377:                    return this .style;
378:                }
379:                ValueBinding _vb = getValueBinding("style");
380:                if (_vb != null) {
381:                    return (String) _vb.getValue(getFacesContext());
382:                }
383:                return null;
384:            }
385:
386:            /**
387:             * <p>CSS style(s) to be applied when this component is rendered.</p>
388:             * @see #getStyle()
389:             */
390:            public void setStyle(String style) {
391:                this .style = style;
392:            }
393:
394:            // styleClass
395:            private String styleClass = null;
396:
397:            /**
398:             * <p>CSS style class(es) to be applied when this component is rendered.</p>
399:             */
400:            public String getStyleClass() {
401:                if (this .styleClass != null) {
402:                    return this .styleClass;
403:                }
404:                ValueBinding _vb = getValueBinding("styleClass");
405:                if (_vb != null) {
406:                    return (String) _vb.getValue(getFacesContext());
407:                }
408:                return null;
409:            }
410:
411:            /**
412:             * <p>CSS style class(es) to be applied when this component is rendered.</p>
413:             * @see #getStyleClass()
414:             */
415:            public void setStyleClass(String styleClass) {
416:                this .styleClass = styleClass;
417:            }
418:
419:            // visible
420:            private boolean visible = false;
421:            private boolean visible_set = false;
422:
423:            /**
424:             * <p>Use the visible attribute to indicate whether the component should be
425:             *     viewable by the user in the rendered HTML page. If set to false, the
426:             *     HTML code for the component is present in the page, but the component
427:             *     is hidden with style attributes. By default, visible is set to true, so
428:             *     HTML for the component HTML is included and visible to the user. If the
429:             *     component is not visible, it can still be processed on subsequent form
430:             *     submissions because the HTML is present.</p>
431:             */
432:            public boolean isVisible() {
433:                if (this .visible_set) {
434:                    return this .visible;
435:                }
436:                ValueBinding _vb = getValueBinding("visible");
437:                if (_vb != null) {
438:                    Object _result = _vb.getValue(getFacesContext());
439:                    if (_result == null) {
440:                        return false;
441:                    } else {
442:                        return ((Boolean) _result).booleanValue();
443:                    }
444:                }
445:                return true;
446:            }
447:
448:            /**
449:             * <p>Use the visible attribute to indicate whether the component should be
450:             *     viewable by the user in the rendered HTML page. If set to false, the
451:             *     HTML code for the component is present in the page, but the component
452:             *     is hidden with style attributes. By default, visible is set to true, so
453:             *     HTML for the component HTML is included and visible to the user. If the
454:             *     component is not visible, it can still be processed on subsequent form
455:             *     submissions because the HTML is present.</p>
456:             * @see #isVisible()
457:             */
458:            public void setVisible(boolean visible) {
459:                this .visible = visible;
460:                this .visible_set = true;
461:            }
462:
463:            /**
464:             * <p>Restore the state of this component.</p>
465:             */
466:            public void restoreState(FacesContext _context, Object _state) {
467:                Object _values[] = (Object[]) _state;
468:                super .restoreState(_context, _values[0]);
469:                this .actionListener = (javax.faces.el.MethodBinding) restoreAttachedState(
470:                        _context, _values[1]);
471:                this .lite = ((Boolean) _values[2]).booleanValue();
472:                this .lite_set = ((Boolean) _values[3]).booleanValue();
473:                this .mini = ((Boolean) _values[4]).booleanValue();
474:                this .mini_set = ((Boolean) _values[5]).booleanValue();
475:                this .selected = (String) _values[6];
476:                this .style = (String) _values[7];
477:                this .styleClass = (String) _values[8];
478:                this .visible = ((Boolean) _values[9]).booleanValue();
479:                this .visible_set = ((Boolean) _values[10]).booleanValue();
480:            }
481:
482:            /**
483:             * <p>Save the state of this component.</p>
484:             */
485:            public Object saveState(FacesContext _context) {
486:                Object _values[] = new Object[11];
487:                _values[0] = super .saveState(_context);
488:                _values[1] = saveAttachedState(_context, actionListener);
489:                _values[2] = this .lite ? Boolean.TRUE : Boolean.FALSE;
490:                _values[3] = this .lite_set ? Boolean.TRUE : Boolean.FALSE;
491:                _values[4] = this .mini ? Boolean.TRUE : Boolean.FALSE;
492:                _values[5] = this .mini_set ? Boolean.TRUE : Boolean.FALSE;
493:                _values[6] = this .selected;
494:                _values[7] = this .style;
495:                _values[8] = this .styleClass;
496:                _values[9] = this .visible ? Boolean.TRUE : Boolean.FALSE;
497:                _values[10] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
498:                return _values;
499:            }
500:
501:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.