0001: /*
0002: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
0003: *
0004: * "The contents of this file are subject to the Mozilla Public License
0005: * Version 1.1 (the "License"); you may not use this file except in
0006: * compliance with the License. You may obtain a copy of the License at
0007: * http://www.mozilla.org/MPL/
0008: *
0009: * Software distributed under the License is distributed on an "AS IS"
0010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
0011: * License for the specific language governing rights and limitations under
0012: * the License.
0013: *
0014: * The Original Code is ICEfaces 1.5 open source software code, released
0015: * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
0016: * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
0017: * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
0018: *
0019: * Contributor(s): _____________________.
0020: *
0021: * Alternatively, the contents of this file may be used under the terms of
0022: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
0023: * License), in which case the provisions of the LGPL License are
0024: * applicable instead of those above. If you wish to allow use of your
0025: * version of this file only under the terms of the LGPL License and not to
0026: * allow others to use your version of this file under the MPL, indicate
0027: * your decision by deleting the provisions above and replace them with
0028: * the notice and other provisions required by the LGPL License. If you do
0029: * not delete the provisions above, a recipient may use your version of
0030: * this file under either the MPL or the LGPL License."
0031: *
0032: */
0033: /* Original copyright.
0034: * Copyright 2004 The Apache Software Foundation.
0035: *
0036: * Licensed under the Apache License, Version 2.0 (the "License");
0037: * you may not use this file except in compliance with the License.
0038: * You may obtain a copy of the License at
0039: *
0040: * http://www.apache.org/licenses/LICENSE-2.0
0041: *
0042: * Unless required by applicable law or agreed to in writing, software
0043: * distributed under the License is distributed on an "AS IS" BASIS,
0044: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0045: * See the License for the specific language governing permissions and
0046: * limitations under the License.
0047: */
0048: package com.icesoft.faces.component.paneltabset;
0049:
0050: import com.icesoft.faces.component.CSS_DEFAULT;
0051: import com.icesoft.faces.component.ext.taglib.Util;
0052: import com.icesoft.faces.component.panelseries.UISeries;
0053:
0054: import javax.faces.component.UIComponent;
0055: import javax.faces.component.UIForm;
0056: import javax.faces.component.UINamingContainer;
0057: import javax.faces.context.FacesContext;
0058: import javax.faces.el.EvaluationException;
0059: import javax.faces.el.MethodBinding;
0060: import javax.faces.el.ValueBinding;
0061: import javax.faces.event.AbortProcessingException;
0062: import javax.faces.event.FacesEvent;
0063: import javax.faces.event.FacesListener;
0064: import javax.faces.event.PhaseId;
0065:
0066: import java.util.ArrayList;
0067: import java.util.Iterator;
0068: import java.util.List;
0069:
0070: /**
0071: * <p>PanelTabSet is a JSF component class that represents an ICEfaces tab panel
0072: * container.</p>
0073: * <p/>
0074: * This component extends the ICEfaces UISeries component which is a modified
0075: * implementation of UIData. </p>
0076: * <p/>
0077: * By default the component is rendered by the "com.icesoft.faces.TabbedPane"
0078: * renderer type. </p>
0079: */
0080: public class PanelTabSet extends UISeries {
0081:
0082: /**
0083: * The method binding for a TabChangeListener.
0084: */
0085: private MethodBinding _tabChangeListener = null;
0086:
0087: /* (non-Javadoc)
0088: * @see javax.faces.component.UIComponent#decode(javax.faces.context.FacesContext)
0089: */
0090: public void decode(FacesContext context) {
0091: reconcileListeners();
0092: super .decode(context);
0093: }
0094:
0095: /**
0096: * @param context
0097: * @param phaseId
0098: */
0099: public void applyPhase(FacesContext context, PhaseId phaseId) {
0100: if (context == null) {
0101: throw new NullPointerException(
0102: "Null context in PanelTabSet");
0103: }
0104: // if(phaseId == PhaseId.APPLY_REQUEST_VALUES)
0105: // decode(context);
0106:
0107: int tabIdx = 0;
0108: int selectedIndex = getSelectedIndex();
0109:
0110: if (super .getValue() != null) {
0111: int rowIndex = super .getFirst();
0112: setRowIndex(rowIndex);
0113: int rowsToBeDisplayed = getRows();
0114: int rowsDisplayed = 0;
0115: UIComponent child = getUIComponent((UIComponent) getChildren()
0116: .get(0));
0117: while (isRowAvailable()) {
0118: if (rowsToBeDisplayed > 0
0119: && rowsDisplayed >= rowsToBeDisplayed) {
0120: break;
0121: }
0122:
0123: if (child instanceof PanelTab) {
0124: if (tabIdx == selectedIndex) {
0125: applyPhase(context, child, phaseId);
0126: }
0127: tabIdx++;
0128: }
0129: rowsDisplayed++;
0130: rowIndex++;
0131: setRowIndex(rowIndex);
0132: }
0133: setRowIndex(-1);
0134: } else {
0135:
0136: Iterator it = getFacetsAndChildren();
0137:
0138: while (it.hasNext()) {
0139: UIComponent childOrFacet = getUIComponent((UIComponent) it
0140: .next());
0141: if (childOrFacet instanceof PanelTab) {
0142: if (tabIdx == selectedIndex) {
0143: applyPhase(context, childOrFacet, phaseId);
0144: }
0145: tabIdx++;
0146: } else {
0147: applyPhase(context, childOrFacet, phaseId);
0148: }
0149: }
0150: }
0151:
0152: }
0153:
0154: /**
0155: * @param context
0156: * @param component
0157: * @param phaseId
0158: */
0159: public void applyPhase(FacesContext context, UIComponent component,
0160: PhaseId phaseId) {
0161: if (phaseId == PhaseId.APPLY_REQUEST_VALUES) {
0162: component.processDecodes(context);
0163: } else if (phaseId == PhaseId.PROCESS_VALIDATIONS) {
0164: component.processValidators(context);
0165: } else if (phaseId == PhaseId.UPDATE_MODEL_VALUES) {
0166: component.processUpdates(context);
0167: } else {
0168: throw new IllegalArgumentException();
0169: }
0170: }
0171:
0172: /* (non-Javadoc)
0173: * @see javax.faces.component.UIComponent#processDecodes(javax.faces.context.FacesContext)
0174: */
0175: public void processDecodes(javax.faces.context.FacesContext context) {
0176: if (context == null) {
0177: throw new NullPointerException("context");
0178: }
0179:
0180: if (!isRendered()) {
0181: return;
0182: }
0183:
0184: decode(context);
0185: applyPhase(context, PhaseId.APPLY_REQUEST_VALUES);
0186: }
0187:
0188: /* (non-Javadoc)
0189: * @see javax.faces.component.UIComponent#processValidators(javax.faces.context.FacesContext)
0190: */
0191: public void processValidators(FacesContext context) {
0192:
0193: if (context == null) {
0194: throw new NullPointerException();
0195: }
0196: if (!isRendered()) {
0197: return;
0198: }
0199: applyPhase(context, PhaseId.PROCESS_VALIDATIONS);
0200: }
0201:
0202: /* (non-Javadoc)
0203: * @see javax.faces.component.UIComponent#processUpdates(javax.faces.context.FacesContext)
0204: */
0205: public void processUpdates(FacesContext context) {
0206:
0207: if (context == null) {
0208: throw new NullPointerException();
0209: }
0210: if (!isRendered()) {
0211: return;
0212: }
0213: applyPhase(context, PhaseId.UPDATE_MODEL_VALUES);
0214: }
0215:
0216: private UIComponent getUIComponent(UIComponent uiComponent) {
0217: if (uiComponent instanceof UINamingContainer
0218: || uiComponent instanceof UIForm) {
0219: List children = uiComponent.getChildren();
0220: for (int i = 0, len = children.size(); i < len; i++) {
0221: uiComponent = getUIComponent((UIComponent) children
0222: .get(i));
0223: }
0224: }
0225: return uiComponent;
0226: }
0227:
0228: /**
0229: * @param listener
0230: */
0231: private List listenerList = new ArrayList();
0232:
0233: public void addTabChangeListener(TabChangeListener listener) {
0234: listenerList.add(listener);
0235: addFacesListener(listener);
0236: }
0237:
0238: /**
0239: * @param listener
0240: */
0241: public void removeTabChangeListener(TabChangeListener listener) {
0242: listenerList.remove(listener);
0243: removeFacesListener(listener);
0244: }
0245:
0246: /**
0247: * reconcile TabChangeListeners
0248: */
0249: private void reconcileListeners() {
0250: FacesListener[] listener = getFacesListeners(TabChangeListener.class);
0251: for (int i = 0; i < listener.length; i++) {
0252: super .removeFacesListener(listener[i]);
0253: }
0254: Iterator it = listenerList.iterator();
0255: while (it.hasNext()) {
0256: super .addFacesListener((TabChangeListener) it.next());
0257: }
0258: }
0259:
0260: /**
0261: * @return the tabChangeListener
0262: */
0263: public MethodBinding getTabChangeListener() {
0264: return _tabChangeListener;
0265: }
0266:
0267: /**
0268: * @param tabChangeListener
0269: */
0270: public void setTabChangeListener(MethodBinding tabChangeListener) {
0271: _tabChangeListener = tabChangeListener;
0272: }
0273:
0274: /* (non-Javadoc)
0275: * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
0276: */
0277: public void broadcast(FacesEvent event)
0278: throws AbortProcessingException {
0279: if (event instanceof TabChangeEvent) {
0280: TabChangeEvent tabChangeEvent = (TabChangeEvent) event;
0281: if (tabChangeEvent.getComponent() == this ) {
0282: setSelectedIndex(tabChangeEvent.getNewTabIndex());
0283: //getFacesContext().renderResponse();
0284: }
0285: }
0286:
0287: super .broadcast(event);
0288:
0289: if (event instanceof TabChangeEvent) {
0290: TabChangeEvent tabChangeEvent = (TabChangeEvent) event;
0291: MethodBinding tabChangeListenerBinding = getTabChangeListener();
0292: if (tabChangeListenerBinding != null) {
0293: try {
0294: tabChangeListenerBinding.invoke(getFacesContext(),
0295: new Object[] { tabChangeEvent });
0296: } catch (EvaluationException e) {
0297: Throwable cause = e.getCause();
0298: if (cause != null
0299: && cause instanceof AbortProcessingException) {
0300: throw (AbortProcessingException) cause;
0301: } else {
0302: throw e;
0303: }
0304: }
0305: }
0306: }
0307: }
0308:
0309: /* (non-Javadoc)
0310: * @see javax.faces.component.UIComponent#isRendered()
0311: */
0312: public boolean isRendered() {
0313: if (!Util.isRenderedOnUserRole(this )) {
0314: return false;
0315: }
0316: return super .isRendered();
0317: }
0318:
0319: /**
0320: * The component type.
0321: */
0322: public static final String COMPONENT_TYPE = "com.icesoft.faces.PanelTabSet";
0323: /**
0324: * The component family.
0325: */
0326: public static final String COMPONENT_FAMILY = "javax.faces.Panel";
0327: /**
0328: * The default renderer type.
0329: */
0330: private static final String DEFAULT_RENDERER_TYPE = "com.icesoft.faces.TabbedPane";
0331: /**
0332: * The default selected index.
0333: */
0334: private static final int DEFAULT_SELECTEDINDEX = 0;
0335: /**
0336: * The default tab placement.
0337: */
0338: private final String DEFAULT_TABPLACEMENT = "Top"; // Top, Bottom, Left or Right
0339:
0340: final static String TABPLACEMENT_BOTTOM = "bottom"; //
0341: // default styles
0342:
0343: /**
0344: * The default background color of the tab panels.
0345: */
0346: private static final String DEFAULT_BG_COLOR = "#FFFFFF";
0347: /**
0348: * The current selected tab index.
0349: */
0350: private Integer _selectedIndex = null;
0351: /**
0352: * The current tab placement. <p>At this time only "top" and "bottom" are
0353: * supported.
0354: */
0355: private String _tabPlacement = null;
0356: /**
0357: * The current background color.
0358: */
0359: private String _bgcolor = null;
0360: /**
0361: * The current style.
0362: */
0363: private String _style = null;
0364: /**
0365: * The current style class name.
0366: */
0367: private String _styleClass = null;
0368:
0369: /**
0370: * Creates an instance and sets the default renderer type to
0371: * "com.icesoft.faces.TabbedPane".
0372: */
0373: public PanelTabSet() {
0374: setRendererType(DEFAULT_RENDERER_TYPE);
0375: }
0376:
0377: /* (non-Javadoc)
0378: * @see javax.faces.component.UIComponent#getFamily()
0379: */
0380: public String getFamily() {
0381: return COMPONENT_FAMILY;
0382: }
0383:
0384: /**
0385: * @param selectedIndex
0386: */
0387: void setSelectedIndex(Integer selectedIndex) {
0388: _selectedIndex = selectedIndex;
0389: }
0390:
0391: /**
0392: * @param selectedIndex
0393: */
0394: public void setSelectedIndex(int selectedIndex) {
0395: _selectedIndex = new Integer(selectedIndex);
0396: }
0397:
0398: /**
0399: * @return the value of selectedIndex
0400: */
0401: public int getSelectedIndex() {
0402: if (_selectedIndex != null) {
0403: return _selectedIndex.intValue();
0404: }
0405: ValueBinding vb = getValueBinding("selectedIndex");
0406: Number v = vb != null ? (Number) vb.getValue(getFacesContext())
0407: : null;
0408: return v != null ? v.intValue() : DEFAULT_SELECTEDINDEX;
0409: }
0410:
0411: /**
0412: * @param bgcolor
0413: */
0414: public void setBgcolor(String bgcolor) {
0415: _bgcolor = bgcolor;
0416: }
0417:
0418: /**
0419: * @return the value of bgcolor
0420: */
0421: public String getBgcolor() {
0422: if (_bgcolor != null) {
0423: return _bgcolor;
0424: }
0425: ValueBinding vb = getValueBinding("bgcolor");
0426: return vb != null ? (String) vb.getValue(getFacesContext())
0427: : DEFAULT_BG_COLOR;
0428: }
0429:
0430: private int border = 0;
0431: private boolean border_set = false;
0432:
0433: /**
0434: * <p>Return the value of the <code>border</code> property. Contents:</p><p>
0435: * Width (in pixels) of the border to be drawn around this table. </p>
0436: *
0437: * @return border
0438: */
0439: public int getBorder() {
0440: if (this .border_set) {
0441: return this .border;
0442: }
0443: ValueBinding _vb = getValueBinding("border");
0444: if (_vb != null) {
0445: Object _result = _vb.getValue(getFacesContext());
0446: if (_result == null) {
0447: return 0;
0448: } else {
0449: return ((Integer) _result).intValue();
0450: }
0451: } else {
0452: return this .border;
0453: }
0454: }
0455:
0456: /**
0457: * <p>Set the value of the <code>border</code> property.</p>
0458: *
0459: * @param border
0460: */
0461: public void setBorder(int border) {
0462: this .border = border;
0463: this .border_set = true;
0464: }
0465:
0466: /* (non-Javadoc)
0467: * @see javax.faces.component.html.HtmlPanelGroup#setStyle(java.lang.String)
0468: */
0469: public void setStyle(String style) {
0470: _style = style;
0471: }
0472:
0473: /* (non-Javadoc)
0474: * @see javax.faces.component.html.HtmlPanelGroup#getStyle()
0475: */
0476: public String getStyle() {
0477: if (_style != null) {
0478: return _style;
0479: }
0480: ValueBinding vb = getValueBinding("style");
0481: return vb != null ? (String) vb.getValue(getFacesContext())
0482: : null;
0483: }
0484:
0485: /* (non-Javadoc)
0486: * @see javax.faces.component.html.HtmlPanelGroup#setStyleClass(java.lang.String)
0487: */
0488: public void setStyleClass(String styleClass) {
0489: _styleClass = styleClass;
0490: }
0491:
0492: /* (non-Javadoc)
0493: * @see javax.faces.component.html.HtmlPanelGroup#getStyleClass()
0494: */
0495: public String getStyleClass() {
0496: return Util
0497: .getQualifiedStyleClass(this , _styleClass,
0498: CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_TAB_SET,
0499: "styleClass");
0500: }
0501:
0502: /**
0503: * @param tabPlacement
0504: */
0505: public void setTabPlacement(String tabPlacement) {
0506: _tabPlacement = tabPlacement;
0507: }
0508:
0509: /**
0510: * @return the value of tabPlacement, currently only "top" and "bottom" are
0511: * supported
0512: */
0513: public String getTabPlacement() {
0514: if (_tabPlacement != null) {
0515: return _tabPlacement;
0516: }
0517: ValueBinding vb = getValueBinding("tabPlacement");
0518: return vb != null ? (String) vb.getValue(getFacesContext())
0519: : this .DEFAULT_TABPLACEMENT;
0520: }
0521:
0522: /* (non-Javadoc)
0523: * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
0524: */
0525: public Object saveState(FacesContext context) {
0526: Object values[] = new Object[29];
0527: values[0] = super .saveState(context);
0528: values[1] = _selectedIndex;
0529: values[2] = _bgcolor;
0530: values[3] = saveAttachedState(context, _tabChangeListener);
0531: values[4] = _style;
0532: values[5] = _styleClass;
0533: values[6] = _tabPlacement;
0534: values[7] = onclick;
0535: values[8] = ondblclick;
0536: values[9] = onmousedown;
0537: values[10] = onmouseup;
0538: values[11] = onmouseover;
0539: values[12] = onmousemove;
0540: values[13] = onmouseout;
0541: values[14] = onkeypress;
0542: values[15] = onkeydown;
0543: values[16] = onkeyup;
0544: values[17] = align;
0545: values[18] = new Integer(border);
0546: values[19] = cellpadding;
0547: values[20] = cellspacing;
0548: values[21] = frame;
0549: values[22] = rules;
0550: values[23] = summary;
0551: values[24] = height;
0552: values[25] = width;
0553: values[26] = dir;
0554: values[27] = lang;
0555: values[28] = title;
0556: return ((Object) (values));
0557: }
0558:
0559: /* (non-Javadoc)
0560: * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
0561: */
0562: public void restoreState(FacesContext context, Object state) {
0563: Object values[] = (Object[]) state;
0564: super .restoreState(context, values[0]);
0565: _selectedIndex = (Integer) values[1];
0566: _bgcolor = (String) values[2];
0567: _tabChangeListener = (MethodBinding) restoreAttachedState(
0568: context, values[3]);
0569: _style = (String) values[4];
0570: _styleClass = (String) values[5];
0571: _tabPlacement = (String) values[6];
0572: onclick = (String) values[7];
0573: ondblclick = (String) values[8];
0574: onmousedown = (String) values[9];
0575: onmouseup = (String) values[10];
0576: onmouseover = (String) values[11];
0577: onmousemove = (String) values[12];
0578: onmouseout = (String) values[13];
0579: onkeypress = (String) values[14];
0580: onkeydown = (String) values[15];
0581: onkeyup = (String) values[16];
0582: align = (String) values[17];
0583: border = ((Integer) values[18]).intValue();
0584: cellpadding = (String) values[19];
0585: cellspacing = (String) values[20];
0586: frame = (String) values[21];
0587: rules = (String) values[22];
0588: summary = (String) values[23];
0589: height = (String) values[24];
0590: width = (String) values[25];
0591: dir = (String) values[26];
0592: lang = (String) values[27];
0593: title = (String) values[28];
0594: }
0595:
0596: private String onclick;
0597: private String ondblclick;
0598: private String onmousedown = null;
0599: private String onmouseup = null;
0600: private String onmouseover = null;
0601: private String onmousemove = null;
0602: private String onmouseout = null;
0603: private String onkeypress = null;
0604: private String onkeydown = null;
0605: private String onkeyup = null;
0606: private String align = null;
0607: private String cellpadding = null;
0608: private String cellspacing = null;
0609: private String frame = null;
0610: private String rules = null;
0611: private String summary = null;
0612: private String height = null;
0613: private String width = null;
0614: private String dir = null;
0615: private String lang = null;
0616: private String title = null;
0617:
0618: /**
0619: * @param align
0620: */
0621: public void setAlign(String align) {
0622: this .align = align;
0623: }
0624:
0625: /* (non-Javadoc)
0626: * @see javax.faces.component.html.HtmlDataTable#setCellpadding(java.lang.String)
0627: */
0628: public void setCellpadding(String cellpadding) {
0629: this .cellpadding = cellpadding;
0630: }
0631:
0632: /* (non-Javadoc)
0633: * @see javax.faces.component.html.HtmlDataTable#setCellspacing(java.lang.String)
0634: */
0635: public void setCellspacing(String cellspacing) {
0636: this .cellspacing = cellspacing;
0637: }
0638:
0639: /* (non-Javadoc)
0640: * @see javax.faces.component.html.HtmlDataTable#setFrame(java.lang.String)
0641: */
0642: public void setFrame(String frame) {
0643: this .frame = frame;
0644: }
0645:
0646: /**
0647: * @param height
0648: */
0649: public void setHeight(String height) {
0650: this .height = height;
0651: }
0652:
0653: /* (non-Javadoc)
0654: * @see javax.faces.component.html.HtmlDataTable#setOnclick(java.lang.String)
0655: */
0656: public void setOnclick(String onclick) {
0657: this .onclick = onclick;
0658: }
0659:
0660: /* (non-Javadoc)
0661: * @see javax.faces.component.html.HtmlDataTable#setOndblclick(java.lang.String)
0662: */
0663: public void setOndblclick(String ondblclick) {
0664: this .ondblclick = ondblclick;
0665: }
0666:
0667: /* (non-Javadoc)
0668: * @see javax.faces.component.html.HtmlDataTable#setOnkeydown(java.lang.String)
0669: */
0670: public void setOnkeydown(String onkeydown) {
0671: this .onkeydown = onkeydown;
0672: }
0673:
0674: /* (non-Javadoc)
0675: * @see javax.faces.component.html.HtmlDataTable#setOnkeypress(java.lang.String)
0676: */
0677: public void setOnkeypress(String onkeypress) {
0678: this .onkeypress = onkeypress;
0679: }
0680:
0681: /* (non-Javadoc)
0682: * @see javax.faces.component.html.HtmlDataTable#setOnkeyup(java.lang.String)
0683: */
0684: public void setOnkeyup(String onkeyup) {
0685: this .onkeyup = onkeyup;
0686: }
0687:
0688: /* (non-Javadoc)
0689: * @see javax.faces.component.html.HtmlDataTable#setOnmousedown(java.lang.String)
0690: */
0691: public void setOnmousedown(String onmousedown) {
0692: this .onmousedown = onmousedown;
0693: }
0694:
0695: /* (non-Javadoc)
0696: * @see javax.faces.component.html.HtmlDataTable#setOnmousemove(java.lang.String)
0697: */
0698: public void setOnmousemove(String onmousemove) {
0699: this .onmousemove = onmousemove;
0700: }
0701:
0702: /* (non-Javadoc)
0703: * @see javax.faces.component.html.HtmlDataTable#setOnmouseout(java.lang.String)
0704: */
0705: public void setOnmouseout(String onmouseout) {
0706: this .onmouseout = onmouseout;
0707: }
0708:
0709: /* (non-Javadoc)
0710: * @see javax.faces.component.html.HtmlDataTable#setOnmouseover(java.lang.String)
0711: */
0712: public void setOnmouseover(String onmouseover) {
0713: this .onmouseover = onmouseover;
0714: }
0715:
0716: /* (non-Javadoc)
0717: * @see javax.faces.component.html.HtmlDataTable#setOnmouseup(java.lang.String)
0718: */
0719: public void setOnmouseup(String onmouseup) {
0720: this .onmouseup = onmouseup;
0721: }
0722:
0723: /* (non-Javadoc)
0724: * @see javax.faces.component.html.HtmlDataTable#setRules(java.lang.String)
0725: */
0726: public void setRules(String rules) {
0727: this .rules = rules;
0728: }
0729:
0730: /* (non-Javadoc)
0731: * @see javax.faces.component.html.HtmlDataTable#setSummary(java.lang.String)
0732: */
0733: public void setSummary(String summary) {
0734: this .summary = summary;
0735: }
0736:
0737: /* (non-Javadoc)
0738: * @see javax.faces.component.html.HtmlDataTable#setWidth(java.lang.String)
0739: */
0740: public void setWidth(String width) {
0741: this .width = width;
0742: }
0743:
0744: /* (non-Javadoc)
0745: * @see javax.faces.component.html.HtmlDataTable#setDir(java.lang.String)
0746: */
0747: public void setDir(String dir) {
0748: this .dir = dir;
0749: }
0750:
0751: /* (non-Javadoc)
0752: * @see javax.faces.component.html.HtmlDataTable#setLang(java.lang.String)
0753: */
0754: public void setLang(String lang) {
0755: this .lang = lang;
0756: }
0757:
0758: /* (non-Javadoc)
0759: * @see javax.faces.component.html.HtmlDataTable#setTitle(java.lang.String)
0760: */
0761: public void setTitle(String title) {
0762: this .title = title;
0763: }
0764:
0765: /**
0766: * @return the value of onclick property
0767: */
0768: public String getOnclick() {
0769: if (onclick != null) {
0770: return onclick;
0771: }
0772: ValueBinding vb = getValueBinding("onclick");
0773: return vb != null ? (String) vb.getValue(getFacesContext())
0774: : null;
0775: }
0776:
0777: /**
0778: * @return the value of ondblclick property
0779: */
0780: public String getOndblclick() {
0781: if (ondblclick != null) {
0782: return ondblclick;
0783: }
0784: ValueBinding vb = getValueBinding("ondblclick");
0785: return vb != null ? (String) vb.getValue(getFacesContext())
0786: : null;
0787: }
0788:
0789: /**
0790: * @return the value of onmousedown property
0791: */
0792: public String getOnmousedown() {
0793: if (onmousedown != null) {
0794: return onmousedown;
0795: }
0796: ValueBinding vb = getValueBinding("onmousedown");
0797: return vb != null ? (String) vb.getValue(getFacesContext())
0798: : null;
0799: }
0800:
0801: /**
0802: * @return the value of onmouseup property
0803: */
0804: public String getOnmouseup() {
0805: if (onmouseup != null) {
0806: return onmouseup;
0807: }
0808: ValueBinding vb = getValueBinding("onmouseup");
0809: return vb != null ? (String) vb.getValue(getFacesContext())
0810: : null;
0811: }
0812:
0813: /**
0814: * @return the value of onmouseover property
0815: */
0816: public String getOnmouseover() {
0817: if (onmouseover != null) {
0818: return onmouseover;
0819: }
0820: ValueBinding vb = getValueBinding("onmouseover");
0821: return vb != null ? (String) vb.getValue(getFacesContext())
0822: : null;
0823: }
0824:
0825: /**
0826: * @return the value of onmousemove property
0827: */
0828: public String getOnmousemove() {
0829: if (onmousemove != null) {
0830: return onmousemove;
0831: }
0832: ValueBinding vb = getValueBinding("onmousemove");
0833: return vb != null ? (String) vb.getValue(getFacesContext())
0834: : null;
0835: }
0836:
0837: /**
0838: * @return the value of onmouseout property
0839: */
0840: public String getOnmouseout() {
0841: if (onmouseout != null) {
0842: return onmouseout;
0843: }
0844: ValueBinding vb = getValueBinding("onmouseout");
0845: return vb != null ? (String) vb.getValue(getFacesContext())
0846: : null;
0847: }
0848:
0849: /**
0850: * @return the value of onkeypress property
0851: */
0852: public String getOnkeypress() {
0853: if (onkeypress != null) {
0854: return onkeypress;
0855: }
0856: ValueBinding vb = getValueBinding("onkeypress");
0857: return vb != null ? (String) vb.getValue(getFacesContext())
0858: : null;
0859: }
0860:
0861: /**
0862: * @return the value of onkeydown property
0863: */
0864: public String getOnkeydown() {
0865: if (onkeydown != null) {
0866: return onkeydown;
0867: }
0868: ValueBinding vb = getValueBinding("onkeydown");
0869: return vb != null ? (String) vb.getValue(getFacesContext())
0870: : null;
0871: }
0872:
0873: /**
0874: * @return the value of onkeyup property
0875: */
0876: public String getOnkeyup() {
0877: if (onkeyup != null) {
0878: return onkeyup;
0879: }
0880: ValueBinding vb = getValueBinding("onkeyup");
0881: return vb != null ? (String) vb.getValue(getFacesContext())
0882: : null;
0883: }
0884:
0885: /**
0886: * @return the value of align property
0887: */
0888: public String getAlign() {
0889: if (align != null) {
0890: return align;
0891: }
0892: ValueBinding vb = getValueBinding("align");
0893: return vb != null ? (String) vb.getValue(getFacesContext())
0894: : null;
0895: }
0896:
0897: /**
0898: * @return the value of cellpadding property
0899: */
0900: public String getCellpadding() {
0901: if (cellpadding != null) {
0902: return cellpadding;
0903: }
0904: ValueBinding vb = getValueBinding("cellpadding");
0905: return vb != null ? (String) vb.getValue(getFacesContext())
0906: : null;
0907: }
0908:
0909: /**
0910: * @return the value of cellspacing property
0911: */
0912: public String getCellspacing() {
0913: if (cellspacing != null) {
0914: return cellspacing;
0915: }
0916: ValueBinding vb = getValueBinding("cellspacing");
0917: return vb != null ? (String) vb.getValue(getFacesContext())
0918: : null;
0919: }
0920:
0921: /**
0922: * @return the value of frame property
0923: */
0924: public String getFrame() {
0925: if (frame != null) {
0926: return frame;
0927: }
0928: ValueBinding vb = getValueBinding("frame");
0929: return vb != null ? (String) vb.getValue(getFacesContext())
0930: : null;
0931: }
0932:
0933: /**
0934: * @return the value of rules property
0935: */
0936: public String getRules() {
0937: if (rules != null) {
0938: return rules;
0939: }
0940: ValueBinding vb = getValueBinding("rules");
0941: return vb != null ? (String) vb.getValue(getFacesContext())
0942: : null;
0943: }
0944:
0945: /**
0946: * @return the value of summary property
0947: */
0948: public String getSummary() {
0949: if (summary != null) {
0950: return summary;
0951: }
0952: ValueBinding vb = getValueBinding("summary");
0953: return vb != null ? (String) vb.getValue(getFacesContext())
0954: : null;
0955: }
0956:
0957: /**
0958: * @return the value of height property
0959: */
0960: public String getHeight() {
0961: if (height != null) {
0962: return height;
0963: }
0964: ValueBinding vb = getValueBinding("height");
0965: return vb != null ? (String) vb.getValue(getFacesContext())
0966: : null;
0967: }
0968:
0969: /**
0970: * @return the value of width property
0971: */
0972: public String getWidth() {
0973: if (width != null) {
0974: return width;
0975: }
0976: ValueBinding vb = getValueBinding("width");
0977: return vb != null ? (String) vb.getValue(getFacesContext())
0978: : null;
0979: }
0980:
0981: /**
0982: * @return the value of dir property
0983: */
0984: public String getDir() {
0985: if (dir != null) {
0986: return dir;
0987: }
0988: ValueBinding vb = getValueBinding("dir");
0989: return vb != null ? (String) vb.getValue(getFacesContext())
0990: : null;
0991: }
0992:
0993: /**
0994: * @return the value of lang property
0995: */
0996: public String getLang() {
0997: if (lang != null) {
0998: return lang;
0999: }
1000: ValueBinding vb = getValueBinding("lang");
1001: return vb != null ? (String) vb.getValue(getFacesContext())
1002: : null;
1003: }
1004:
1005: /**
1006: * @return the value of title property
1007: */
1008: public String getTitle() {
1009: if (title != null) {
1010: return title;
1011: }
1012: ValueBinding vb = getValueBinding("title");
1013: return vb != null ? (String) vb.getValue(getFacesContext())
1014: : null;
1015: }
1016:
1017: private String renderedOnUserRole = null;
1018:
1019: /**
1020: * <p>Set the value of the <code>renderedOnUserRole</code> property.</p>
1021: *
1022: * @param renderedOnUserRole
1023: */
1024: public void setRenderedOnUserRole(String renderedOnUserRole) {
1025: this .renderedOnUserRole = renderedOnUserRole;
1026: }
1027:
1028: /**
1029: * <p>Return the value of the <code>renderedOnUserRole</code> property.</p>
1030: *
1031: * @return renderedOnUserRole
1032: */
1033: public String getRenderedOnUserRole() {
1034: if (renderedOnUserRole != null) {
1035: return renderedOnUserRole;
1036: }
1037: ValueBinding vb = getValueBinding("renderedOnUserRole");
1038: return vb != null ? (String) vb.getValue(getFacesContext())
1039: : null;
1040: }
1041:
1042: private static final boolean DEFAULT_VISIBLE = true;
1043: private Boolean visible = null;
1044:
1045: /**
1046: * <p>Set the value of the <code>visible</code> property.</p>
1047: *
1048: * @param visible
1049: */
1050: public void setVisible(boolean visible) {
1051: this .visible = Boolean.valueOf(visible);
1052: }
1053:
1054: /**
1055: * <p>Return the value of the <code>visible</code> property.</p>
1056: *
1057: * @return visible
1058: */
1059: public boolean isVisible() {
1060: if (visible != null) {
1061: return visible.booleanValue();
1062: }
1063: ValueBinding vb = getValueBinding("visible");
1064: Boolean boolVal = vb != null ? (Boolean) vb
1065: .getValue(getFacesContext()) : null;
1066: return boolVal != null ? boolVal.booleanValue()
1067: : DEFAULT_VISIBLE;
1068: }
1069:
1070: String getContentClass() {
1071: String contentClass = CSS_DEFAULT.PANEL_TAB_CONTENTS_CLASS;
1072: if (getTabPlacement().equalsIgnoreCase(TABPLACEMENT_BOTTOM)) {
1073: contentClass += CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_BOTTOM;
1074: }
1075: return Util.getQualifiedStyleClass(this , contentClass);
1076: }
1077:
1078: String getSpacerClass() {
1079: String spacerClass = CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_TABSPACER;
1080: if (getTabPlacement().equalsIgnoreCase(TABPLACEMENT_BOTTOM)) {
1081: spacerClass += CSS_DEFAULT.PANEL_TAB_SET_DEFAULT_BOTTOM;
1082: }
1083: return Util.getQualifiedStyleClass(this, spacerClass);
1084: }
1085: }
|