01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.jsp.tags;
21:
22: /////////////////////////
23: //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/tags/FontTag.java $
24: //$Author: Srufle $
25: //$Revision: 8 $
26: //$Modtime: 4/15/03 11:06a $
27: /////////////////////////
28:
29: import java.io.IOException;
30:
31: import javax.servlet.jsp.JspWriter;
32:
33: import com.salmonllc.jsp.JspController;
34: import com.salmonllc.jsp.TagWriter;
35: import com.salmonllc.properties.Props;
36:
37: /**
38: * This (body) tag is to enable making generic controllers. The contents of the body is the value.
39: */
40:
41: public class FontTag extends BaseBodyTag {
42: String _content;
43: String _type;
44:
45: /**
46: * This method creates a null component.
47: */
48: public com.salmonllc.html.HtmlComponent createComponent() {
49: return null;
50: }
51:
52: /**
53: * This method generates the html used by the tag.
54: */
55:
56: public void generateComponentHTML(JspWriter p) throws IOException {
57: TagWriter w = getTagWriter();
58: w.setWriter(p);
59:
60: JspController cont = getHelper().getController();
61: Props pr = cont.getPageProperties();
62:
63: String startTag = pr.getProperty(_type + Props.TAG_START, "");
64: String endTag = pr.getProperty(_type + Props.TAG_END, "");
65:
66: w.print(startTag, TagWriter.TYPE_BEGIN_TAG);
67: w.print(_content, TagWriter.TYPE_CONTENT);
68: w.print(endTag, TagWriter.TYPE_END_TAG);
69:
70: }
71:
72: /**
73: * Returns the type of DreamWeaver conversion that this tag uses.
74: */
75: public int getTagConvertType() {
76: return CONV_CUSTOM;
77: }
78:
79: public boolean incrementMode() {
80: _content = getBodyContentData(true);
81: return false;
82: }
83:
84: /**
85: * This method sets the type for the font
86: */
87: public void release() {
88: _type = null;
89: _content = null;
90: }
91:
92: /**
93: * This method sets the type for the font
94: */
95: public void setType(String type) {
96: _type = type;
97: }
98: }
|