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.layout;
16:
17: import java.io.Writer;
18: import org.araneaframework.jsp.util.JspUtil;
19:
20: /**
21: * Aranea's row tag, represents one row in a layout.
22: * In HTML this tag corresponds to table row -- <tr> with <code>class</code> attribute.
23: *
24: * @jsp.tag
25: * name = "row"
26: * body-content = "JSP"
27: * description = "Represents a row in layout."
28: *
29: * @author Taimo Peelo (taimo@araneaframework.org)
30: */
31: public class LayoutRowHtmlTag extends BaseLayoutRowTag {
32: protected int doStartTag(Writer out) throws Exception {
33: super .doStartTag(out);
34:
35: JspUtil.writeOpenStartTag(out, "tr");
36: writeRowAttributes(out);
37: JspUtil.writeCloseStartTag(out);
38:
39: return EVAL_BODY_INCLUDE;
40: }
41:
42: /** Overwrite if other attributes besides <code>styleclass</code> are needed for HTML table row. */
43: protected void writeRowAttributes(Writer out) throws Exception {
44: addAttribute("class", getStyleClass());
45: addAttribute("style", getStyle());
46: addAttribute("id", id);
47: JspUtil.writeAttributes(out, attributes);
48: }
49:
50: protected int doEndTag(Writer out) throws Exception {
51: JspUtil.writeEndTag(out, "tr");
52: return super.doEndTag(out);
53: }
54: }
|