KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > faces > component > paneltabset > PanelTabSet


1 /*
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * "The contents of this file are subject to the Mozilla Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11  * License for the specific language governing rights and limitations under
12  * the License.
13  *
14  * The Original Code is ICEfaces 1.5 open source software code, released
15  * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
16  * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
17  * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
18  *
19  * Contributor(s): _____________________.
20  *
21  * Alternatively, the contents of this file may be used under the terms of
22  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
23  * License), in which case the provisions of the LGPL License are
24  * applicable instead of those above. If you wish to allow use of your
25  * version of this file only under the terms of the LGPL License and not to
26  * allow others to use your version of this file under the MPL, indicate
27  * your decision by deleting the provisions above and replace them with
28  * the notice and other provisions required by the LGPL License. If you do
29  * not delete the provisions above, a recipient may use your version of
30  * this file under either the MPL or the LGPL License."
31  *
32  */

33 /* Original copyright.
34  * Copyright 2004 The Apache Software Foundation.
35  *
36  * Licensed under the Apache License, Version 2.0 (the "License");
37  * you may not use this file except in compliance with the License.
38  * You may obtain a copy of the License at
39  *
40  * http://www.apache.org/licenses/LICENSE-2.0
41  *
42  * Unless required by applicable law or agreed to in writing, software
43  * distributed under the License is distributed on an "AS IS" BASIS,
44  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45  * See the License for the specific language governing permissions and
46  * limitations under the License.
47  */

48 package com.icesoft.faces.component.paneltabset;
49
50 import com.icesoft.faces.component.CSS_DEFAULT;
51 import com.icesoft.faces.component.ext.taglib.Util;
52 import com.icesoft.faces.component.panelseries.UISeries;
53
54 import javax.faces.component.UIComponent;
55 import javax.faces.component.UIForm;
56 import javax.faces.component.UINamingContainer;
57 import javax.faces.context.FacesContext;
58 import javax.faces.el.EvaluationException;
59 import javax.faces.el.MethodBinding;
60 import javax.faces.el.ValueBinding;
61 import javax.faces.event.AbortProcessingException;
62 import javax.faces.event.FacesEvent;
63 import javax.faces.event.FacesListener;
64 import javax.faces.event.PhaseId;
65
66 import java.util.ArrayList JavaDoc;
67 import java.util.Iterator JavaDoc;
68 import java.util.List JavaDoc;
69
70 /**
71  * <p>PanelTabSet is a JSF component class that represents an ICEfaces tab panel
72  * container.</p>
73  * <p/>
74  * This component extends the ICEfaces UISeries component which is a modified
75  * implementation of UIData. </p>
76  * <p/>
77  * By default the component is rendered by the "com.icesoft.faces.TabbedPane"
78  * renderer type. </p>
79  */

