KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > collection > header > MultiLevelHeader


1 /*
2  * Created on 18 févr. 2005
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */

7 package fr.improve.struts.taglib.layout.collection.header;
8
9 import java.util.ArrayList JavaDoc;
10 import java.util.List JavaDoc;
11
12 /**
13  * @author JN RIBETTE
14  */

15 public class MultiLevelHeader {
16     protected String JavaDoc title;
17     protected String JavaDoc arg0;
18     protected String JavaDoc arg1;
19     protected String JavaDoc styleClass;
20     protected List JavaDoc childHeaders;
21     
22     protected String JavaDoc tooltip;
23     
24     protected int colSpan = 0;
25     protected int level = 0;
26     
27     protected String JavaDoc sortProperty;
28     protected String JavaDoc width;
29     
30     public MultiLevelHeader(String JavaDoc in_title, String JavaDoc in_arg0, String JavaDoc in_arg1, String JavaDoc in_styleClass, boolean in_lastLevel) {
31         title = in_title;
32         arg0 = in_arg0;
33         arg1 = in_arg1;
34         styleClass = in_styleClass;
35         colSpan = in_lastLevel?1:0;
36         if (in_title==null) {
37             // Skip null titles.
38
level = -1;
39         }
40     }
41     
42     public void setSortProperty(String JavaDoc in_sortProperty) {
43         sortProperty = in_sortProperty;
44     }
45     public void setWidth(String JavaDoc in_width) {
46         width = in_width;
47     }
48     
49     public String JavaDoc getTitle() {
50         return title;
51     }
52     
53     public int getColSpan() {
54         return colSpan;
55     }
56     
57     public int getLevel() {
58         return level;
59     }
60     
61     public String JavaDoc getStyleClass() {
62         return styleClass;
63     }
64     
65     public String JavaDoc getArg0() {
66         return arg0;
67     }
68     public String JavaDoc getArg1() {
69         return arg1;
70     }
71     
72     public String JavaDoc getSortProperty() {
73         return sortProperty;
74     }
75     public String JavaDoc getWidth() {
76         return width;
77     }
78     
79     public List JavaDoc getChildHeaders() {
80         return childHeaders;
81     }
82     public String JavaDoc getTooltip() {
83         return tooltip;
84     }
85     public void setTooltip(String JavaDoc tooltip) {
86         this.tooltip = tooltip;
87     }
88     
89     public void addHeader(MultiLevelHeader in_header) {
90         if (childHeaders==null) {
91             childHeaders = new ArrayList JavaDoc();
92         }
93         level = Math.max(level, in_header.getLevel()+1);
94         childHeaders.add(in_header);
95         colSpan += in_header.getColSpan();
96     }
97 }
98
Popular Tags