KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > BaseFieldTag


1 package fr.improve.struts.taglib.layout;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import fr.improve.struts.taglib.layout.util.LayoutUtils;
5
6 /**
7  * Base class for the tags dealing with form input
8  * The tag renders html code looking like: <tr><th> input field title </th><td> input field </td></tr>
9  *
10  * @author: Jean-NoŽl Ribette
11  * @deprecated
12  */

13 public abstract class BaseFieldTag extends LabelledTag {
14
15 /**
16  * Append the title of the field to the buffer
17  */

18 protected void beginField(StringBuffer JavaDoc buffer) throws JspException JavaDoc {
19     buffer.append("<tr><th class=");
20     buffer.append(styleClass);
21     buffer.append("><span class=");
22     buffer.append(styleClass);
23     buffer.append(">");
24     if (key!=null) buffer.append(getLabel()); else buffer.append("&nbsp;");
25     buffer.append("</span></th><td class=");
26     buffer.append(styleClass);
27     buffer.append(">");
28 }
29 /**
30  * End the field (close the html tags)
31  */

32 protected void endField(StringBuffer JavaDoc buffer) {
33     buffer.append("</td></tr>\n");
34 }
35
36 public void setProperty(String JavaDoc property) {
37     this.property = property;
38     if (LayoutUtils.getNoErrorMode())
39             this.property = "property";
40 }
41 }
Popular Tags