80 public class PanelTabSet
81         extends UISeries {
82
83
84     /**
85      * The method binding for a TabChangeListener.
86      */

87     private MethodBinding _tabChangeListener = null;
88
89     /* (non-Javadoc)
90      * @see javax.faces.component.UIComponent#decode(javax.faces.context.FacesContext)
91      */

92     public void decode(FacesContext context) {
93         reconcileListeners();
94         super.decode(context);
95     }
96
97     /**
98      * @param context
99      * @param phaseId
100      */

101     public void applyPhase(FacesContext context, PhaseId phaseId) {
102         if (context == null) {
103             throw new NullPointerException JavaDoc("Null context in PanelTabSet");
104         }
105 // if(phaseId == PhaseId.APPLY_REQUEST_VALUES)
106
// decode(context);
107

108         int tabIdx = 0;
109         int selectedIndex = getSelectedIndex();
110
111         if (super.getValue() != null) {
112             int rowIndex = super.getFirst();
113             setRowIndex(rowIndex);
114             int rowsToBeDisplayed = getRows();
115             int rowsDisplayed = 0;
116             UIComponent child =
117                     getUIComponent((UIComponent) getChildren().get(0));
118             while (isRowAvailable()) {
119                 if (rowsToBeDisplayed > 0 &&
120                     rowsDisplayed >= rowsToBeDisplayed) {
121                     break;
122                 }
123
124                 if (child instanceof PanelTab) {
125                     if (tabIdx == selectedIndex) {
126                         applyPhase(context, child, phaseId);
127                     }
128                     tabIdx++;
129                 }
130                 rowsDisplayed++;
131                 rowIndex++;
132                 setRowIndex(rowIndex);
133             }
134             setRowIndex(-1);
135         } else {
136
137             Iterator JavaDoc it = getFacetsAndChildren();
138
139             while (it.hasNext()) {
140                 UIComponent childOrFacet =
141                         getUIComponent((UIComponent) it.next());
142                 if (childOrFacet instanceof PanelTab) {
143                     if (tabIdx == selectedIndex) {
144                         applyPhase(context, childOrFacet, phaseId);
145                     }
146                     tabIdx++;
147                 } else {
148                     applyPhase(context, childOrFacet, phaseId);
149                 }
150             }
151         }
152
153     }
154
155     /**
156      * @param context
157      * @param component
158      * @param phaseId
159      */

160     public void applyPhase(FacesContext context, UIComponent component,
161                            PhaseId phaseId) {
162         if (phaseId == PhaseId.APPLY_REQUEST_VALUES) {
163             component.processDecodes(context);
164         } else if (phaseId == PhaseId.PROCESS_VALIDATIONS) {
165             component.processValidators(context);
166         } else if (phaseId == PhaseId.UPDATE_MODEL_VALUES) {
167             component.processUpdates(context);
168         } else {
169             throw new IllegalArgumentException JavaDoc();
170         }
171     }
172
173     /* (non-Javadoc)
174     * @see javax.faces.component.UIComponent#processDecodes(javax.faces.context.FacesContext)
175     */

176     public void processDecodes(javax.faces.context.FacesContext context) {
177         if (context == null) {
178             throw new NullPointerException JavaDoc("context");
179         }
180
181         if (!isRendered()) {
182             return;
183         }
184
185         decode(context);
186         applyPhase(context, PhaseId.APPLY_REQUEST_VALUES);
187     }
188
189     /* (non-Javadoc)
190     * @see javax.faces.component.UIComponent#processValidators(javax.faces.context.FacesContext)
191     */

192     public void processValidators(FacesContext context) {
193
194         if (context == null) {
195             throw new NullPointerException JavaDoc();
196         }
197         if (!isRendered()) {
198             return;
199         }
200         applyPhase(context, PhaseId.PROCESS_VALIDATIONS);
201     }
202
203
204     /* (non-Javadoc)
205      * @see javax.faces.component.UIComponent#processUpdates(javax.faces.context.FacesContext)
206      */

207     public void processUpdates(FacesContext context) {
208
209         if (context == null) {
210             throw new NullPointerException JavaDoc();
211         }
212         if (!isRendered()) {
213             return;
214         }
215         applyPhase(context, PhaseId.UPDATE_MODEL_VALUES);
216     }
217
218     private UIComponent getUIComponent(UIComponent uiComponent) {
219         if (uiComponent instanceof UINamingContainer ||
220             uiComponent instanceof UIForm) {
221             List JavaDoc children = uiComponent.getChildren();
222             for (int i = 0, len = children.size(); i < len; i++) {
223                 uiComponent = getUIComponent((UIComponent) children.get(i));
224             }
225         }
226         return uiComponent;
227     }
228
229     /**
230      * @param listener
231      */

232     private List JavaDoc listenerList = new ArrayList JavaDoc();
233     public void addTabChangeListener(TabChangeListener listener) {
234         listenerList.add(listener);
235         addFacesListener(listener);
236     }
237
238     /**
239      * @param listener
240      */

241     public void removeTabChangeListener(TabChangeListener listener) {
242         listenerList.remove(listener);
243         removeFacesListener(listener);
244     }
245
246     /**
247      * reconcile TabChangeListeners
248      */

249     private void reconcileListeners(){
250         FacesListener[] listener = getFacesListeners(TabChangeListener.class);
251         for (int i=0; i< listener.length; i++) {
252             super.removeFacesListener(listener[i]);
253         }
254         Iterator JavaDoc it = listenerList.iterator();
255         while(it.hasNext()) {
256             super.addFacesListener((TabChangeListener)it.next());
257         }
258     }
259
260     /**
261      * @return the tabChangeListener
262      */

263     public MethodBinding getTabChangeListener() {
264         return _tabChangeListener;
265     }
266
267     /**
268      * @param tabChangeListener
269      */

270     public void setTabChangeListener(MethodBinding tabChangeListener) {
271         _tabChangeListener = tabChangeListener;
272     }
273
274     /* (non-Javadoc)
275      * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
276      */

277     public void broadcast(FacesEvent event) throws AbortProcessingException {
278         if (event instanceof TabChangeEvent) {
279             TabChangeEvent tabChangeEvent = (TabChangeEvent) event;
280             if (tabChangeEvent.getComponent() == this) {
281                 setSelectedIndex(tabChangeEvent.getNewTabIndex());
282                 //getFacesContext().renderResponse();
283
}
284         }
285         
286         super.broadcast(event);
287         
288         if (event instanceof TabChangeEvent) {
289             TabChangeEvent tabChangeEvent = (TabChangeEvent) event;
290             MethodBinding tabChangeListenerBinding = getTabChangeListener();
291             if (tabChangeListenerBinding != null) {
292                 try {
293                     tabChangeListenerBinding.invoke(
294                             getFacesContext(), new Object JavaDoc[]{tabChangeEvent});
295                 }
296                 catch (EvaluationException e) {
297                     Throwable JavaDoc cause = e.getCause();
298                     if (cause != null &&
299                             cause instanceof AbortProcessingException) {
300                         throw(AbortProcessingException) cause;
301                     } else {
302                         throw e;
303                     }
304                 }
305             }
306         }
307     }
308
309     /* (non-Javadoc)
310     * @see javax.faces.component.UIComponent#isRendered()
311     */

312     public boolean isRendered() {
313         if (!Util.isRenderedOnUserRole(this)) {
314             return false;
315         }
316         return super.isRendered();
317     }
318
319     /**
320      * The component type.
321      */

322     public static final String JavaDoc COMPONENT_TYPE = "com.icesoft.faces.PanelTabSet";
323     /**
324      * The component family.
325      */

326     public static final String JavaDoc COMPONENT_FAMILY = "javax.faces.Panel";
327     /**
328      * The default renderer type.
329      */

330     private static final String JavaDoc DEFAULT_RENDERER_TYPE =
331             "com.icesoft.faces.TabbedPane";
332     /**
333      * The default selected index.
334      */

335     private static final int DEFAULT_SELECTEDINDEX = 0;
336     /**
337      * The default tab placement.
338      */

339     private final String JavaDoc DEFAULT_TABPLACEMENT =
340             "Top"; // Top, Bottom, Left or Right
341

342     final static String JavaDoc TABPLACEMENT_BOTTOM =
343         "bottom"; //
344
// default styles
345

346     /**
347      * The default background color of the tab panels.
348      */

349     private static final String JavaDoc DEFAULT_BG_COLOR = "#FFFFFF";
350     /**
351      * The current selected tab index.
352      */

353     private Integer JavaDoc _selectedIndex = null;
354     /**
355      * The current tab placement. <p>At this time only "top" and "bottom" are
356      * supported.
357      */

358     private String JavaDoc _tabPlacement = null;
359     /**
360      * The current background color.
361      */

362     private String JavaDoc _bgcolor = null;
363     /**
364      * The current style.
365      */

366     private String JavaDoc _style = null;
367     /**
368      * The current style class name.
369      */

370     private String JavaDoc _styleClass = null;
371
372     /**
373      * Creates an instance and sets the default renderer type to
374      * "com.icesoft.faces.TabbedPane".
375      */

376     public PanelTabSet() {
377         setRendererType(DEFAULT_RENDERER_TYPE);
378     }
379
380     /* (non-Javadoc)
381      * @see javax.faces.component.UIComponent#getFamily()
382      */

383     public String JavaDoc getFamily() {
384         return COMPONENT_FAMILY;
385     }
386
387     /**
388      * @param selectedIndex
389      */

390     void setSelectedIndex(Integer JavaDoc selectedIndex) {
391         _selectedIndex = selectedIndex;
392     }
393
394     /**
395      * @param selectedIndex
396      */

397     public void setSelectedIndex(int selectedIndex) {
398         _selectedIndex = new Integer JavaDoc(selectedIndex);
399     }
400
401     /**
402      * @return the value of selectedIndex
403      */

404     public int getSelectedIndex() {
405         if (_selectedIndex != null) {
406             return _selectedIndex.intValue();
407         }
408         ValueBinding vb = getValueBinding("selectedIndex");
409         Number JavaDoc v = vb != null ? (Number JavaDoc) vb.getValue(getFacesContext()) : null;
410         return v != null ? v.intValue() : DEFAULT_SELECTEDINDEX;
411     }
412
413     /**
414      * @param bgcolor
415      */

416     public void setBgcolor(String JavaDoc bgcolor) {
417         _bgcolor = bgcolor;
418     }
419
420     /**
421      * @return the value of bgcolor
422      */

423     public String JavaDoc getBgcolor() {
424         if (_bgcolor != null) {
425             return _bgcolor;
426         }
427         ValueBinding vb = getValueBinding("bgcolor");
428         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) :
429                DEFAULT_BG_COLOR;
430     }
431
432     private int border = 0;
433     private boolean border_set = false;
434
435     /**
436      * <p>Return the value of the <code>border</code> property. Contents:</p><p>
437      * Width (in pixels) of the border to be drawn around this table. </p>
438      *
439      * @return border
440      */

