public class TLspEditOperationResult extends Object
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.
Modifier and Type | Field and Description |
---|---|
static TLspEditOperationResult |
FAILED
Predefined result indicating that the operation failed.
|
static TLspEditOperationResult |
SUCCESS
Predefined result indicating that the operation succeeded.
|
static TLspEditOperationResult |
SUCCESS_HANDLES_INVALID
Predefined result indicating that the operation succeeded, but edit
handles have become invalid.
|
Constructor and Description |
---|
TLspEditOperationResult()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
ILcdUndoable |
getUndoable()
Returns an undoable (or null if the edit operation didn't result in an undoable operation)
|
boolean |
isHandlesInvalid()
Indicates whether edit handles have become invalid after this edit operation.
|
boolean |
isSuccessful()
Indicates whether the edit operation was successful or not.
|
public static final TLspEditOperationResult FAILED
public static final TLspEditOperationResult SUCCESS
public static final TLspEditOperationResult SUCCESS_HANDLES_INVALID
public TLspEditOperationResult()
public TLspEditOperationResult(boolean aSuccessful, boolean aHandlesInvalid)
aSuccessful
- whether or not the operation was successfulaHandlesInvalid
- whether or not edit handles became invalid because of the operationpublic TLspEditOperationResult(boolean aSuccessful, boolean aHandlesInvalid, ILcdUndoable aUndoable)
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.public ILcdUndoable getUndoable()
public boolean isSuccessful()
public boolean isHandlesInvalid()