java.lang.Object
com.voytechs.html.event.DispatcherBroker
- Direct Known Subclasses:
- HtmlDispatcherBroker
- public abstract class DispatcherBroker
- extends java.lang.Object
Specialized container object for holding dispatcher
listeners. Because of dynamic binding of HTML components and
the dispatcher, addtion of listeners has to be delayed until
the dispatcher bound and initlizated otherwise the binding can't
occur. This object adapts to the HTML component special requirements
such as generating a URL acceptable parameters or HTML Form tags.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
id
private int id
eventType
private int eventType
listenerRequests
private java.util.Vector listenerRequests
dispatcher
private Dispatcher dispatcher
DispatcherBroker
public DispatcherBroker(int eventType)
- Initialized the broker.
setDispatcher
protected void setDispatcher(Dispatcher dispatcher)
throws EventException
- Sets the global dispatcher. Late bindings, adding
delayed listeners, etc. Called after the full component tree is built.
addListener
public void addListener(ListenerRequest request)
throws EventException
- Add listener. Can add listeners only after the init method is called which
means that all of the bindings to the dispatcher have already occured and
we can safely register our listener.
hasListenerRequests
protected boolean hasListenerRequests()
addDelayedListeners
protected void addDelayedListeners()
throws EventException
- Since event listeners are added in the constructor of the element, the
dispatcher isn't bound to the component at the time. The listeners are
added to a queue instead and only registered with the dispatcher from
the init() method which is called after the dispatcher is bound.
getId
public int getId()
throws EventException
- Get event ID
getEventType
public int getEventType()
- Get eventType.
main
public static void main(java.lang.String[] args)
- Test function for DispatcherBroker