441     public int getBorder() {
442         if (this.border_set) {
443             return this.border;
444         }
445         ValueBinding _vb = getValueBinding("border");
446         if (_vb != null) {
447             Object JavaDoc _result = _vb.getValue(getFacesContext());
448             if (_result == null) {
449                 return 0;
450             } else {
451                 return ((Integer JavaDoc) _result).intValue();
452             }
453         } else {
454             return this.border;
455         }
456     }
457
458     /**
459      * <p>Set the value of the <code>border</code> property.</p>
460      *
461      * @param border
462      */

463     public void setBorder(int border) {
464         this.border = border;
465         this.border_set = true;
466     }
467
468     /* (non-Javadoc)
469      * @see javax.faces.component.html.HtmlPanelGroup#setStyle(java.lang.String)
470      */

471     public void setStyle(String JavaDoc style) {
472         _style = style;
473     }
474
475     /* (non-Javadoc)
476      * @see javax.faces.component.html.HtmlPanelGroup#getStyle()
477      */

478     public String JavaDoc getStyle() {
479         if (_style != null) {
480             return _style;
481         }
482         ValueBinding vb = getValueBinding("style");
483         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
484     }
485
486     /* (non-Javadoc)
487      * @see javax.faces.component.html.HtmlPanelGroup#setStyleClass(java.lang.String)
488      */

