LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyClassWorkSpace

java.lang.Object
  extended by leon.data.LyObjectList
      extended by leon.data.LyWorkSpace
          extended by leon.data.LyClassWorkSpace
All Implemented Interfaces:
LyGetSessionInterface, LyAdvancedDataSourceListener, LyDataSourceListener
Direct Known Subclasses:
LyPageWorkSpace

public class LyClassWorkSpace
extends LyWorkSpace

This class implements a class workspace : workspace for objects belonging to a given class info and optionnally, matching a filter.

See Also:
LyClassInfo, LyFilter

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, boolean dynamic)
          Constructs a class workspace within a given session for a class info.
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, LyFilter filter, boolean dynamic)
          Constructs a class workspace within a given session for a class info with specified filter applied to objects of this class.
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, LyFilter filter, LySort sort, boolean dynamic)
          Constructs a class workspace within a given session for a class info with specified filter applied to objects of this class and sorted by the given sort.
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, LyFilter filter, LySort sort, boolean dynamic, boolean sorted)
          Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, LyInfoList<LyFieldInfo> fieldInfos, LyFilter filter, LySort sort, boolean dynamic, boolean sorted)
          Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.
LyClassWorkSpace(LyDataSession session, LyClassInfo classInfo, LyInfoList<LyFieldInfo> fieldInfos, LyFilter filter, LySort sort, boolean dynamic, boolean sorted, boolean local)
          Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.
 
Method Summary
 LyInfoList<LyClassInfo> getClasses()
          Return the list of all class infos to which objects of this workspace belong.
 LyClassInfo getClassInfo()
          Gets class info to which objects of this workspace belong.
 LyInfoList<LyFieldInfo> getFieldInfos()
          Gets list of fieldinfos to load.
 LyFilter getFilter()
          Gets the filter of this class workspace.
 LyObjectSource getObjectSource()
          Gets object source from which objects of this workspace are loaded.
 boolean objectCreated(LyDataSourceEvent event)
          Method for receiving an object creation.
 boolean objectModified(LyDataSourceEvent event)
          Method for receiving an object modification.
 boolean objectStateChanged(LyAdvancedDataSourceEvent event)
          Called when an object state is changed.
 boolean objectUserEvent(LyAdvancedDataSourceEvent event)
          Method for receiving user event on an object.
 void reset()
          Method for resetting this workspace.
 void setFieldInfos(LyInfoList<LyFieldInfo> fields)
          Sets list of fieldinfos to load.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class leon.data.LyWorkSpace
addList, addListener, dataSourceEventsGrouped, free, getListener, getListenerCount, getSession, getSources, isDynamic, isLocal, lock, objectDeleted, removeListener, unlock
 
Methods inherited from class leon.data.LyObjectList
contains, delete, delete, equals, equals, getIndex, getIntersection, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getList, getObject, getObject, getObject, getObjects, getSize, getSize, getSort, getSortedList, indexOf, intersects, isEmpty, isSorted, iterator, set, setSort, setSortByName, setSorted, toObjectIds
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        boolean dynamic)
Constructs a class workspace within a given session for a class info.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
dynamic - Specifies if this workspace is dynamic or not.

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        LyFilter filter,
                        boolean dynamic)
Constructs a class workspace within a given session for a class info with specified filter applied to objects of this class.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
dynamic - Specifies if this workspace is dynamic or not.

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        LyFilter filter,
                        LySort sort,
                        boolean dynamic)
Constructs a class workspace within a given session for a class info with specified filter applied to objects of this class and sorted by the given sort.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        LyFilter filter,
                        LySort sort,
                        boolean dynamic,
                        boolean sorted)
Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.
sorted - Indicates if this workspace is sorted or not.

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        LyInfoList<LyFieldInfo> fieldInfos,
                        LyFilter filter,
                        LySort sort,
                        boolean dynamic,
                        boolean sorted)
Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
fieldInfos - List of the fieldinfos to load.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.
sorted - Indicates if this workspace must be sorted or not.

LyClassWorkSpace

public LyClassWorkSpace(LyDataSession session,
                        LyClassInfo classInfo,
                        LyInfoList<LyFieldInfo> fieldInfos,
                        LyFilter filter,
                        LySort sort,
                        boolean dynamic,
                        boolean sorted,
                        boolean local)
Internal constructor with all parameters for construction of a class workpace and an additionnal one that indicates if the workspace is loaded or not.

Parameters:
session - Session in which the workspace is constructed.
classInfo - Class info to which objects of this workspace belong.
fieldInfos - List of the fieldinfos to load.
filter - Filter applied to objects for being in this workspace.
sort - Sort requested in this workspace.
dynamic - Specifies if this workspace is dynamic or not.
sorted - Indicates if this workspace must be sorted or not.
local - Specifies if this workspace is local or not.
Method Detail

getClasses

public LyInfoList<LyClassInfo> getClasses()
Return the list of all class infos to which objects of this workspace belong. This method is overriden to optimize it since we known from start to which class the objects of this workspace belong.

Specified by:
getClasses in class LyObjectList
Returns:
List of classes to which objects of this workspace belong. For this type of workspace, the result list will always contain only one class.

getClassInfo

public LyClassInfo getClassInfo()
Gets class info to which objects of this workspace belong.

Returns:
Class info specified for this workspace.

getFilter

public LyFilter getFilter()
Gets the filter of this class workspace.

Returns:
Filter specified for this class workspace.

getObjectSource

public LyObjectSource getObjectSource()
Gets object source from which objects of this workspace are loaded.

Returns:
Object source of this workspace.

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos()
Gets list of fieldinfos to load.

Returns:
An info list containing fields to load.

reset

public void reset()
Method for resetting this workspace. Objects contained in this workspace are removed and reloaded from the object source of the class info specified for this workspace.

Overrides:
reset in class LyWorkSpace

setFieldInfos

public void setFieldInfos(LyInfoList<LyFieldInfo> fields)
Sets list of fieldinfos to load.

Parameters:
fields - An info list containing fields to load.

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class LyObjectList
Returns:
This workspace returned as a string.

objectCreated

public boolean objectCreated(LyDataSourceEvent event)
Method for receiving an object creation. This method is overriden to check if the object matchs the filter specified on this workspace if it has one.

Specified by:
objectCreated in interface LyDataSourceListener
Overrides:
objectCreated in class LyWorkSpace
Parameters:
event - Event notifying the creation of an object.
Returns:
True indicating if the event was used, false otherwise.

objectModified

public boolean objectModified(LyDataSourceEvent event)
Method for receiving an object modification. If the object concerned by the event was not in this workspace, that means it didn't match its filter, so we now check if modifications done change this and in that case, we add the object in the workspace. On the contrary, if the object was in the workspace, we check if the object still matches the filter, and if not, we remove it from this workspace.

Specified by:
objectModified in interface LyDataSourceListener
Overrides:
objectModified in class LyWorkSpace
Parameters:
event - Event notifying the modification of an object.
Returns:
True indicating if the event was used, false otherwise.

objectStateChanged

public boolean objectStateChanged(LyAdvancedDataSourceEvent event)
Called when an object state is changed.

Specified by:
objectStateChanged in interface LyAdvancedDataSourceListener
Overrides:
objectStateChanged in class LyWorkSpace
Parameters:
event - Event notifying object state change.
Returns:
True if the event is used by the listener, false otherwise.

objectUserEvent

public boolean objectUserEvent(LyAdvancedDataSourceEvent event)
Method for receiving user event on an object.

Specified by:
objectUserEvent in interface LyAdvancedDataSourceListener
Overrides:
objectUserEvent in class LyWorkSpace
Parameters:
event - Event notifying the user event of an object.
Returns:
True indicating if the event was used, false otherwise.

(c) January 2013 - W4 S.A.

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