|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJob
ch.elexis.actions.ElexisEventDispatcher
public final class ElexisEventDispatcher
The Elexis event dispatcher system manages and distributes the information of changing, creating, deleting and selecting PersistentObjects. An event is fired when such an action occures. This might be due to a user interaction or to an non-interactive job. A view that handles user selection of PersistentObjects MUST fire an appropriate Event through ElexisEventdispatcher.getinstance().fire(ElexisEvent ee) Notification of deletion, modification and creation of PeristentObjects occurs transparently via the PersistentObject base class. A client that wishes to be informed on such events must register an ElexisEventListener. The catchElexisEvent() Method of this listener is called in a non-UI-thread an should be finished as fast as possible. If lengthy operations are neccessary, these must be sheduled in a separate thread, The Listener can specify objects, classes and event types it wants to be informed. If no such filter is given, it will be informed about all events.
Method Summary | |
---|---|
void |
addListeners(ElexisEventListener... els)
Add listeners for ElexisEvents. |
static void |
clearSelection(java.lang.Class<?> clazz)
inform the system, that no object of the specified type is selected anymore |
void |
dump()
|
void |
fire(ElexisEvent... ees)
Fire an ElexisEvent. |
static void |
fireSelectionEvent(PersistentObject po)
inform the system that an object has been selected |
static void |
fireSelectionEvents(PersistentObject... objects)
inform the system, that several objects have been selected |
static ElexisEventDispatcher |
getInstance()
|
static PersistentObject |
getSelected(java.lang.Class<?> template)
find the last selected object of a given type |
static Patient |
getSelectedPatient()
shortcut |
void |
registerDispatcher(java.lang.Class<? extends PersistentObject> eventClass,
IElexisEventDispatcher ied)
It is possible to register a dispatcher for a given class. |
static void |
reload(java.lang.Class<?> clazz)
inform the system, that all object of a specified class have to be reloaded from storage |
void |
removeListeners(ElexisEventListener... els)
remove listeners. |
void |
shutDown()
|
void |
unregisterDispatcher(java.lang.Class<? extends PersistentObject> ec,
IElexisEventDispatcher ied)
Unregister a previosly registered dispatcher |
static void |
update(PersistentObject po)
inform the system, that the specified object has changed some values or properties |
boolean |
waitUntilEventQueueIsEmpty(long millis)
Let the dispatcher Thread empty the queue. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ElexisEventDispatcher getInstance()
public void registerDispatcher(java.lang.Class<? extends PersistentObject> eventClass, IElexisEventDispatcher ied) throws ElexisException
eventClass
- A Subclass of PersistentObject the dispatcher will take care ofied
- the dispatcher to register
ElexisException
- if there is already a dispatcher registered for that class.public void unregisterDispatcher(java.lang.Class<? extends PersistentObject> ec, IElexisEventDispatcher ied) throws ElexisException
ec
- th class the dispatcher takes care ofied
- the dispatcher to unregister
ElexisException
- if the dispatcher was not registered, or if the class was registered with a
different dispatcherpublic void addListeners(ElexisEventListener... els)
el
- one ore more ElexisEventListeners that have to return valid values on
el.getElexisEventFilter()public void removeListeners(ElexisEventListener... els)
el
- The Listener to removepublic void fire(ElexisEvent... ees)
ee
- the event to fire.public static PersistentObject getSelected(java.lang.Class<?> template)
template
- tha class defining the object to find
public static void fireSelectionEvent(PersistentObject po)
po
- the object that is selected nowpublic static void fireSelectionEvents(PersistentObject... objects)
objects
- public static void clearSelection(java.lang.Class<?> clazz)
clazz
- the class of which selection was removedpublic static void reload(java.lang.Class<?> clazz)
clazz
- the clazz whose objects are invalidatedpublic static void update(PersistentObject po)
po
- the object that was modifiedpublic static Patient getSelectedPatient()
public void shutDown()
public boolean waitUntilEventQueueIsEmpty(long millis)
millis
- The time to wait bevor returning
public void dump()
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |