BrightSide Workbench Full Report + Source Code
org.turro.html.HTMLForm Class Reference
Inheritance diagram for org.turro.html.HTMLForm:
Collaboration diagram for org.turro.html.HTMLForm:

Public Member Functions

 HTMLForm (IElement iel) throws IOException
 
void startForm (String id, String method, String actionElement)
 
void startForm (String id, String method, String actionElement, String attributes)
 
void startMultipartForm (String id, String method, String actionElement)
 
void endForm ()
 
void command (String command, String value, String style)
 
void command (String command, String value, String style, String onClick)
 
void clientCommand (String command, String value, String style)
 
void inPlaceTextInput (String idShow, String id, String value, String style)
 
void textInput (String id, String value, String style)
 
void passwordInput (String id, String value, String style)
 
void checkBox (String id, String value, String style, boolean checked)
 
void inPlaceTextArea (String idShow, String id, String value, String style)
 
void textArea (String id, String value, String style)
 
void selectList (String id, String value, Map options, String style)
 
void hidden (String id, String value)
 
void inPlaceAutocompleter (String idShow, String id, String value, String style, String actionElement, String action, String extraParam, String tokenizer)
 
void autocompleter (String id, String value, String style, String actionElement, String action, String extraParam, String tokenizer)
 
void fileUpload (String id, String style)
 
- Public Member Functions inherited from org.turro.html.HTMLComponent
 HTMLComponent (IElement iel) throws IOException
 
 HTMLComponent (IElement iel, boolean toString) throws IOException
 
void writeDate (Date date, String mode)
 
void writeNumber (Number number, String mode)
 
void writeBytes (long bytes)
 
void writeBoolean (boolean value)
 
void configureInPlaceEditor (IElement element, String ident, String component, String action, String params, int rows)
 
void configureFeditor (IElement element, String ident, String component, String action, String params, int rows)
 
String toString ()
 
void startElement (int mode)
 
void endElement (int mode)
 
void writeElement (int mode)
 
String strElement (int mode)
 
void setEditable (boolean editable)
 
- Public Member Functions inherited from org.turro.html.HTMLHelper
 HTMLHelper (IConstructor constructor, Writer out)
 
 HTMLHelper (IConstructor constructor)
 
 HTMLHelper (Writer out)
 
HTMLGenerator write (String value)
 
void writeMacro (String value)
 
void writeln (String value)
 
- Public Member Functions inherited from org.turro.html.HTMLGenerator
 HTMLGenerator ()
 
 HTMLGenerator (Writer out)
 
void setOut (Writer out)
 
void setExtraAttributes (String extraAttributes)
 
HTMLGenerator doTag (String tag)
 
HTMLGenerator doTag (String tag, String attributes)
 
HTMLGenerator doTag (String tag, String[] attributes)
 
HTMLGenerator startTag (String tag)
 
HTMLGenerator startTag (String tag, String attributes)
 
HTMLGenerator startTag (String tag, String[] attributes)
 
HTMLGenerator startExtAnchor (String url, String hint)
 
HTMLGenerator startTargetAnchor (String url, String target, String hint)
 
HTMLGenerator startAnchor (String url, String hint)
 
HTMLGenerator startAnchor (String url, String hint, String cssClass)
 
HTMLGenerator startAnchor (String url, String hint, String cssClass, String onClick)
 
HTMLGenerator startTable (String attributes)
 
HTMLGenerator startTable (String[] attributes)
 
HTMLGenerator endTable ()
 
HTMLGenerator startTableRow (String attributes)
 
HTMLGenerator startTableRow (String[] attributes)
 
HTMLGenerator endTableRow ()
 
HTMLGenerator startTableCol (String attributes)
 
HTMLGenerator startTableCol (String[] attributes)
 
HTMLGenerator endTableCol ()
 
HTMLGenerator endTag ()
 
HTMLGenerator endTag (String tag)
 
HTMLGenerator endBeforeTag (String tag)
 