489     public void setStyleClass(String JavaDoc styleClass) {
490         _styleClass = styleClass;
491     }
492
493     /* (non-Javadoc)
494      * @see javax.faces.component.html.HtmlPanelGroup#getStyleClass()
495      */

496     public String JavaDoc getStyleClass() {
497         return Util.getQualifiedStyleClass(this,
498                 _styleClass,
499                 CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_TAB_SET,
500                 "styleClass");
501     }
502
503     /**
504      * @param tabPlacement
505      */

506     public void setTabPlacement(String JavaDoc tabPlacement) {
507         _tabPlacement = tabPlacement;
508     }
509
510     /**
511      * @return the value of tabPlacement, currently only "top" and "bottom" are
512      * supported
513      */

514     public String JavaDoc getTabPlacement() {
515         if (_tabPlacement != null) {
516             return _tabPlacement;
517         }
518         ValueBinding vb = getValueBinding("tabPlacement");
519         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) :
520                this.DEFAULT_TABPLACEMENT;
521     }
522
523     /* (non-Javadoc)
524     * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
525     */

526     public Object JavaDoc saveState(FacesContext context) {
527         Object JavaDoc values[] = new Object JavaDoc[29];
528         values[0] = super.saveState(context);
529         values[1] = _selectedIndex;
530         values[2] = _bgcolor;
531         values[3] = saveAttachedState(context, _tabChangeListener);
532         values[4] = _style;
533         values[5] = _styleClass;
534         values[6] = _tabPlacement;
535         values[7] = onclick;
536         values[8] = ondblclick;
537         values[9] = onmousedown;
538         values[10] = onmouseup;
539         values[11] = onmouseover;
540         values[12] = onmousemove;
541         values[13] = onmouseout;
542         values[14] = onkeypress;
543         values[15] = onkeydown;
544         values[16] = onkeyup;
545         values[17] = align;
546         values[18] = new Integer JavaDoc(border);
547         values[19] = cellpadding;
548         values[20] = cellspacing;
549         values[21] = frame;
550         values[22] = rules;
551         values[23] = summary;
552         values[24] = height;
553         values[25] = width;
554         values[26] = dir;
555         values[27] = lang;
556         values[28] = title;
557         return ((Object JavaDoc) (values));
558     }
559
560     /* (non-Javadoc)
561      * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
562      */

