Class TLspEditOperationResult
Provides feedback about the operations performed by an editor. Notably, this includes an indication of whether or not the operation was successful.
Since 2012.1, TLspEditOperationResult
also contains an undoable
.
This undoable should be able to undo the edit operation that was applied. This undoable can be null
if the operation is either not undoable, or if the edit operation was too trivial to generate an
undoable for. The latter is usually the case when for instance the user is still interacting with
an object. You generally only create undoables when you stop interacting, not while you are interacting.
The various static convenience objects (SUCCESS
,
FAILED
and
SUCCESS_HANDLES_INVALID
) can be used for simple edit operation results that don't
contain undoables.
To create a result that contains an undoable, use the constructor
that contains an undoable argument.
- Since:
- 2012.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLspEditOperationResult
Predefined result indicating that the operation failed.static final TLspEditOperationResult
Predefined result indicating that the operation succeeded.static final TLspEditOperationResult
Predefined result indicating that the operation succeeded, but edit handles have become invalid. -
Constructor Summary
ConstructorDescriptionCreates a new edit operation result with default settings.TLspEditOperationResult
(boolean aSuccessful, boolean aHandlesInvalid) Creates a new edit handle result with the given settings.TLspEditOperationResult
(boolean aSuccessful, boolean aHandlesInvalid, ILcdUndoable aUndoable) Creates a new edit handle result with the given settings and an undoable. -
Method Summary
Modifier and TypeMethodDescriptionReturns an undoable (or null if the edit operation didn't result in an undoable operation)boolean
Indicates whether edit handles have become invalid after this edit operation.boolean
Indicates whether the edit operation was successful or not.
-
Field Details
-
FAILED
Predefined result indicating that the operation failed. Contains no undoable. -
SUCCESS
Predefined result indicating that the operation succeeded. Edit handles are assumed to be valid. Contains no undoable. -
SUCCESS_HANDLES_INVALID
Predefined result indicating that the operation succeeded, but edit handles have become invalid. Contains no undoable.
-
-
Constructor Details
-
TLspEditOperationResult
public TLspEditOperationResult()Creates a new edit operation result with default settings. The default settings are successful and valid handles. Contains no undoable. -
TLspEditOperationResult
public TLspEditOperationResult(boolean aSuccessful, boolean aHandlesInvalid) Creates a new edit handle result with the given settings. Contains no undoable.- Parameters:
aSuccessful
- whether or not the operation was successfulaHandlesInvalid
- whether or not edit handles became invalid because of the operation
-
TLspEditOperationResult
public TLspEditOperationResult(boolean aSuccessful, boolean aHandlesInvalid, ILcdUndoable aUndoable) Creates a new edit handle result with the given settings and an undoable.- Parameters:
aSuccessful
- whether or not the operation was successfulaHandlesInvalid
- whether or not edit handles became invalid because of the operationaUndoable
- An undoable to undo the edit operation.
-
-
Method Details
-
getUndoable
Returns an undoable (or null if the edit operation didn't result in an undoable operation)- Returns:
- an undoable, or null.
-
isSuccessful
public boolean isSuccessful()Indicates whether the edit operation was successful or not.- Returns:
- whether the edit operation was successful or not
-
isHandlesInvalid
public boolean isHandlesInvalid()Indicates whether edit handles have become invalid after this edit operation.- Returns:
- whether edit handles have become invalid after this edit operation
-