01: //$Id: RSSTextInput.java,v 1.6 2004/03/30 18:21:43 taganaka Exp $
02: package org.gnu.stealthp.rsslib;
03:
04: /**
05: * RSSTextInput's definitions class.
06: *
07: * <blockquote>
08: * <em>This module, both source code and documentation, is in the
09: * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
10: * </blockquote>
11: *
12: * @since RSSLIB4J 0.1
13: * @author Francesco aka 'Stealthp' stealthp[@]stealthp.org
14: * @version 0.2
15: */
16:
17: public class RSSTextInput extends RSSObject {
18:
19: private String name;
20:
21: /**
22: * Set the input type name
23: * @param String n the input type name
24: */
25: public void setInputName(String n) {
26: name = n;
27: }
28:
29: /**
30: * Get the form input name
31: * @return the name
32: */
33: public String getInputName() {
34: return name;
35: }
36:
37: /**
38: * Get the form action
39: * @return the action
40: */
41: public String getFormAction() {
42: return super .getLink();
43: }
44:
45: /**
46: * Info
47: * @return info string
48: */
49: public String toString() {
50: String info = "FORM ACTION: " + getFormAction() + "\n"
51: + "INPUT NAME: " + getInputName() + "\n"
52: + "DESCRIPTION: " + super .getDescription();
53: return info;
54: }
55:
56: /**
57: * A basic rendering in html
58: * @return the html form
59: */
60: public String toHTML() {
61: String html = "<form method\"GET\" action=\"" + getFormAction()
62: + "\">\n" + super .getDescription() + "<br>\n"
63: + "<input type=\"text\" name=\"" + getInputName()
64: + "\">\n</form>";
65: return html;
66: }
67:
68: }
|