563     public void restoreState(FacesContext context, Object JavaDoc state) {
564         Object JavaDoc values[] = (Object JavaDoc[]) state;
565         super.restoreState(context, values[0]);
566         _selectedIndex = (Integer JavaDoc) values[1];
567         _bgcolor = (String JavaDoc) values[2];
568         _tabChangeListener =
569                 (MethodBinding) restoreAttachedState(context, values[3]);
570         _style = (String JavaDoc) values[4];
571         _styleClass = (String JavaDoc) values[5];
572         _tabPlacement = (String JavaDoc) values[6];
573         onclick = (String JavaDoc) values[7];
574         ondblclick = (String JavaDoc) values[8];
575         onmousedown = (String JavaDoc) values[9];
576         onmouseup = (String JavaDoc) values[10];
577         onmouseover = (String JavaDoc) values[11];
578         onmousemove = (String JavaDoc) values[12];
579         onmouseout = (String JavaDoc) values[13];
580         onkeypress = (String JavaDoc) values[14];
581         onkeydown = (String JavaDoc) values[15];
582         onkeyup = (String JavaDoc) values[16];
583         align = (String JavaDoc) values[17];
584         border = ((Integer JavaDoc) values[18]).intValue();
585         cellpadding = (String JavaDoc) values[19];
586         cellspacing = (String JavaDoc) values[20];
587         frame = (String JavaDoc) values[21];
588         rules = (String JavaDoc) values[22];
589         summary = (String JavaDoc) values[23];
590         height = (String JavaDoc) values[24];
591         width = (String JavaDoc) values[25];
592         dir = (String JavaDoc) values[26];
593         lang = (String JavaDoc) values[27];
594         title = (String JavaDoc) values[28];
595     }
596
597     private String JavaDoc onclick;
598     private String JavaDoc ondblclick;
599     private String JavaDoc onmousedown = null;
600     private String JavaDoc onmouseup = null;
601     private String JavaDoc onmouseover = null;
602     private String JavaDoc onmousemove = null;
603     private String JavaDoc onmouseout = null;
604     private String JavaDoc onkeypress = null;
605     private String JavaDoc onkeydown = null;
606     private String JavaDoc onkeyup = null;
607     private String JavaDoc align = null;
608     private String JavaDoc cellpadding = null;
609     private String JavaDoc cellspacing = null;
610     private String JavaDoc frame = null;
611     private String JavaDoc rules = null;
612     private String JavaDoc summary = null;
613     private String JavaDoc height = null;
614     private String JavaDoc width = null;
615     private String JavaDoc dir = null;
616     private String JavaDoc lang = null;
617     private String JavaDoc title = null;
618
619     /**
620      * @param align
621      */

622     public void setAlign(String JavaDoc align) {
623         this.align = align;
624     }
625
626     /* (non-Javadoc)
627      * @see javax.faces.component.html.HtmlDataTable#setCellpadding(java.lang.String)
628      */

629     public void setCellpadding(String JavaDoc cellpadding) {
630         this.cellpadding = cellpadding;
631     }
632
633     /* (non-Javadoc)
634      * @see javax.faces.component.html.HtmlDataTable#setCellspacing(java.lang.String)
635      */

