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.


 o HtmlControl()

    Empty constructor. Set visible to true.

 o HtmlControl(HtmlControl control)
Copy constructor. Copies values of properties from control
 o 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".
 
 o clone()
You can use this method to clone that object.
 
 o getName()
retrieves "Name" property
 o 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 "".
 o isVisible()
returns true if control is visible and false if not.
 o 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.
 o 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.
 o setName(String)
Usually you will not use this method.
Set method to set name of control. You should not call that method directly.
 o setProperty(String, String)
Usually you will not use this method.
Allows you set property of control by name. Example: setProperty("value", "AA");
 o setValue(String)
set method for "value" property. Implementation depends of type of control.
 o setVisible(boolean)
set cotnrol to visible or not visible state.
 o writeToHtml(HtmlWriter put, Template template)
Usually you will not use this method.
Outputs control to browser.

 o HtmlControl

 public HtmlControl()

 o HtmlControl

 public HtmlControl(HtmlControl tmp)

 o Assign

 public abstract void Assign(HtmlControl control)

 o clone

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

 o getName

 public String getName()

 o getValue

 public abstract String getValue()

 o initialize

 public void initialize(Template e)

 o isVisible

 public boolean isVisible()

 o readAfterTag

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

 o readFromHtml

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

 o setName

 public void setName(String sName)

 o setProperty

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

 o setValue

 public abstract void setValue(String sValue)

 o setVisible

 public void setVisible(boolean bVisible)

 o writeToHtml

 public abstract void writeToHtml(HtmlWriter out, Template template) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index