HTMLGenerator endAllTags ()
 
boolean checkTag (String tag)
 
HTMLGenerator writeNewLine ()
 
HTMLGenerator writeSeparator ()
 
HTMLGenerator writeHorizontalStrut (int pixels)
 
HTMLGenerator startJavaScript ()
 
HTMLGenerator endJavaScript ()
 
HTMLGenerator startCSS ()
 
HTMLGenerator endCSS ()
 
HTMLGenerator addCSSLink (String cssFile)
 
HTMLGenerator addJavaScriptLink (String jsFile)
 
- Public Member Functions inherited from org.turro.html.IHTMLRenderable
void setOut (Writer out)
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.html.IHTMLRenderable
static final int MODE_FULL = 0
 
static final int MODE_MEDIUM = 1
 
static final int MODE_SMALL = 2
 
- Protected Attributes inherited from org.turro.html.HTMLComponent
IElement iel
 
boolean editable = false
 
StringWriter sw = null
 
- Protected Attributes inherited from org.turro.html.HTMLHelper
IConstructor constructor = null
 
- Protected Attributes inherited from org.turro.html.HTMLGenerator
Stack tags = new Stack()
 
Writer out = null
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 30 of file HTMLForm.java.

Constructor & Destructor Documentation

◆ HTMLForm()

org.turro.html.HTMLForm.HTMLForm ( IElement  iel) throws IOException

Creates a new instance of HTMLForm

Parameters
iel
Exceptions
java.io.IOException

Definition at line 35 of file HTMLForm.java.

35  {
36  super(iel);
37  }

Member Function Documentation

◆ autocompleter()

void org.turro.html.HTMLForm.autocompleter ( String  id,
String  value,
String  style,
String  actionElement,
String  action,
String  extraParam,
String  tokenizer 
)

Definition at line 193 of file HTMLForm.java.

193  {
194  String formAction = ElephantContext.getRootWebPath() +
195  "/xpaction/" + actionElement +
196  "?action=" + action +
197  "&context=" + iel.getContext().getPath() +
198  "&idel=" + iel.getId() +
199  "&field=" + id +
200  extraParam;
201  if(value == null) value = "";
202  write("<input type='text' id='" + id + "' name='" + id + "' value='" + value + "' style='" + style + "' class='hf_autocompleter'/>");
203  String idList = "ac_" + id;
204  startTag("div", new String[] { "id='" + idList + "'", "class='autolist'" });
205  endTag();
206  startJavaScript();
207  write(
208  "new Ajax.Autocompleter(\n" +
209  "\"" + id + "\", \"" + idList + "\"," +
210  "\"" + formAction + "\"" +
211  (tokenizer != null ? ", {tokens:\"" + tokenizer + "\"}" : "") +
212  ");"
213  );
214  endJavaScript();
215  }
HTMLGenerator startTag(String tag)
HTMLGenerator write(String value)
Definition: HTMLHelper.java:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkBox()

void org.turro.html.HTMLForm.checkBox ( String  id,
String  value,
String  style,
boolean  checked 
)

Definition at line 122 of file HTMLForm.java.