636     public void setCellspacing(String JavaDoc cellspacing) {
637         this.cellspacing = cellspacing;
638     }
639
640     /* (non-Javadoc)
641      * @see javax.faces.component.html.HtmlDataTable#setFrame(java.lang.String)
642      */

643     public void setFrame(String JavaDoc frame) {
644         this.frame = frame;
645     }
646
647     /**
648      * @param height
649      */

650     public void setHeight(String JavaDoc height) {
651         this.height = height;
652     }
653
654     /* (non-Javadoc)
655      * @see javax.faces.component.html.HtmlDataTable#setOnclick(java.lang.String)
656      */

657     public void setOnclick(String JavaDoc onclick) {
658         this.onclick = onclick;
659     }
660
661     /* (non-Javadoc)
662      * @see javax.faces.component.html.HtmlDataTable#setOndblclick(java.lang.String)
663      */

664     public void setOndblclick(String JavaDoc ondblclick) {
665         this.ondblclick = ondblclick;
666     }
667
668     /* (non-Javadoc)
669      * @see javax.faces.component.html.HtmlDataTable#setOnkeydown(java.lang.String)
670      */

671     public void setOnkeydown(String JavaDoc onkeydown) {
672         this.onkeydown = onkeydown;
673     }
674
675     /* (non-Javadoc)
676      * @see javax.faces.component.html.HtmlDataTable#setOnkeypress(java.lang.String)
677      */

678     public void setOnkeypress(String JavaDoc onkeypress) {
679         this.onkeypress = onkeypress;
680     }
681
682     /* (non-Javadoc)
683      * @see javax.faces.component.html.HtmlDataTable#setOnkeyup(java.lang.String)
684      */

685     public void setOnkeyup(String JavaDoc onkeyup) {
686         this.onkeyup = onkeyup;
687     }
688
689     /* (non-Javadoc)
690      * @see javax.faces.component.html.HtmlDataTable#setOnmousedown(java.lang.String)
691      */

692     public void setOnmousedown(String JavaDoc onmousedown) {
693         this.onmousedown = onmousedown;
694     }
695
696     /* (non-Javadoc)
697      * @see javax.faces.component.html.HtmlDataTable#setOnmousemove(java.lang.String)
698      */

699     public void setOnmousemove(String JavaDoc onmousemove) {
700         this.onmousemove = onmousemove;
701     }
702
703     /* (non-Javadoc)
704      * @see javax.faces.component.html.HtmlDataTable#setOnmouseout(java.lang.String)
705      */

706     public void setOnmouseout(String JavaDoc onmouseout) {
707         this.onmouseout = onmouseout;
708     }
709
710     /* (non-Javadoc)
711      * @see javax.faces.component.html.HtmlDataTable#setOnmouseover(java.lang.String)
712      */

713     public void setOnmouseover(String JavaDoc onmouseover) {
714         this.onmouseover = onmouseover;
715     }
716
717     /* (non-Javadoc)
718      * @see javax.faces.component.html.HtmlDataTable#setOnmouseup(java.lang.String)
719      */

720     public void setOnmouseup(String JavaDoc onmouseup) {
721         this.onmouseup = onmouseup;
722     }
723
724     /* (non-Javadoc)
725      * @see javax.faces.component.html.HtmlDataTable#setRules(java.lang.String)
726      */

727     public void setRules(String JavaDoc rules) {
728         this.rules = rules;
729     }
730
731     /* (non-Javadoc)
732      * @see javax.faces.component.html.HtmlDataTable#setSummary(java.lang.String)
733      */

734     public void setSummary(String JavaDoc summary) {
735         this.summary = summary;
736     }
737
738     /* (non-Javadoc)
739      * @see javax.faces.component.html.HtmlDataTable#setWidth(java.lang.String)
740      */

741     public void setWidth(String JavaDoc width) {
742         this.width = width;
743     }
744
745     /* (non-Javadoc)
746      * @see javax.faces.component.html.HtmlDataTable#setDir(java.lang.String)
747      */

748     public void setDir(String JavaDoc dir) {
749         this.dir = dir;
750     }
751
752     /* (non-Javadoc)
753      * @see javax.faces.component.html.HtmlDataTable#setLang(java.lang.String)
754      */

