LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyEventManager

java.lang.Object
  extended by leon.data.LyEventManager

public class LyEventManager
extends java.lang.Object

This class is used to manage events in an application.

See Also:
LyDataSource, LyObjectSource, LyDataSourceEvent

Field Summary
static java.lang.String __VERSION
          File version
static java.lang.String NO_SESSION_LISTENERS
           
 
Constructor Summary
LyEventManager(LyApplication application)
          Constructs a transaction manager.
 
Method Summary
 void addErrorListener(LyErrorListener listener)
          To add an error listener to this event manager.
 void addListener(LyGlobalEventListener listener, short type)
          Registers a listener to receive global events of the given type.
 void addListener(LyObjectSource objectSource, LyDataSourceListener listener, short type)
          Registers a listener to receive events of the given type on objects contained within the specified object source.
 void addListener(LyObjectSource objectSource, LyDataSourceListener listener, java.util.Vector<LyField> fields)
          Registers a listener to receive modification events concerning given fields on objects contained within the specified object source.
 void groupEvents(java.lang.String groupId)
          Tells the manager to group all events for the specified group identifier.
 void postEvent(LyAdvancedDataSourceEvent event)
          Method to post a user event on an object.
 void postEvent(LyGlobalEvent event)
          Method to post a global event.
 void postGroupEvents(java.lang.String groupId)
          To post all events grouped for the specified group identifier.
 void removeErrorListener(LyErrorListener listener)
          Remove the specified listener from the list of error listener.
 void removeListener(LyGlobalEventListener listener)
          Unregisters a listener for global events.
 void removeListener(LyGlobalEventListener listener, short type)
          Unregisters a listener for global events for a given type.
 void removeListener(LyObjectSource objectSource, LyDataSourceListener listener)
          Unregisters a listener for notifications from an object source.
 void removeListener(LyObjectSource objectSource, LyDataSourceListener listener, short type)
          Unregisters a listener for notifications from an object source.
 void switchObjectSource(LyObjectSource oldSource, LyObjectSource newSource)
          Internal use only : An objectsource is replaced by another one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values

NO_SESSION_LISTENERS

public static final java.lang.String NO_SESSION_LISTENERS
Constructor Detail

LyEventManager

public LyEventManager(LyApplication application)
Constructs a transaction manager. Initialization is done with the init method.

Parameters:
application - Current application instance
Method Detail

addListener

public void addListener(LyObjectSource objectSource,
                        LyDataSourceListener listener,
                        short type)
Registers a listener to receive events of the given type on objects contained within the specified object source.

Parameters:
objectSource - The object source. If this parameter is null, the listener listens to all type of objects.
listener - New listener. To receive these events, the listener have to implement the LyDataSourceListener interface.
type - Indicates which type of event the listener wants to receive. Types are defined as constant in LyDataSourceEvent class : TYPE_CREATE, TYPE_SET, TYPE_DELETE
Throws:
java.lang.IllegalArgumentException - If the listener is null or if the given type is unknown.

switchObjectSource

public void switchObjectSource(LyObjectSource oldSource,
                               LyObjectSource newSource)
Internal use only : An objectsource is replaced by another one. Swich the listeners to the new source

Parameters:
oldSource - the old object source
newSource - the new object source

addListener

public void addListener(LyObjectSource objectSource,
                        LyDataSourceListener listener,
                        java.util.Vector<LyField> fields)
Registers a listener to receive modification events concerning given fields on objects contained within the specified object source. Warning ! This method only registers the listener for modification events.

Parameters:
objectSource - The object source.
listener - New listener. To receive these events, the listener have to implement the LyDataSourceListener interface.
fields - List of fields on which the listener wants to be notified when they are modified.
Throws:
java.lang.IllegalArgumentException - If the listener is null.

removeListener

public void removeListener(LyObjectSource objectSource,
                           LyDataSourceListener listener)
Unregisters a listener for notifications from an object source. The given listener is unregistered for all types of events he has been registered for.

Parameters:
objectSource - The object source
listener - The listener which shall not receive further events.
Throws:
java.lang.IllegalArgumentException - If the listener is null or if it is not known as listener on this data source.

removeListener

public void removeListener(LyObjectSource objectSource,
                           LyDataSourceListener listener,
                           short type)
Unregisters a listener for notifications from an object source. The given listener is unregistered for the specified type of events he has been registered for.

Parameters:
objectSource - The object source
listener - The listener which shall not receive further events.
type - The type of event to be unregistered.
Throws:
java.lang.IllegalArgumentException - If the listener is null or if it is not known as listener on this data source or if the given type is unknown.

postEvent

public void postEvent(LyAdvancedDataSourceEvent event)
Method to post a user event on an object.

Parameters:
event - The event to post

addListener

public void addListener(LyGlobalEventListener listener,
                        short type)
Registers a listener to receive global events of the given type.

Parameters:
listener - New listener. To receive these events, the listener have to implement the LyGlobalEventListener interface.
type - Indicates which type of event the listener wants to receive. Types are defined as constant in LyGlobalEvent class : TYPE_ACTIVE_VIEW, TYPE_SELECTION
Throws:
java.lang.IllegalArgumentException - If the listener is null or if the given type is unknown.

removeListener

public void removeListener(LyGlobalEventListener listener)
Unregisters a listener for global events. The given listener is unregistered for all types of events he has been registered for.

Parameters:
listener - The listener which shall not receive further events.
Throws:
java.lang.IllegalArgumentException - If the listener is null or if it is not known as listener.

removeListener

public void removeListener(LyGlobalEventListener listener,
                           short type)
Unregisters a listener for global events for a given type. The given listener is unregistered for the specified type of events he has been registered for.

Parameters:
listener - The listener which shall not receive further events.
type - The type of events to be unregistered.
Throws:
java.lang.IllegalArgumentException - If the listener is null or if it is not known as listener or if the given type is unknown.

postEvent

public void postEvent(LyGlobalEvent event)
Method to post a global event.

Parameters:
event - The event to post

addErrorListener

public void addErrorListener(LyErrorListener listener)
To add an error listener to this event manager.

Parameters:
listener - The listener to add.

removeErrorListener

public void removeErrorListener(LyErrorListener listener)
Remove the specified listener from the list of error listener.

Parameters:
listener - The listener to remove.

groupEvents

public void groupEvents(java.lang.String groupId)
Tells the manager to group all events for the specified group identifier.

Parameters:
groupId - The group identifier.

postGroupEvents

public void postGroupEvents(java.lang.String groupId)
To post all events grouped for the specified group identifier.

Parameters:
groupId - The group identifier.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com