KickJava   Java API By Example, From Geeks To Geeks.

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


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: JonasGridRowTitleTag.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 JonasGridRowTitleTag extends GridRowTag {
32
33 // ------------------------------------------------------------- Constants
34

35     public static final String JavaDoc CLASS_TITLE = "panelTitle";
36
37 // ------------------------------------------------------------- Instance Variables
38

39     private boolean mb_ForceStyleClass = false;
40
41 // ------------------------------------------------------------- Properties
42

43     private String JavaDoc level = null;
44
45     public String JavaDoc getLevel() {
46         return level;
47     }
48
49     public void setLevel(String JavaDoc level) {
50         this.level = level;
51     }
52
53 // ----------------------------------------------------- Public Methods
54

55     /**
56      * Start of Tag processing
57      *
58      * @exception JspException if a JSP exception occurs
59      */

60     public int doStartTag()
61         throws JspException JavaDoc {
62         // Set default value
63
mb_ForceStyleClass = false;
64         if (getStyleClass() == null) {
65             setStyleClass(getStyleClassLevel());
66             mb_ForceStyleClass = true;
67         }
68         return super.doStartTag();
69     }
70
71     public void release() {
72         super.release();
73         level = null;
74     }
75
76     public String JavaDoc getStyleClassLevel() {
77         if (level != null) {
78             return new String JavaDoc((CLASS_TITLE + level));
79         }
80         return CLASS_TITLE;
81     }
82
83     /**
84      * End of Tag Processing
85      *
86      * @exception JspException if a JSP exception occurs
87      */

88     public int doEndTag()
89         throws JspException JavaDoc {
90         int iRet = super.doEndTag();
91         if (mb_ForceStyleClass == true) {
92             mb_ForceStyleClass = false;
93             setStyleClass(null);
94         }
95         return iRet;
96     }
97 }
Popular Tags