KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > datagrid > ColumnType


1 package fr.improve.struts.taglib.layout.datagrid;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6 /**
7  * Defines a column type.
8  *
9  * @author dev
10  */

11 public class ColumnType {
12     /**
13      * Input text column type.
14      */

15     public static final ColumnType TEXT = new ColumnType("text");
16     
17     /**
18      * Checkbox column type.
19      */

20     public static final ColumnType CHECKBOX = new ColumnType("checkbox");
21     
22     /**
23      * Radio column type.
24      */

25     public static final ColumnType RADIO = new ColumnType("radio");
26     
27     /**
28      * Select column type.
29      */

30     static final String JavaDoc SELECT = "select";
31     
32     /**
33      * Empty column type.
34      */

35     static final String JavaDoc EMPTY = "empty";
36     
37     /**
38      * Select column type (use the javascript attribute).
39      */

40     static ColumnType select() {
41         ColumnType type = new ColumnType(SELECT);
42         type.values = new ArrayList JavaDoc();
43         return type;
44     }
45     
46     /**
47      * Empty column type (use the value attribute).
48      */

49     static ColumnType empty() {
50         ColumnType type = new ColumnType(EMPTY);
51         return type;
52     }
53     
54     private String JavaDoc type;
55     private List JavaDoc values;
56     private String JavaDoc javascript;
57     
58     private ColumnType(String JavaDoc in_type) {
59         type = in_type;
60     }
61     
62     public String JavaDoc getType() {
63         return type;
64     }
65     
66     public List JavaDoc getValues() {
67         return values;
68     }
69     
70     public void setValues(List JavaDoc in_values) {
71         values =in_values;
72     }
73
74     public String JavaDoc getJavascript() {
75         return javascript;
76     }
77
78     public void setJavascript(String JavaDoc javascript) {
79         this.javascript = javascript;
80     }
81 }
82
Popular Tags