01: package com.xoetrope.carousel.survey;
02:
03: import javax.swing.DefaultCellEditor;
04: import javax.swing.JCheckBox;
05: import javax.swing.JTextField;
06: import javax.swing.JComboBox;
07:
08: /**
09: *
10: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
11: * the GNU Public License (GPL), please see license.txt for more details. If
12: * you make commercial use of this software you must purchase a commercial
13: * license from Xoetrope.</p>
14: * <p> $Revision: 1.5 $</p>
15: */
16: public class XTableColumn {
17: protected String columnName;
18: protected int width;
19: protected int alignment;
20: protected DefaultCellEditor cellEditor;
21: protected boolean isActive;
22:
23: public XTableColumn(String cn, int w, int a, JComboBox ce) {
24: this (cn, w, a);
25: if (ce != null)
26: cellEditor = new DefaultCellEditor(ce);
27: isActive = true;
28: }
29:
30: public XTableColumn(String cn, int w, int a, JTextField te) {
31: this (cn, w, a);
32: if (te != null)
33: cellEditor = new DefaultCellEditor(te);
34: isActive = true;
35: }
36:
37: public XTableColumn(String cn, int w, int a, JCheckBox te) {
38: this (cn, w, a);
39: if (te != null)
40: cellEditor = new DefaultCellEditor(te);
41: isActive = true;
42: }
43:
44: public XTableColumn(String cn, int w, int a) {
45: columnName = cn;
46: width = w;
47: alignment = a;
48: cellEditor = null;
49: isActive = true;
50: }
51:
52: public String getName() {
53: return columnName;
54: }
55:
56: public int getWidth() {
57: return width;
58: }
59:
60: public int getAlignment() {
61: return alignment;
62: }
63:
64: public DefaultCellEditor getCellEditor() {
65: return cellEditor;
66: }
67:
68: public boolean isActive() {
69: return isActive;
70: }
71:
72: public void setActive(boolean state) {
73: isActive = state;
74: }
75:
76: }
|