122  {
123  if(value == null) value = "";
124  write("<input type='checkbox' name='" + id + "' id='" + id + "' value='" + value + "' style='" + style + "' class='hf_check'" + (checked ? " checked" : "") + "/>");
125  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clientCommand()

void org.turro.html.HTMLForm.clientCommand ( String  command,
String  value,
String  style 
)

Definition at line 82 of file HTMLForm.java.

82  {
83  doTag("input", new String[] {
84  "type='button'",
85  "class='hf_command'",
86  "onclick='javascript:" + command + "'",
87  "style='" + style + "'",
88  "value=\"" + value + "\""
89  });
90  }
void command(String command, String value, String style)
Definition: HTMLForm.java:61
HTMLGenerator doTag(String tag)
Here is the call graph for this function:

◆ command() [1/2]

void org.turro.html.HTMLForm.command ( String  command,
String  value,
String  style 
)

Definition at line 61 of file HTMLForm.java.

61  {
62  doTag("input", new String[] {
63  "type='submit'",
64  "class='hf_command'",
65  "name='action_" + command + "'",
66  "style='" + style + "'",
67  "value=\"" + value + "\""
68  });
69  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ command() [2/2]

void org.turro.html.HTMLForm.command ( String  command,
String  value,
String  style,
String  onClick 
)

Definition at line 71 of file HTMLForm.java.

71  {
72  doTag("input", new String[] {
73  "type='submit'",
74  "class='hf_command'",
75  "name='action_" + command + "'",
76  "style='" + style + "'",
77  "onclick=\"javascript:" + onClick + "\"",
78  "value=\"" + value + "\""
79  });
80  }
Here is the call graph for this function:

◆ endForm()

void org.turro.html.HTMLForm.endForm ( )

Definition at line 57 of file HTMLForm.java.

57  {
58  writeln("</form>");
59  }
void writeln(String value)
Definition: HTMLHelper.java:90
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileUpload()

void org.turro.html.HTMLForm.fileUpload ( String  id,
String  style 
)

Definition at line 217 of file HTMLForm.java.

217  {
218  write("<input type='file' name='" + id + "' style='" + style + "' class='hf_upload'/>");
219  }
Here is the call graph for this function:

◆ hidden()

void org.turro.html.HTMLForm.hidden ( String  id,
String  value 
)

Definition at line 169 of file HTMLForm.java.

169  {
170  write("<input type='hidden' name='" + id + "' value='" + value + "'/>");
171  }
Here is the call graph for this function:

◆ inPlaceAutocompleter()

void org.turro.html.HTMLForm.inPlaceAutocompleter ( String  idShow,
String  id,
String  value,
String  style,
String  actionElement,
String  action,
String  extraParam,
String  tokenizer 
)

Definition at line 173 of file HTMLForm.java.

173  {
174  doTag("img",
175  new String[] {
176  "onclick='showEdit" + id + "(this)'",
177  "alt='Edit'",
178  "src='" + ElephantContext.getRootWebPath() + "/_internal/system/images/inplaceedit.gif'",
179  "style='cursor:pointer'"
180  });
181  autocompleter(id, value, style + ";display:none", actionElement, action, extraParam, tokenizer);
182  startJavaScript();
183  write(
184  "function showEdit" + id + "(el) {" +
185  "el.hide();" +
186  (idShow != null ? "$('" + idShow + "').hide();" : "") +
187  "$('" + id + "').show();" +
188  "}"
189  );
190  endJavaScript();
191  }
void autocompleter(String id, String value, String style, String actionElement, String action, String extraParam, String tokenizer)
Definition: HTMLForm.java:193
Here is the call graph for this function:

◆ inPlaceTextArea()

void org.turro.html.HTMLForm.inPlaceTextArea ( String  idShow,
String  id,
String  value,
String  style 
)

Definition at line 127 of file HTMLForm.java.

127  {
128  doTag("img",
129  new String[] {
130  "onclick='showEdit" + id + "(this)'",
131  "alt='Edit'",
132  "src='" + ElephantContext.getRootWebPath() + "/_internal/system/images/inplaceedit.gif'",
133  "style='cursor:pointer'"
134  });
135  textArea(id, value, style + ";display:none");
136  startJavaScript();
137  write(
138  "function showEdit" + id + "(el) {" +
139  "el.hide();" +
140  "$('" + idShow + "').hide();" +
141  "$('" + id + "').show();" +
142  "}"
143  );
144  endJavaScript();
145  }
void textArea(String id, String value, String style)
Definition: HTMLForm.java:147
Here is the call graph for this function:

◆ inPlaceTextInput()

void org.turro.html.HTMLForm.inPlaceTextInput ( String  idShow,
String  id,
String  value,
String  style 
)

Definition at line 92 of file HTMLForm.java.

92  {
93  doTag("img",
94  new String[] {
95  "onclick='showEdit" + id + "(this)'",
96  "alt='Edit'",
97  "src='" + ElephantContext.getRootWebPath() + "/_internal/system/images/inplaceedit.gif'",
98  "style='cursor:pointer'"
99  });
100  textInput(id, value, style + ";display:none");
101  startJavaScript();
102  write(
103  "function showEdit" + id + "(el) {" +
104  "el.hide();" +
105  "$('" + idShow + "').hide();" +
106  "$('" + id + "').show();" +
107  "}"
108  );
109  endJavaScript();
110  }
void textInput(String id, String value, String style)
Definition: HTMLForm.java:112
Here is the call graph for this function:

◆ passwordInput()

void org.turro.html.HTMLForm.passwordInput ( String  id,
String  value,
String  style 
)

Definition at line 117 of file HTMLForm.java.

117  {
118  if(value == null) value = "";
119  write("<input type='password' name='" + id + "' id='" + id + "' value='" + value + "' style='" + style + "' class='hf_input'/>");
120  }
Here is the call graph for this function:

◆ selectList()

void org.turro.html.HTMLForm.selectList ( String  id,
String  value,
Map  options,
String  style 
)

Definition at line 152 of file HTMLForm.java.

152  {
153  write("<select name='" + id + "' id='" + id + "' style='" + style + "' class='hf_select'>");
154  Iterator it = options.keySet().iterator();
155  String key;
156  while(it.hasNext()) {
157  key = (String)it.next();
158  write("<option value='" + key + "'");
159  if(key.equals(value)) {
160  write(" selected");
161  }
162  write(">");
163  write((String)options.get(key));
164  write("</option>");
165  }
166  write("</select>");
167  }
Here is the call graph for this function:

◆ startForm() [1/2]

void org.turro.html.HTMLForm.startForm ( String  id,
String  method,
String  actionElement 
)

Definition at line 39 of file HTMLForm.java.

39  {
40  startForm(id, method, actionElement, "class='htmlform'");
41  }
void startForm(String id, String method, String actionElement)
Definition: HTMLForm.java:39
Here is the caller graph for this function:

◆ startForm() [2/2]

void org.turro.html.HTMLForm.startForm ( String  id,
String  method,
String  actionElement,
String  attributes 
)

Definition at line 43 of file HTMLForm.java.

43  {
44  String formAction = ElephantContext.getRootWebPath() +
45  "/xpaction/" + actionElement;
46  write("<form id='" + id + "' action='" + formAction + "' method='" + method + "' " + attributes + ">");
47  createHiddenElement();
48  }
Here is the call graph for this function:

◆ startMultipartForm()

void org.turro.html.HTMLForm.startMultipartForm ( String  id,
String  method,
String  actionElement 
)

Definition at line 50 of file HTMLForm.java.

50  {
51  String formAction = ElephantContext.getRootWebPath() +
52  "/xpaction/" + actionElement;
53  write("<form id='" + id + "' action='" + formAction + "' method='" + method + "' enctype='multipart/form-data' class='htmlform'>");
54  createHiddenElement();
55  }
Here is the call graph for this function:

◆ textArea()

void org.turro.html.HTMLForm.textArea ( String  id,
String  value,
String  style 
)

Definition at line 147 of file HTMLForm.java.

147  {
148  if(value == null) value = "";
149  write("<textarea name='" + id + "' id='" + id + "' style='" + style + "' class='hf_editor'>" + value + "</textarea>");
150  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textInput()

void org.turro.html.HTMLForm.textInput ( String  id,
String  value,
String  style 
)

Definition at line 112 of file HTMLForm.java.

112  {
113  if(value == null) value = "";
114  write("<input type='text' name='" + id + "' id='" + id + "' value='" + value + "' style='" + style + "' class='hf_input'/>");
115  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: