01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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 2637 2003-06-20 17:15:42Z antonma $
24: * --------------------------------------------------------------------------
25: */
26:
27: package org.objectweb.jonas.webapp.taglib;
28:
29: import javax.servlet.jsp.JspException;
30:
31: public class JonasGridRowTitleTag extends GridRowTag {
32:
33: // ------------------------------------------------------------- Constants
34:
35: public static final String CLASS_TITLE = "panelTitle";
36:
37: // ------------------------------------------------------------- Instance Variables
38:
39: private boolean mb_ForceStyleClass = false;
40:
41: // ------------------------------------------------------------- Properties
42:
43: private String level = null;
44:
45: public String getLevel() {
46: return level;
47: }
48:
49: public void setLevel(String 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() throws JspException {
61: // Set default value
62: mb_ForceStyleClass = false;
63: if (getStyleClass() == null) {
64: setStyleClass(getStyleClassLevel());
65: mb_ForceStyleClass = true;
66: }
67: return super .doStartTag();
68: }
69:
70: public void release() {
71: super .release();
72: level = null;
73: }
74:
75: public String getStyleClassLevel() {
76: if (level != null) {
77: return new String((CLASS_TITLE + level));
78: }
79: return CLASS_TITLE;
80: }
81:
82: /**
83: * End of Tag Processing
84: *
85: * @exception JspException if a JSP exception occurs
86: */
87: public int doEndTag() throws JspException {
88: int iRet = super .doEndTag();
89: if (mb_ForceStyleClass == true) {
90: mb_ForceStyleClass = false;
91: setStyleClass(null);
92: }
93: return iRet;
94: }
95: }
|