public interface PlatformEventManager
Definition of an interface for dealing with platform (i.e. a specific GUI library) specific events.
This interface defines the link between the generic event handling mechanism
provided by the form framework and the library specific event handling
support. A concrete implementation has to intercept native component events
and transform them into the generic event types. Then the transformed events
are passed to the FormEventManager
.
This interface defines only methods for registering and deregistering event
listeners of a certain type at a component defined by a
ComponentHandler
object. These methods will be called by the
FormEventManager
class, which will already perform some
synchronization and pre-processing. So it is guaranteed that synchronization
is performed on the form listener type, i.e. no listeners of the same type
will be added or removed concurrently. FormEventManager
will
further invoke the registerListener
method only once for a
combination of component handler and event listener type. This means that the
FormEventManager
instance is the only event listener for the
available components; is is itself responsible for multiplexing of event
notifications. These facts can be used by a concrete implementation for doing
some optimization.
Note: It cannot be guaranteed that all ComponentHandler
objects
passed to the methods defined by this interface have been created by the
current ComponentManager
. For instance, there can be other custom
handler implementations created by special tag handler classes. This may be
an issue for platform-specific implementations that expect the ComponentHandler
objects to be derived from a specific base class.
Modifier and Type | Method and Description |
---|---|
void |
registerListener(String name,
ComponentHandler<?> handler,
FormEventManager eventManager,
FormListenerType type)
Registers an event listener of the given type at the specified component.
|
void |
unregisterListener(String name,
ComponentHandler<?> handler,
FormEventManager eventManager,
FormListenerType type)
Removes an event listener of the given type from the specified component.
|
void registerListener(String name, ComponentHandler<?> handler, FormEventManager eventManager, FormListenerType type)
FormEventManager
then
registers itself as event listener so that it can multiplex incoming
events to all registered listeners.name
- the component's name (must be contained in the
FormEvent
objects generated by this implementation)handler
- the component handler of the affected componenteventManager
- the event manager that must be invoked when an event
occurstype
- the event listener typevoid unregisterListener(String name, ComponentHandler<?> handler, FormEventManager eventManager, FormListenerType type)
FormEventManager
when the last
event listener of the affected type deregisters from this component.name
- the name of the affected componenthandler
- the component handler of this componenteventManager
- the event managertype
- the event listener typeCopyright © 2016 The JGUIraffe Team. All rights reserved.