01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.comp.ui;
15:
16: import org.itsnat.comp.ui.ItsNatTableCellUI;
17: import org.itsnat.comp.ui.ItsNatTableUI;
18: import org.itsnat.impl.core.domutil.TableCellElementInfoMasterImpl;
19: import org.w3c.dom.Element;
20:
21: /**
22: *
23: * @author jmarranz
24: */
25: public class ItsNatTableCellUIImpl implements ItsNatTableCellUI {
26: protected TableCellElementInfoMasterImpl cellInfo;
27: protected ItsNatTableUIImpl tableUI;
28:
29: /**
30: * Creates a new instance of ItsNatListCellUIImpl
31: */
32: protected ItsNatTableCellUIImpl(
33: TableCellElementInfoMasterImpl cellInfo,
34: ItsNatTableUIImpl tableUI) {
35: this .cellInfo = cellInfo;
36: this .tableUI = tableUI;
37: }
38:
39: public static ItsNatTableCellUIImpl getItsNatTableCellUI(
40: TableCellElementInfoMasterImpl cellInfo,
41: ItsNatTableUIImpl tableUI) {
42: if (cellInfo == null)
43: return null;
44:
45: ItsNatTableCellUIImpl cellUI = (ItsNatTableCellUIImpl) cellInfo
46: .getAuxObject();
47: if (cellUI == null) {
48: cellUI = new ItsNatTableCellUIImpl(cellInfo, tableUI);
49: cellInfo.setAuxObject(cellUI);
50: }
51: return cellUI;
52: }
53:
54: public ItsNatTableUI getItsNatTableUI() {
55: return tableUI;
56: }
57:
58: public Element getRowElement() {
59: return cellInfo.getRowElement();
60: }
61:
62: public int getRowIndex() {
63: return cellInfo.getRowIndex();
64: }
65:
66: public Element getCellElement() {
67: return cellInfo.getCellElement();
68: }
69:
70: public int getColumnIndex() {
71: return cellInfo.getColumnIndex();
72: }
73:
74: public Element getCellContentElement() {
75: return tableUI.getCellContentElementAt(getRowIndex(),
76: getColumnIndex());
77: }
78:
79: public boolean containsUserValueName(String name) {
80: return cellInfo.containsUserValueName(name);
81: }
82:
83: public Object getUserValue(String name) {
84: return cellInfo.getUserValue(name);
85: }
86:
87: public Object setUserValue(String name, Object value) {
88: return cellInfo.setUserValue(name, value);
89: }
90:
91: public Object removeUserValue(String name) {
92: return cellInfo.removeUserValue(name);
93: }
94:
95: public String[] getUserValueNames() {
96: return cellInfo.getUserValueNames();
97: }
98:
99: }
|