LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data.daemon
Class LyLabelDaemon

java.lang.Object
  extended by leon.data.daemon.LyDaemon
      extended by leon.data.daemon.LyLabelDaemon
All Implemented Interfaces:
LyLabelDaemonListener, LyDataSourceListener, LyWorkSpaceCounterListener, LyWorkSpaceListener

public class LyLabelDaemon
extends LyDaemon
implements LyWorkSpaceListener, LyWorkSpaceCounterListener, LyLabelDaemonListener

Daemon for updating dynamic labels.


Field Summary
static java.lang.String __VERSION
          File version.
 
Constructor Summary
LyLabelDaemon(LyClassInfo sourceClass, LyInfoLabel label)
          Default constructor.
LyLabelDaemon(LyClassInfo sourceClass, LyInfoLabel label, LyLabelDaemonListener listener)
          Constructor of a label daemon with a specific listener.
 
Method Summary
 void addListener(LyLabelDaemonListener listener)
          Adds a listener of this daemon.
 java.lang.String computeString(LyObject object)
          Compute the label for the given object.
 boolean counterChanged(LyWorkSpaceEvent event)
          Called when the counter associated with the specified object has been incremented.
 LyInfoLabel getInfoLabel()
          Accessor to the label managed by this daemon.
 LyLabelDaemonListener getListener(int index)
          Get listener of this daemon at the given position.
 int getListenerCount()
          Get listeners count of this daemon.
 java.util.Vector<LyLabelDaemonListener> getListeners()
          Get listeners of this daemon.
 java.lang.String getString(LyObject object)
          To get the relation value for the specified object.
 void idRehashed(LyObjectId oldObjectId, LyObjectId newObjectId)
          Called when objectId of an object has been changed.
 boolean objectAdded(LyWorkSpaceEvent event)
          Called when an object is added in the dynamic object list.
 boolean objectChanged(LyWorkSpaceEvent event)
          Called when an object has changed in the dynamic object list.
 boolean objectCreated(LyDataSourceEvent event)
          Method for object creation callback.
 boolean objectDeleted(LyDataSourceEvent event)
          Method for object deletion callback.
 boolean objectModified(LyDataSourceEvent event)
          Method for object modification callback.
 boolean objectRemoved(LyWorkSpaceEvent event)
          Called when an object is removed from the dynamic object list.
 void refresh(LyObject object, LyInfoList<LyFieldInfo> fields)
          Method called when a refresh is requiered.
 void removeListener(LyLabelDaemonListener listener)
          Removes a listener from this daemon.
 void removeResult(LyObject object)
          Remove an object from our objects list.
 void unload()
          Unload daemon.
 
Methods inherited from class leon.data.daemon.LyDaemon
getInfo, getSourceClass
 
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
Constructor Detail

LyLabelDaemon

public LyLabelDaemon(LyClassInfo sourceClass,
                     LyInfoLabel label)
Default constructor.

Parameters:
sourceClass - Class that contains the label.
label - The label to watch on.

LyLabelDaemon

public LyLabelDaemon(LyClassInfo sourceClass,
                     LyInfoLabel label,
                     LyLabelDaemonListener listener)
Constructor of a label daemon with a specific listener.

Parameters:
sourceClass - Class that contains the label.
label - The label to watch on.
listener - the label daemon listener
Method Detail

getInfoLabel

public LyInfoLabel getInfoLabel()
Accessor to the label managed by this daemon.

Returns:
the label handled by this daemon

getString

public java.lang.String getString(LyObject object)
To get the relation value for the specified object.

Parameters:
object - the object to compute
Returns:
the label value

computeString

public java.lang.String computeString(LyObject object)
Compute the label for the given object.

Parameters:
object - the object
Returns:
the label

removeResult

public void removeResult(LyObject object)
Remove an object from our objects list.

Parameters:
object - the object to remove

unload

public void unload()
Unload daemon.

Overrides:
unload in class LyDaemon

objectCreated

public boolean objectCreated(LyDataSourceEvent event)
Method for object creation callback.

Specified by:
objectCreated in interface LyDataSourceListener
Overrides:
objectCreated in class LyDaemon
Parameters:
event - the datasource event
Returns:
true if this event was handled
See Also:
LyDataSourceListener.objectCreated(leon.data.LyDataSourceEvent)

objectDeleted

public boolean objectDeleted(LyDataSourceEvent event)
Method for object deletion callback.

Specified by:
objectDeleted in interface LyDataSourceListener
Overrides:
objectDeleted in class LyDaemon
Parameters:
event - the datasource event
Returns:
true if this event was handled
See Also:
LyDataSourceListener.objectDeleted(leon.data.LyDataSourceEvent)

objectModified

public boolean objectModified(LyDataSourceEvent event)
Method for object modification callback.

Specified by:
objectModified in interface LyDataSourceListener
Overrides:
objectModified in class LyDaemon
Parameters:
event - the datasource event
Returns:
true if this event was handled
See Also:
LyDataSourceListener.objectModified(leon.data.LyDataSourceEvent)

objectAdded

public boolean objectAdded(LyWorkSpaceEvent event)
Called when an object is added in the dynamic object list.

Specified by:
objectAdded in interface LyWorkSpaceListener
Parameters:
event - event of adding object
Returns:
the event is used by the listener

objectRemoved

public boolean objectRemoved(LyWorkSpaceEvent event)
Called when an object is removed from the dynamic object list.

Specified by:
objectRemoved in interface LyWorkSpaceListener
Parameters:
event - event of removing object
Returns:
the event is used by the listener

counterChanged

public boolean counterChanged(LyWorkSpaceEvent event)
Called when the counter associated with the specified object has been incremented.

Specified by:
counterChanged in interface LyWorkSpaceCounterListener
Parameters:
event - Object on which the was incremented.
Returns:
True if the event is used by the listener, false otherwise.

objectChanged

public boolean objectChanged(LyWorkSpaceEvent event)
Called when an object has changed in the dynamic object list.

Specified by:
objectChanged in interface LyWorkSpaceListener
Parameters:
event - event of changing object
Returns:
the event is used by the listener

addListener

public void addListener(LyLabelDaemonListener listener)
Adds a listener of this daemon.

Parameters:
listener - The listener of this daemon.

removeListener

public void removeListener(LyLabelDaemonListener listener)
Removes a listener from this daemon.

Parameters:
listener - The listener of this daemon.

getListeners

public java.util.Vector<LyLabelDaemonListener> getListeners()
Get listeners of this daemon.

Returns:
The listeners of this daemon.

getListener

public LyLabelDaemonListener getListener(int index)
Get listener of this daemon at the given position.

Parameters:
index - index of the requested listener.
Returns:
The listeners of this daemon.

getListenerCount

public int getListenerCount()
Get listeners count of this daemon.

Returns:
The number of listeners of this daemon.

refresh

public void refresh(LyObject object,
                    LyInfoList<LyFieldInfo> fields)
Method called when a refresh is requiered.

Specified by:
refresh in interface LyLabelDaemonListener
Parameters:
object - Object to refresh.
fields - Impacted fields (may be null).

idRehashed

public void idRehashed(LyObjectId oldObjectId,
                       LyObjectId newObjectId)
Called when objectId of an object has been changed. This method must update tables with references to objectIds.

Specified by:
idRehashed in class LyDaemon
Parameters:
oldObjectId -
newObjectId -

(c) January 2013 - W4 S.A.

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