01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.components.table;
06:
07: import com.opensymphony.webwork.components.table.renderer.CellRenderer;
08: import com.opensymphony.webwork.components.table.renderer.DefaultCellRenderer;
09:
10: /**
11: * @author $author$
12: * @version $Revision: 1282 $
13: */
14: public class WebTableColumn {
15:
16: static final private CellRenderer DEFAULT_RENDERER = new DefaultCellRenderer();
17:
18: CellRenderer _renderer = null;
19: String _displayName = null;
20: String _name = null;
21: boolean _hidden = false;
22: int _offset = -1;
23:
24: public WebTableColumn(String name, int offset) {
25: _name = name;
26: _offset = offset;
27: _displayName = name;
28: _renderer = DEFAULT_RENDERER;
29: }
30:
31: public void setDisplayName(String displayName) {
32: _displayName = displayName;
33: }
34:
35: public String getDisplayName() {
36: return (_displayName);
37: }
38:
39: public void setHidden(boolean hidden) {
40: _hidden = hidden;
41: }
42:
43: public boolean isHidden() {
44: return _hidden;
45: }
46:
47: public String getName() {
48: return (_name);
49: }
50:
51: public int getOffset() {
52: return (_offset);
53: }
54:
55: public void setRenderer(CellRenderer renderer) {
56: _renderer = renderer;
57: }
58:
59: public CellRenderer getRenderer() {
60: return (_renderer);
61: }
62:
63: public boolean isVisible() {
64: return !isHidden();
65: }
66: }
|