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: JonasGridNameTag.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 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() throws JspException {
53: setNowrap(true);
54: setAlign("right");
55: setValign("top");
56: setWidth("19%");
57: return super .doStartTag();
58: }
59:
60: public void release() {
61: super .release();
62: }
63:
64: // ----------------------------------------------------- Protected Methods
65:
66: protected String prepareAfterTag() {
67: StringBuffer sb = new StringBuffer("<td width=\"1%\"");
68: if (getStyleClass() != null) {
69: sb.append(" class=\"");
70: sb.append(getStyleClass());
71: sb.append("\"");
72: }
73: sb.append("> </td>");
74: return sb.toString();
75: }
76:
77: protected String prepareBeforeBody() {
78: if (bold == true) {
79: return "<b>";
80: }
81: return "";
82: }
83:
84: protected String prepareAfterBody() {
85: if (bold == true) {
86: return "</b>";
87: }
88: return "";
89: }
90: }
|