All Packages Class Hierarchy This Package Previous Next Index
Class com.abc.templates.HtmlControl
java.lang.Object
|
+----com.abc.templates.HtmlControl
- public abstract class HtmlControl
- extends Object
- implements Serializable
Abstract class represents control on html page. Has two properties Name and Visible. So
each control has those properties.
HtmlControl()
Empty constructor. Set visible to true.
HtmlControl(HtmlControl
control)
- Copy constructor. Copies values of properties from control
Assign(HtmlControl
control )
- This method will be called if we have duplicate names on our template page. Only radio
button implements this method.
- Example:
- <input type="text" name="Text" value="AAA">
- <input type="text" name="Text" value="BBB">
- There will be only one control with name "Text" and value="AAA".
-
clone()
- You can use this method to clone that object.
-
getName()
- retrieves "Name" property
getValue()
- Implementations of this method are depended from type of control for HtmlStatic,
HtmlText, HtmlBlinking will return value of "value" property.
- For HtmlRadio will return selected value or "" if no selected value. For
HtmlCheckbox will return value of "value" property if checkbox is checked and
"" if not. For HtmlTable always returns "".
isVisible()
- returns true if control is visible and false if not.
readAfterTag(byte
b[], int iFrom)
- Usually you will not use this method.
- Control may have own initialization data after tag. iFrom points on start of that data.
- Example: <textarea name="Name> AAAAAAAAAAAAAa</textarea>
- HtmlTextArea has his own data right after tag <textarea name="Name"> in
this case readAfterTag must return offset in array where that data ends.
- Example <input type="text" name="Name"> does not have his own
data and must return iFrom.
readFromHtml(HttpServletRequest,
IValidator)
- Usually you will not use this method.
- control will read themselves from HttpServletRequest and validate value. Must return
true if valid and false if not. Only HtmlText control will validate themselves.
- Only visible controls will read themselves and validate.
setName(String)
- Usually you will not use this method.
- Set method to set name of control. You should not call that method directly.
setProperty(String,
String)
- Usually you will not use this method.
- Allows you set property of control by name. Example: setProperty("value",
"AA");
setValue(String)
- set method for "value" property. Implementation depends of type of control.
setVisible(boolean)
- set cotnrol to visible or not visible state.
writeToHtml(HtmlWriter
put, Template template)
- Usually you will not use this method.
- Outputs control to browser.
HtmlControl
public HtmlControl()

HtmlControl
public HtmlControl(HtmlControl tmp)

Assign
public abstract void Assign(HtmlControl control)

clone
public abstract Object clone()
- Overrides:
- clone in class Object

getName
public String getName()

getValue
public abstract String getValue()

initialize
public void initialize(Template e)

isVisible
public boolean isVisible()

readAfterTag
public int readAfterTag(byte b[],
int iFrom) throws BadTemplate

readFromHtml
public abstract boolean readFromHtml(HttpServletRequest req,
IValidator validator) throws Exception

setName
public void setName(String sName)

setProperty
public boolean setProperty(String sName,
String sValue) throws BadTemplate

setValue
public abstract void setValue(String sValue)

setVisible
public void setVisible(boolean bVisible)

writeToHtml
public abstract void writeToHtml(HtmlWriter out, Template template) throws Exception
All Packages Class Hierarchy This Package Previous Next Index