755     public void setLang(String JavaDoc lang) {
756         this.lang = lang;
757     }
758
759     /* (non-Javadoc)
760     * @see javax.faces.component.html.HtmlDataTable#setTitle(java.lang.String)
761     */

762     public void setTitle(String JavaDoc title) {
763         this.title = title;
764     }
765
766     /**
767      * @return the value of onclick property
768      */

769     public String JavaDoc getOnclick() {
770         if (onclick != null) {
771             return onclick;
772         }
773         ValueBinding vb = getValueBinding("onclick");
774         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
775     }
776
777     /**
778      * @return the value of ondblclick property
779      */

780     public String JavaDoc getOndblclick() {
781         if (ondblclick != null) {
782             return ondblclick;
783         }
784         ValueBinding vb = getValueBinding("ondblclick");
785         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
786     }
787
788     /**
789      * @return the value of onmousedown property
790      */

791     public String JavaDoc getOnmousedown() {
792         if (onmousedown != null) {
793             return onmousedown;
794         }
795         ValueBinding vb = getValueBinding("onmousedown");
796         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
797     }
798
799     /**
800      * @return the value of onmouseup property
801      */

802     public String JavaDoc getOnmouseup() {
803         if (onmouseup != null) {
804             return onmouseup;
805         }
806         ValueBinding vb = getValueBinding("onmouseup");
807         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
808     }
809
810     /**
811      * @return the value of onmouseover property
812      */

813     public String JavaDoc getOnmouseover() {
814         if (onmouseover != null) {
815             return onmouseover;
816         }
817         ValueBinding vb = getValueBinding("onmouseover");
818         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
819     }
820
821     /**
822      * @return the value of onmousemove property
823      */

824     public String JavaDoc getOnmousemove() {
825         if (onmousemove != null) {
826             return onmousemove;
827         }
828         ValueBinding vb = getValueBinding("onmousemove");
829         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
830     }
831
832     /**
833      * @return the value of onmouseout property
834      */

835     public String JavaDoc getOnmouseout() {
836         if (onmouseout != null) {
837             return onmouseout;
838         }
839         ValueBinding vb = getValueBinding("onmouseout");
840         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
841     }
842
843     /**
844      * @return the value of onkeypress property
845      */

846     public String JavaDoc getOnkeypress() {
847         if (onkeypress != null) {
848             return onkeypress;
849         }
850         ValueBinding vb = getValueBinding("onkeypress");
851         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
852     }
853
854     /**
855      * @return the value of onkeydown property
856      */

857     public String JavaDoc getOnkeydown() {
858         if (onkeydown != null) {
859             return onkeydown;
860         }
861         ValueBinding vb = getValueBinding("onkeydown");
862         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
863     }
864
865     /**
866      * @return the value of onkeyup property
867      */

868     public String JavaDoc getOnkeyup() {
869         if (onkeyup != null) {
870             return onkeyup;
871         }
872         ValueBinding vb = getValueBinding("onkeyup");
873         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
874     }
875
876     /**
877      * @return the value of align property
878      */

879     public String JavaDoc getAlign() {
880         if (align != null) {
881             return align;
882         }
883         ValueBinding vb = getValueBinding("align");
884         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
885     }
886
887
888     /**
889      * @return the value of cellpadding property
890      */

891     public String JavaDoc getCellpadding() {
892         if (cellpadding != null) {
893             return cellpadding;
894         }
895         ValueBinding vb = getValueBinding("cellpadding");
896         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
897     }
898
899     /**
900      * @return the value of cellspacing property
901      */

902     public String JavaDoc getCellspacing() {
903         if (cellspacing != null) {
904             return cellspacing;
905         }
906         ValueBinding vb = getValueBinding("cellspacing");
907         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
908     }
909
910     /**
911      * @return the value of frame property
912      */

913     public String JavaDoc getFrame() {
914         if (frame != null) {
915             return frame;
916         }
917         ValueBinding vb = getValueBinding("frame");
918         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
919     }
920
921     /**
922      * @return the value of rules property
923      */

