KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasGridNameTag.java,v 1.3 2003/06/20 17:15:42 antonma Exp $
24  * --------------------------------------------------------------------------
25  */

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

35     private boolean bold = true;
36
37     public boolean isBold() {
38         return bold;
39     }
40
41     public void setBold(boolean bold) {
42         this.bold = bold;
43     }
44
45 // ----------------------------------------------------- Public Methods
46

47     /**
48      * Start of Tag processing
49      *
50      * @exception JspException if a JSP exception occurs
51      */

52     public int doStartTag()
53         throws JspException JavaDoc {
54         setNowrap(true);
55         setAlign("right");
56         setValign("top");
57         setWidth("19%");
58         return super.doStartTag();
59     }
60
61     public void release() {
62         super.release();
63     }
64
65 // ----------------------------------------------------- Protected Methods
66

67     protected String JavaDoc prepareAfterTag() {
68         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("<td width=\"1%\"");
69         if (getStyleClass() != null) {
70             sb.append(" class=\"");
71             sb.append(getStyleClass());
72             sb.append("\"");
73         }
74         sb.append(">&nbsp;</td>");
75         return sb.toString();
76     }
77
78     protected String JavaDoc prepareBeforeBody() {
79         if (bold == true) {
80             return "<b>";
81         }
82         return "";
83     }
84
85     protected String JavaDoc prepareAfterBody() {
86         if (bold == true) {
87             return "</b>";
88         }
89         return "";
90     }
91 }
Popular Tags