KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > table > WebTableColumn


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.components.table;
6
7 import com.opensymphony.webwork.components.table.renderer.CellRenderer;
8 import com.opensymphony.webwork.components.table.renderer.DefaultCellRenderer;
9
10
11 /**
12  * @author $author$
13  * @version $Revision: 1.1 $
14  */

15 public class WebTableColumn {
16     //~ Static fields/initializers /////////////////////////////////////////////
17

18     static final private CellRenderer DEFAULT_RENDERER = new DefaultCellRenderer();
19
20     //~ Instance fields ////////////////////////////////////////////////////////
21

22     CellRenderer _renderer = null;
23     String JavaDoc _displayName = null;
24     String JavaDoc _name = null;
25     boolean _hidden = false;
26     int _offset = -1;
27
28     //~ Constructors ///////////////////////////////////////////////////////////
29

30     public WebTableColumn(String JavaDoc name, int offset) {
31         _name = name;
32         _offset = offset;
33         _displayName = name;
34         _renderer = DEFAULT_RENDERER;
35     }
36
37     //~ Methods ////////////////////////////////////////////////////////////////
38

39     public void setDisplayName(String JavaDoc displayName) {
40         _displayName = displayName;
41     }
42
43     public String JavaDoc getDisplayName() {
44         return (_displayName);
45     }
46
47     public void setHidden(boolean hidden) {
48         _hidden = hidden;
49     }
50
51     public boolean isHidden() {
52         return _hidden;
53     }
54
55     public String JavaDoc getName() {
56         return (_name);
57     }
58
59     public int getOffset() {
60         return (_offset);
61     }
62
63     public void setRenderer(CellRenderer renderer) {
64         _renderer = renderer;
65     }
66
67     public CellRenderer getRenderer() {
68         return (_renderer);
69     }
70
71     public boolean isVisible() {
72         return !isHidden();
73     }
74 }
75
Popular Tags