924     public String JavaDoc getRules() {
925         if (rules != null) {
926             return rules;
927         }
928         ValueBinding vb = getValueBinding("rules");
929         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
930     }
931
932     /**
933      * @return the value of summary property
934      */

935     public String JavaDoc getSummary() {
936         if (summary != null) {
937             return summary;
938         }
939         ValueBinding vb = getValueBinding("summary");
940         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
941     }
942
943     /**
944      * @return the value of height property
945      */

946     public String JavaDoc getHeight() {
947         if (height != null) {
948             return height;
949         }
950         ValueBinding vb = getValueBinding("height");
951         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
952     }
953
954     /**
955      * @return the value of width property
956      */

957     public String JavaDoc getWidth() {
958         if (width != null) {
959             return width;
960         }
961         ValueBinding vb = getValueBinding("width");
962         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
963     }
964
965     /**
966      * @return the value of dir property
967      */

968     public String JavaDoc getDir() {
969         if (dir != null) {
970             return dir;
971         }
972         ValueBinding vb = getValueBinding("dir");
973         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
974     }
975
976     /**
977      * @return the value of lang property
978      */

979     public String JavaDoc getLang() {
980         if (lang != null) {
981             return lang;
982         }
983         ValueBinding vb = getValueBinding("lang");
984         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
985     }
986
987     /**
988      * @return the value of title property
989      */

990     public String JavaDoc getTitle() {
991         if (title != null) {
992             return title;
993         }
994         ValueBinding vb = getValueBinding("title");
995         return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
996     }
997
998     private String JavaDoc renderedOnUserRole = null;
999
1000    /**
1001     * <p>Set the value of the <code>renderedOnUserRole</code> property.</p>
1002     *
1003     * @param renderedOnUserRole
1004     */

1005    public void setRenderedOnUserRole(String JavaDoc renderedOnUserRole) {
1006        this.renderedOnUserRole = renderedOnUserRole;
1007    }
1008
1009    /**
1010     * <p>Return the value of the <code>renderedOnUserRole</code> property.</p>
1011     *
1012     * @return renderedOnUserRole
1013     */

1014    public String JavaDoc getRenderedOnUserRole() {
1015        if (renderedOnUserRole != null) {
1016            return renderedOnUserRole;
1017        }
1018        ValueBinding vb = getValueBinding("renderedOnUserRole");
1019        return vb != null ? (String JavaDoc) vb.getValue(getFacesContext()) : null;
1020    }
1021
1022    private static final boolean DEFAULT_VISIBLE = true;
1023    private Boolean JavaDoc visible = null;
1024
1025    /**
1026     * <p>Set the value of the <code>visible</code> property.</p>
1027     *
1028     * @param visible
1029     */

1030    public void setVisible(boolean visible) {
1031        this.visible = Boolean.valueOf(visible);
1032    }
1033
1034    /**
1035     * <p>Return the value of the <code>visible</code> property.</p>
1036     *
1037     * @return visible
1038     */

1039    public boolean isVisible() {
1040        if (visible != null) {
1041            return visible.booleanValue();
1042        }
1043        ValueBinding vb = getValueBinding("visible");
1044        Boolean JavaDoc boolVal =
1045                vb != null ? (Boolean JavaDoc) vb.getValue(getFacesContext()) : null;
1046        return boolVal != null ? boolVal.booleanValue() : DEFAULT_VISIBLE;
1047    }
1048
1049   
1050    String JavaDoc getContentClass() {
1051        String JavaDoc contentClass = CSS_DEFAULT.PANEL_TAB_CONTENTS_CLASS;
1052        if (getTabPlacement().equalsIgnoreCase(TABPLACEMENT_BOTTOM)) {
1053            contentClass +=CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_BOTTOM;
1054        }
1055        return Util.getQualifiedStyleClass(this,
1056                contentClass);
1057    }
1058    
1059    String JavaDoc getSpacerClass() {
1060        String JavaDoc spacerClass = CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_TABSPACER;
1061        if (getTabPlacement().equalsIgnoreCase(TABPLACEMENT_BOTTOM)) {
1062            spacerClass +=CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_BOTTOM;
1063        }
1064        return Util.getQualifiedStyleClass(this,
1065                spacerClass);
1066    }
1067}
1068
Popular Tags