KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > taglib > GridColTag


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer(s): Michel-Ange ANTON
22  * --------------------------------------------------------------------------
23  * $Id: GridColTag.java,v 1.4 2004/03/26 16:16:12 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas.webapp.taglib;
28
29 import javax.servlet.jsp.JspException JavaDoc;
30
31 public class GridColTag extends GridTableBaseTag {
32
33 // ----------------------------------------------------- Properties Variables
34

35     private boolean nowrap = false;
36     private int colspan = -1;
37     private int rowspan = -1;
38
39     public boolean isNowrap() {
40         return nowrap;
41     }
42
43     public void setNowrap(boolean nowrap) {
44         this.nowrap = nowrap;
45     }
46
47     public int getColspan() {
48         return colspan;
49     }
50
51     public void setColspan(int colspan) {
52         this.colspan = colspan;
53     }
54
55     public int getRowspan() {
56         return rowspan;
57     }
58
59     public void setRowspan(int rowspan) {
60         this.rowspan = rowspan;
61     }
62
63 // ----------------------------------------------------- Protected Methods
64

65     /**
66      * Return the HTML element.
67      */

68     protected String JavaDoc getHtmlElement() {
69         return "td";
70     }
71
72     /**
73      * Prepare the attributes of the HTML element
74      */

75     protected String JavaDoc prepareAttributes() throws JspException JavaDoc {
76         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
77         // Append nowrap
78
if (isNowrap()) {
79             sb.append(" nowrap");
80         }
81         // Append "colspan" parameter
82
sb.append(prepareAttribute("colspan", colspan));
83         // Append "rowspan" parameter
84
sb.append(prepareAttribute("rowspan", rowspan));
85         // Append Parent
86
sb.append(super.prepareAttributes());
87
88         return sb.toString();
89     }
90
91     protected String JavaDoc getDefaultBody() {
92         return " ";
93     }
94
95 // ----------------------------------------------------- Public Methods
96

97     /**
98      * Release resources after Tag processing has finished.
99      */

100     public void release() {
101         super.release();
102         nowrap = false;
103     }
104 }
Popular Tags