Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.actions
Class ElexisEvent

java.lang.Object
  extended by ch.elexis.actions.ElexisEvent
All Implemented Interfaces:
java.lang.Comparable<ElexisEvent>

public final class ElexisEvent
extends java.lang.Object
implements java.lang.Comparable<ElexisEvent>

A universal event object. Can optionally created with a priority Note: Note: this class has a natural ordering that is inconsistent with equals

Author:
gerry

Field Summary
static int EVENT_CREATE
          The Object was newly created
static int EVENT_DELETE
          The object is about to be deleted
static int EVENT_DESELECTED
          All Objects of this type have been deselected
static int EVENT_MANDATOR_CHANGED
          the mandator changed
static int EVENT_RELOAD
          All Objects of this class have been reloaded
static int EVENT_SELECTED
          The Object has been selected
static int EVENT_UPDATE
          The object has changed some of its properties
static int EVENT_USER_CHANGED
          a user logged out or logged in
static int PRIORITY_HIGH
           
static int PRIORITY_LOW
           
static int PRIORITY_NORMAL
           
 
Constructor Summary
ElexisEvent(PersistentObject o, java.lang.Class<?> c, int type)
          Create an ElexisEvent with default priority
ElexisEvent(PersistentObject o, java.lang.Class<?> c, int type, int priority)
          Create an ElexisEvent with explicitely set priority
 
Method Summary
 int compareTo(ElexisEvent o)
           
static ElexisEvent createPatientEvent()
          Shortcut to create a "Patient changed" event
static ElexisEvent createUserEvent()
          Shortcut to create a "User Changed" event
 PersistentObject getObject()
          Retrieve the object this event is about.
 java.lang.Class<?> getObjectClass()
          Retrieve the class this event is about
 int getType()
          Retrieve the event type
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_CREATE

public static final int EVENT_CREATE
The Object was newly created

See Also:
Constant Field Values

EVENT_DELETE

public static final int EVENT_DELETE
The object is about to be deleted

See Also:
Constant Field Values

EVENT_UPDATE

public static final int EVENT_UPDATE
The object has changed some of its properties

See Also:
Constant Field Values

EVENT_RELOAD

public static final int EVENT_RELOAD
All Objects of this class have been reloaded

See Also:
Constant Field Values

EVENT_SELECTED

public static final int EVENT_SELECTED
The Object has been selected

See Also:
Constant Field Values

EVENT_DESELECTED

public static final int EVENT_DESELECTED
All Objects of this type have been deselected

See Also:
Constant Field Values

EVENT_USER_CHANGED

public static final int EVENT_USER_CHANGED
a user logged out or logged in

See Also:
Constant Field Values

EVENT_MANDATOR_CHANGED

public static final int EVENT_MANDATOR_CHANGED
the mandator changed

See Also:
Constant Field Values

PRIORITY_HIGH

public static final int PRIORITY_HIGH
See Also:
Constant Field Values

PRIORITY_NORMAL

public static final int PRIORITY_NORMAL
See Also:
Constant Field Values

PRIORITY_LOW

public static final int PRIORITY_LOW
See Also:
Constant Field Values
Constructor Detail

ElexisEvent

public ElexisEvent(PersistentObject o,
                   java.lang.Class<?> c,
                   int type)
Create an ElexisEvent with default priority

Parameters:
o - the PersistentObject that sources the event
c - The object classs of the event source
type - the type of Event. One of the EVENT_ constants

ElexisEvent

public ElexisEvent(PersistentObject o,
                   java.lang.Class<?> c,
                   int type,
                   int priority)
Create an ElexisEvent with explicitely set priority

Parameters:
o - the PersistentObject that sources the event
c - The object classs of the event source
type - the type of Event. One of the EVENT_ constants
priority - the priority for this event. One of the PRIORITY_ Constants or any other int value. An Event will be fired before all other events with same or lower priority.
Method Detail

getObject

public PersistentObject getObject()
Retrieve the object this event is about.

Returns:
the object that might be null (if the event concern a class)

getObjectClass

public java.lang.Class<?> getObjectClass()
Retrieve the class this event is about

Returns:
the class (that might be null)

getType

public int getType()
Retrieve the event type

Returns:
one ore more of the oabove EVENT_xxx flags

createUserEvent

public static ElexisEvent createUserEvent()
Shortcut to create a "User Changed" event

Returns:

createPatientEvent

public static ElexisEvent createPatientEvent()
Shortcut to create a "Patient changed" event

Returns:

compareTo

public int compareTo(ElexisEvent o)
Specified by:
compareTo in interface java.lang.Comparable<ElexisEvent>

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis