01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.jsp.tag.presentation;
16:
17: import java.io.Writer;
18: import org.araneaframework.jsp.tag.PresentationTag;
19: import org.araneaframework.jsp.util.JspUtil;
20:
21: /**
22: * Standard style tag.
23: *
24: * @author Oleg Mürk
25: *
26: * @jsp.tag
27: * name = "style"
28: * body-content = "JSP"
29: * description = "Sets a CSS class for the content, acts as a <i><span></i> HTML tag with the <i>class</i> atribute set."
30: */
31: public class StyleHtmlTag extends PresentationTag {
32: //
33: // Implementation
34: //
35:
36: protected int doStartTag(Writer out) throws Exception {
37: super .doStartTag(out);
38:
39: JspUtil.writeOpenStartTag(out, "span");
40: JspUtil.writeAttribute(out, "class", getStyleClass());
41: JspUtil.writeCloseStartTag_SS(out);
42:
43: // Continue
44: return EVAL_BODY_INCLUDE;
45: }
46:
47: protected int doEndTag(Writer out) throws Exception {
48: JspUtil.writeEndTag(out, "span");
49:
50: // Continue
51: super.doEndTag(out);
52: return EVAL_PAGE;
53: }
54: }
|