001: /*
002: * This file is part of the WfMOpen project.
003: * Copyright (C) 2001-2005 Danet GmbH (www.danet.de), BU BTS.
004: * All rights reserved.
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * $Id: HtmlPanelGrid.java,v 1.3 2007/03/27 21:59:43 mlipp Exp $
021: *
022: * $Log: HtmlPanelGrid.java,v $
023: * Revision 1.3 2007/03/27 21:59:43 mlipp
024: * Fixed lots of checkstyle warnings.
025: *
026: * Revision 1.2 2006/09/29 12:32:09 drmlipp
027: * Consistently using WfMOpen as projct name now.
028: *
029: * Revision 1.1 2006/09/14 22:06:30 mlipp
030: * Implemented extended panel grid.
031: *
032: */
033: package de.danet.an.util.jsf.taglib;
034:
035: import javax.faces.context.FacesContext;
036: import javax.faces.el.ValueBinding;
037:
038: import org.apache.myfaces.shared_tomahawk.util._ComponentUtils;
039:
040: /**
041: * This class provides a panel grid with additional attributes.
042: *
043: * @author Michael Lipp
044: *
045: */
046: public class HtmlPanelGrid extends
047: org.apache.myfaces.component.html.ext.HtmlPanelGrid {
048:
049: public static final String COMPONENT_TYPE = "de.danet.bts.HtmlPanelGrid";
050:
051: private String cellAlign = null;
052: private String cellVAlign = null;
053:
054: /**
055: * @param cellAlign The cellAlign to set.
056: */
057: public void setCellAlign(String cellAlign) {
058: this .cellAlign = cellAlign;
059: }
060:
061: /**
062: * @return Returns the cellAlign.
063: */
064: public String getCellAlign() {
065: if (cellAlign != null) {
066: return cellAlign;
067: }
068: ValueBinding vb = getValueBinding("cellAlign");
069: return vb != null ? _ComponentUtils.getStringValue(
070: getFacesContext(), vb) : null;
071: }
072:
073: /**
074: * @param cellVAlign The cellVAlign to set.
075: */
076: public void setCellVAlign(String cellVAlign) {
077: this .cellVAlign = cellVAlign;
078: }
079:
080: /**
081: * @return Returns the cellVAlign.
082: */
083: public String getCellVAlign() {
084: if (cellVAlign != null) {
085: return cellVAlign;
086: }
087: ValueBinding vb = getValueBinding("cellVAlign");
088: return vb != null ? _ComponentUtils.getStringValue(
089: getFacesContext(), vb) : null;
090: }
091:
092: public Object saveState(FacesContext context) {
093: Object[] values = new Object[3];
094: values[0] = super .saveState(context);
095: values[1] = cellAlign;
096: values[2] = cellVAlign;
097: return ((Object) (values));
098: }
099:
100: public void restoreState(FacesContext context, Object state) {
101: Object[] values = (Object[]) state;
102: super .restoreState(context, values[0]);
103: cellAlign = (String) values[1];
104: cellVAlign = (String) values[2];
105: }
106:
107: }
|