java.lang.Object
com.voytechs.html.event.Dispatcher
com.voytechs.html.event.HtmlDispatcher
Direct Known Subclasses: ServletDispatcher
public class HtmlDispatcher extends Dispatcher
Fields inherited from class com.voytechs.html.event.Dispatcher
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
EVENT_SUBMIT_MASK
public static final int EVENT_SUBMIT_MASK
See Also: Constant Field Values
EVENT_PASSWORD_MASK
public static final int EVENT_PASSWORD_MASK
See Also: Constant Field Values
EVENT_TEXTAREA_MASK
public static final int EVENT_TEXTAREA_MASK
See Also: Constant Field Values
EVENT_TEXTFIELD_MASK
public static final int EVENT_TEXTFIELD_MASK
See Also: Constant Field Values
EVENT_LIST_MASK
public static final int EVENT_LIST_MASK
See Also: Constant Field Values
EVENT_CHECKED_MASK
public static final int EVENT_CHECKED_MASK
See Also: Constant Field Values
EVENT_RADIO_MASK
public static final int EVENT_RADIO_MASK
See Also: Constant Field Values
EVENT_HIDDEN_MASK
public static final int EVENT_HIDDEN_MASK
See Also: Constant Field Values
EVENT_LINK_MASK
public static final int EVENT_LINK_MASK
See Also: Constant Field Values
EVENT_DEFAULT_MASK
public static final int EVENT_DEFAULT_MASK
See Also: Constant Field Values
eventTypeStrings
private java.util.Hashtable eventTypeStrings
eventTypeIDs
private java.util.Hashtable eventTypeIDs
HtmlDispatcher
public HtmlDispatcher ()
init
private void init ()
Initialize the various HTML related event types that we
support.
Submit button press
Reset button press
Text area
Text field
List box
Check boxes
Radio boxes
Hidden input field (way of passing hidden info)
Link - Hypertext link
Default parameters which are none of the above
registerEventType
protected void registerEventType (int eventType,
char eventAbr)
Register/create a new event type so it can be known and encoded.
scanEvent
public void scanEvent (java.lang.Object source)
throws EventException
Scan source object in form of Properties.
Specified by: scanEvent in class Dispatcher
dispatchEvent
protected void dispatchEvent (ListenerIf listener,
Event event,
java.lang.Object data)
throws EventException
Dispatches event to a proper listener.
Specified by: dispatchEvent in class Dispatcher
decodeParam
protected HtmlEvent decodeParam (java.lang.String param,
java.lang.String [] value)
throws EventException
decode an encoded parameter from Properties object. In essence
a where param is a specially encoded, uniq
string which encodes information as to the type of the object. These are mapped
a uniq integer ID which the dispatcher uses to hash entries for.
Encoding is as follows: [type]_[id]
where type is a one letter string representing the type of element on the form and
id is uniq integer ID associated with that instance of the form element.
encodeParam
protected java.lang.String encodeParam (int eventType,
int id)
throws EventException
decode an encoded parameter from Properties object. In essence
a where param is a specially encoded, uniq
string which encodes information as to the type of the object. These are mapped
a uniq integer ID which the dispatcher uses to hash entries for.
Encoding is as follows: [type]_[id]
where type is a one letter string representing the type of element on the form and
id is uniq integer ID associated with that instance of the form element.
generateUniqName
public java.lang.String generateUniqName (int eventType,
int id)
throws EventException
Generate a uniq name based on event type and id.
main
public static void main (java.lang.String [] args)
Test function for HtmlDispatcher