|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.data.LyContext
public class LyContext
This class represents a context managed by the context manager. A context is associated with a user session (LyDataSession).
LyObject
,
LyOperation
,
LyContextManager
Nested Class Summary | |
---|---|
static class |
LyContext.Position
Indicates the insertion positions of the operations of this context into the parent operation list. |
static class |
LyContext.Status
Status of the context. |
static class |
LyContext.Type
Type of the context. |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version. |
Method Summary | |
---|---|
void |
addSon(LyContext son)
Adds a son to the list of sons of this context. |
void |
addUserOperation(LyUserOperationInterface callback,
LyObject object,
java.lang.Object userData)
|
LyContext.Status |
commit()
To commit the context. |
LyResponse |
createObject(LyObject object)
Create a new object in this context. |
LyResponse |
deleteObject(LyObject object)
Delete an object in this context. |
void |
disableEvents()
To disable the events sending. |
void |
disableUndo()
Marks this context as ignored for undo/redo by the context manager. |
void |
disableUpdateRelations()
To disable the relations update. |
void |
enableControl(int control,
boolean enable)
Enable/Disable the given control on objects in this context. |
void |
enableEvents(boolean enable)
To enable/disable the events sending. |
short |
getErrorLevel()
Checks if this context has errors. |
java.lang.String |
getErrorMessage()
Accessor to the error message produced on last operation sent. |
java.util.Vector<LyError> |
getErrors(short level)
Gets the list of errors on objects with the specified level. |
java.util.Collection<LyContext> |
getInternalSons()
To get all the internal sons context of this context. getInternalSons() is for internal use, applications should use getSons() instead. |
java.util.Collection<LyContext> |
getInternalSons(boolean allInternalAndOthers)
To get all the internal sons context of this context. getInternalSons() is for internal use, applications should use getSons() instead. |
java.util.Vector<LyObject> |
getObjectsInError()
Gets the list of objects updated by this context and its sons with LEVEL_ERROR errors. |
java.util.ArrayList<LyOperation> |
getOperations()
Get the list of operations of this context. |
LyContext |
getParent()
Accessor to the parent of this context. |
LyContext |
getRootContext()
Gets the root context of this context. |
LyDataSession |
getSession()
Accessor to the associated user session. |
java.util.Collection<LyContext> |
getSons()
To get all the sons of this context. |
LyContext.Status |
getStatus()
Accessor to the current status. |
LyContext.Type |
getType()
Accessor to the type of this context. |
boolean |
isAlreadyCreated(LyObject object)
Check if the specified object has already been created in this context or in another comitted context. |
boolean |
isEmpty()
Checks if this context is empty or not (i.e. has operations or not). |
boolean |
isEnded()
Tests if this context has been committed or rollbacked. |
boolean |
isOnlyLocal()
Getter of the _onlyLocal attribute. |
boolean |
isRedoAvailable()
To test if a redo operation can be done. |
boolean |
isSon(LyContext context)
Tests if the specified context is a son of this context. |
boolean |
isUndoAvailable()
To test if an undo operation can be done. |
void |
redo()
Redo the last operation undone in this context. |
void |
rehash(java.util.Collection<LyObject> objects)
To rehash a colection of LyObjects. |
void |
rehash(LyObject object)
To rehash a LyObject. |
void |
rollback()
Rollback the current context. |
void |
sendEvents()
This method send all pending operations locally to update objects. |
void |
sendUserEvent(LyObject object,
LyAdvancedDataSourceEvent userEvent)
Send an user evetn in this context. |
void |
setHidden(LyObject object,
boolean state)
Set the hidden state of an object in this context. |
void |
setIgnoreUndo(boolean ignore)
To mark operation as undo ignore. |
void |
setInsertPosition(LyContext.Position position)
Indicates if the operations of this context must be inserted at the beginning of the parent operations or at the end. |
void |
setInternal()
Marks this context as internal. |
void |
setKeepOrder(boolean keepOrder)
To force the context to keep (or not) the order of its sons operations. |
void |
setLinkUndo(boolean link)
To mark operations as linked for undo/redo. |
void |
setListener(LyContextListener listener)
Sets listener of this context. |
void |
setName(java.lang.String name)
Modifier of the name of this context. |
LyResponse |
setObject(LyObject object)
Set an object in this context. |
void |
setOnlyLocal(boolean onlyLocal)
To force or not all operations in this context to be only local. |
void |
setSelected(LyObject object,
boolean state)
Set the selection state of an object in this context. |
void |
setValue(LyObject object,
LyFieldInfo fieldInfo,
java.lang.Object value)
Set a value for an object in this context. |
void |
setValue(LyObject object,
LyValue value)
Set a value for an object in this context. |
void |
setValue(LyObject object,
java.lang.String fieldId,
java.lang.Object value)
Set a value for an object in this context. |
void |
setValues(LyObject object,
LyValueSet values)
Set values for an object in this context. |
java.lang.String |
toString()
Gets this object as a string. |
void |
undo()
Undo the last operation of this context. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Method Detail |
---|
public final LyContext.Status getStatus()
public boolean isEnded()
public final LyDataSession getSession()
public final LyContext.Type getType()
public LyContext getParent()
public void setName(java.lang.String name)
name
- The new name of this context.public final java.lang.String getErrorMessage()
public void disableUndo()
public void setInternal()
public void setListener(LyContextListener listener)
listener
- a context listenerpublic void addSon(LyContext son)
son
- The son to add
java.lang.IllegalStateException
- if the son has another parent context.
java.lang.IllegalArgumentException
- if the types of the current context and the specified
context are not compatible.public java.util.Collection<LyContext> getSons()
public java.util.Collection<LyContext> getInternalSons()
public java.util.Collection<LyContext> getInternalSons(boolean allInternalAndOthers)
allInternalAndOthers
- all sons whatever they are internal or not
public boolean isSon(LyContext context)
context
- The context to test
public LyContext getRootContext()
public java.util.ArrayList<LyOperation> getOperations()
public void sendEvents()
public LyContext.Status commit()
java.lang.IllegalStateException
- if the context has some sons contexts.public void rollback()
public LyResponse deleteObject(LyObject object)
object
- Object to delete.
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
deletionLyObject.delete(boolean)
public LyResponse createObject(LyObject object)
object
- Object to create.
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
creationLyObject.create(boolean)
public LyResponse setObject(LyObject object)
object
- Object to modify.
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
modificationLyObject.set(boolean)
public void setValue(LyObject object, java.lang.String fieldId, java.lang.Object value)
object
- Object to modify.fieldId
- Name of the fieldInfo to set.value
- The value for this fieldInfo.
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
modificationpublic void setValue(LyObject object, LyFieldInfo fieldInfo, java.lang.Object value)
object
- Object to modify.fieldInfo
- The fieldInfo to set.value
- The value for this fieldInfo.
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
modificationpublic void setValue(LyObject object, LyValue value)
object
- Object to modify.value
- The value to set
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
modificationpublic void setValues(LyObject object, LyValueSet values)
object
- Object to modify.values
- The values to set
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED.
LyIllegalOperationException
- if this context has not the rights to do the
modificationpublic void setSelected(LyObject object, boolean state)
object
- Object to modify.state
- The new selection state
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED or if the object does'nt exist.public void setHidden(LyObject object, boolean state)
object
- Object to modify.state
- The new hidden state
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED or if the object does'nt exist.public void sendUserEvent(LyObject object, LyAdvancedDataSourceEvent userEvent)
object
- Object concerned by the event.userEvent
- The event to send
java.lang.IllegalStateException
- if the context has the status Status.ROLLBACKED or
STATUS_COMPLETED or if the object does'nt exist.public void setIgnoreUndo(boolean ignore)
ignore
- true to ignore operations for undo, false otherwise.public void setKeepOrder(boolean keepOrder)
keepOrder
- true to keep the order of the sons operation INTERNAL USE ONLYpublic void setInsertPosition(LyContext.Position position)
position
- the insertion position. INTERNAL USE ONLYpublic void setLinkUndo(boolean link)
link
- true to link operations, false otherwise.public boolean isUndoAvailable()
public boolean isRedoAvailable()
public void undo()
public void redo()
public short getErrorLevel()
public java.util.Vector<LyObject> getObjectsInError()
public java.util.Vector<LyError> getErrors(short level)
level
- Level of the errors
public java.lang.String toString()
toString
in class java.lang.Object
public void enableControl(int control, boolean enable)
control
- Control that is enabled or disabled (see LyObject.CONTROL_XXX).enable
- Boolean indicating if the control is enabled or disabled.public boolean isAlreadyCreated(LyObject object)
object
- The object ot test.
public void disableUpdateRelations()
public final void disableEvents()
public void enableEvents(boolean enable)
enable
- Boolean that indicates if events are enabled or disabled.public void rehash(java.util.Collection<LyObject> objects)
objects
- The collection of LyObject to rehash.public void rehash(LyObject object)
object
- The object to rehash.public void setOnlyLocal(boolean onlyLocal)
onlyLocal
- true to force operations to be local, false otherwise.public boolean isOnlyLocal()
public boolean isEmpty()
public void addUserOperation(LyUserOperationInterface callback, LyObject object, java.lang.Object userData)
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |