001: /*
002: * Copyright 2005 jWic group (http://www.jwic.de)
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: * de.jwic.controls.layout.Cell
017: * Created on 04.11.2005
018: * $Id: Cell.java,v 1.2 2006/08/14 09:35:00 lordsam Exp $
019: */
020: package de.jwic.controls.layout;
021:
022: import java.io.Serializable;
023:
024: /**
025: * Specifies the cell in a table.
026: * @author Florian Lippisch
027: * @version $Revision: 1.2 $
028: */
029: public class Cell implements Serializable {
030:
031: private static final long serialVersionUID = 1L;
032:
033: private String width = "";
034: private String controlName = "";
035: private int rowNum = 0;
036: private int colNum = 0;
037: private boolean render = true;
038:
039: private TableData tableData = null;
040:
041: /**
042: * Default Constructor.
043: * @param rowNum
044: * @param colNum
045: */
046: public Cell(int rowNum, int colNum) {
047: this .rowNum = rowNum;
048: this .colNum = colNum;
049: }
050:
051: /**
052: * Default Constructor.
053: * @param rowNum
054: * @param colNum
055: */
056: public Cell(int rowNum, int colNum, TableData td) {
057: this .rowNum = rowNum;
058: this .colNum = colNum;
059: this .tableData = td;
060: }
061:
062: /**
063: * @return Returns the colNum.
064: */
065: public int getColNum() {
066: return colNum;
067: }
068:
069: /**
070: * @param colNum The colNum to set.
071: */
072: public void setColNum(int colNum) {
073: this .colNum = colNum;
074: }
075:
076: /**
077: * @return Returns the controlName.
078: */
079: public String getControlName() {
080: return controlName;
081: }
082:
083: /**
084: * @param controlName The controlName to set.
085: */
086: public void setControlName(String controlName) {
087: this .controlName = controlName;
088: }
089:
090: /**
091: * @return Returns the rowNum.
092: */
093: public int getRowNum() {
094: return rowNum;
095: }
096:
097: /**
098: * @param rowNum The rowNum to set.
099: */
100: public void setRowNum(int rowNum) {
101: this .rowNum = rowNum;
102: }
103:
104: /**
105: * @return Returns the width.
106: */
107: public String getWidth() {
108: return width;
109: }
110:
111: /**
112: * @param width The width to set.
113: */
114: public void setWidth(String width) {
115: this .width = width;
116: }
117:
118: /**
119: * @return Returns the colSpan.
120: */
121: public int getColSpan() {
122: return tableData != null ? tableData.getColSpan() : 1;
123: }
124:
125: /**
126: * @return Returns the rowSpan.
127: */
128: public int getRowSpan() {
129: return tableData != null ? tableData.getRowSpan() : 1;
130: }
131:
132: /**
133: * @return Returns the render.
134: */
135: public boolean isRender() {
136: return render;
137: }
138:
139: /**
140: * @param render The render to set.
141: */
142: public void setRender(boolean render) {
143: this .render = render;
144: }
145:
146: /**
147: * @return Returns the align.
148: */
149: public String getAlign() {
150: return tableData != null ? tableData.getAlign() : "";
151: }
152:
153: /**
154: * @return Returns the vAlign.
155: */
156: public String getVAlign() {
157: return tableData != null ? tableData.getVAlign() : "";
158: }
159:
160: /**
161: * Returns the CSS class for the cell (td tag).
162: * @return
163: */
164: public String getCSSClass() {
165: return tableData != null ? tableData.getCSSClass() : "";
166: }
167:
168: }
|