org.mmbase.util
Class HTMLElement

java.lang.Object
  extended byorg.mmbase.util.HTMLElement
Direct Known Subclasses:
HTMLElementCheckBox, HTMLElementPassword, HTMLElementRadio, HTMLElementSelect, HTMLElementText, HTMLElementTextArea

public abstract class HTMLElement
extends java.lang.Object

Class which is the super-class for ALL the HTMLElements. Includes a parser wich fills all the variables and calls the abstract function generate which will be implemented in a HTMLElement

Version:
$Id: HTMLElement.java,v 1.7 2003/03/07 08:50:30 pierre Exp $
Author:
Jan van Oosterom

Field Summary
protected  java.lang.String cols
          added to COLS=
protected  boolean empty
          The EMPTY tag is present in the macro.
protected  boolean ex
          if true there is an excluded item
protected  java.lang.String exclude
          if this element is in the ValueList from the Processor it should be excluded
protected  boolean horizontal
          The Item list should be HORIZONTAL This is default
protected  int max
          added to MAX=
protected  boolean moredouble
          There is a double list of items (from the Processor)
protected  boolean moreValues
          There is a (single) list of items (from the Processor)
protected  boolean multiple
          if true it the Element should allow MULTIPLE selection
protected  java.lang.String name
          The value what will be put after the NAME= tag
protected  boolean proc
          The PROC tag is present in the macro.
protected  boolean procdouble
          The DOUBLE tag is present in the macro.
protected  ProcessorInterface processor
          The processor which will be called by the parse routine.
protected  java.lang.String rows
          added to ROWS=
protected  boolean sel
          if true there is a Selected item
protected  java.lang.String selected
          The element which will be selected (e.g.: <OPTION SELECTED>)
protected  java.lang.String size
          added to the SIZE= tag
protected  java.lang.String sorted
          added to Sorted=
protected  scanpage sp
          page from this request
protected  java.lang.String user
          The user name that is currently acessing this page
protected  java.lang.String values
          The value what will be passed to the Processor or will be the value of the item.
protected  java.util.Vector valuesList
          contains the Vector with the items returned by the ProcessorInteface.getList(value) if the PROC tag is present
protected  boolean vertical
          The Item list should be VERTICAL (a <BR> tag should be added)
 
Constructor Summary
HTMLElement()
          empty
 
Method Summary
protected abstract  java.lang.String generate()
          Should be implemented by the subclass and and should return the generated HTML.
protected  java.lang.String generateHTML(scanpage sp, ProcessorInterface proc, java.util.Vector macro)
          Calls the parser and returns the String returned by generate.
protected  java.lang.String getType(java.lang.String str)
          Returns the part in front of the '=' char of the String.
protected  java.lang.String getValue(java.lang.String str)
          Returns the part after the '=' char of the String.
protected  boolean parse(java.util.Vector macro)
          Reads the Vector and fills all the variables if the corespondending variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processor

protected ProcessorInterface processor
The processor which will be called by the parse routine.


name

protected java.lang.String name
The value what will be put after the NAME= tag


values

protected java.lang.String values
The value what will be passed to the Processor or will be the value of the item. (PROC ->Processor else the value)


valuesList

protected java.util.Vector valuesList
contains the Vector with the items returned by the ProcessorInteface.getList(value) if the PROC tag is present


size

protected java.lang.String size
added to the SIZE= tag


selected

protected java.lang.String selected
The element which will be selected (e.g.: <OPTION SELECTED>)


rows

protected java.lang.String rows
added to ROWS=


cols

protected java.lang.String cols
added to COLS=


max

protected int max
added to MAX=


sorted

protected java.lang.String sorted
added to Sorted=


exclude

protected java.lang.String exclude
if this element is in the ValueList from the Processor it should be excluded


ex

protected boolean ex
if true there is an excluded item


multiple

protected boolean multiple
if true it the Element should allow MULTIPLE selection


moreValues

protected boolean moreValues
There is a (single) list of items (from the Processor)


moredouble

protected boolean moredouble
There is a double list of items (from the Processor)


sel

protected boolean sel
if true there is a Selected item


vertical

protected boolean vertical
The Item list should be VERTICAL (a <BR> tag should be added)


horizontal

protected boolean horizontal
The Item list should be HORIZONTAL This is default


empty

protected boolean empty
The EMPTY tag is present in the macro. There should be a EMPTY SELECTION OPTION item added to the list


proc

protected boolean proc
The PROC tag is present in the macro. The processor will be called and should return a Vector with items


procdouble

protected boolean procdouble
The DOUBLE tag is present in the macro. The processor will be called and should return a Vector with items pairs 1st = item1a, 2nd= item1b, 3th=item2a, 4th=item 2b, etc


user

protected java.lang.String user
The user name that is currently acessing this page


sp

protected scanpage sp
page from this request

Constructor Detail

HTMLElement

public HTMLElement()
empty

Method Detail

generateHTML

protected java.lang.String generateHTML(scanpage sp,
                                        ProcessorInterface proc,
                                        java.util.Vector macro)
Calls the parser and returns the String returned by generate.


generate

protected abstract java.lang.String generate()
Should be implemented by the subclass and and should return the generated HTML.


parse

protected boolean parse(java.util.Vector macro)
Reads the Vector and fills all the variables if the corespondending variables.


getType

protected java.lang.String getType(java.lang.String str)
Returns the part in front of the '=' char of the String.


getValue

protected java.lang.String getValue(java.lang.String str)
Returns the part after the '=' char of the String.



MMBase build 1.7.1.20041002