KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > util > NoColumnCollection


1 package fr.improve.struts.taglib.layout.util;
2
3
4 /**
5  * Modification of the BasicCollection implementation of CollectionInterface.
6  * This version does not display collection headers.
7  *
8  * @author: Jean-NoŽl Ribette
9  */

10 public class NoColumnCollection extends BasicCollection {
11
12     /**
13      * Prepare to display the headers: do nothing.
14      */

15     public void doStartHeaders(StringBuffer JavaDoc out_buffer) {
16         // Do nothing.
17
}
18     /**
19      * Display a header : do nothing.
20      */

21     public void doPrintHeader(StringBuffer JavaDoc out_buffer, String JavaDoc in_header, String JavaDoc in_width, String JavaDoc in_sortUrl) {
22         // Do nothing.
23
}
24     
25     /**
26      * Finish to render the headers : no nothing.
27      */

28     public void doEndHeaders(StringBuffer JavaDoc out_buffer) {
29         // Do nothing.
30
}
31     
32     public void doStartItems(StringBuffer JavaDoc out_buffer) {
33         // Do nothing.
34
}
35     
36     /**
37      * Render an element in the line.
38      */

39     public void doPrintItem(StringBuffer JavaDoc out_buffer, String JavaDoc in_item, String JavaDoc[] in_styleClass, String JavaDoc in_id) {
40         out_buffer.append("<li");
41         if (in_styleClass[0] != null) {
42             out_buffer.append(" class=\"");
43             out_buffer.append(in_styleClass[0]);
44             out_buffer.append("\"");
45         }
46         if (in_styleClass.length>1) {
47             out_buffer.append(" style=\"");
48             for (int i = 0; i < in_styleClass.length-1; i++) {
49                 out_buffer.append(in_styleClass[i+1]);
50             }
51             out_buffer.append("\"");
52         }
53         
54         out_buffer.append(">");
55         
56         if (in_id!=null) {
57             out_buffer.append("<div id=\"");
58             out_buffer.append(in_id);
59             out_buffer.append("\">");
60         }
61         
62         out_buffer.append(in_item);
63         
64         if (in_id!=null) {
65             out_buffer.append("</div>");
66         }
67
68         out_buffer.append("</li>");
69     }
70     /**
71      * Finish to render a line.
72      */

73     public void doEndItems(StringBuffer JavaDoc out_buffer) {
74         // Do nothing.
75
}
76     
77     
78 }
Popular Tags