Class TLspEditOperationResult

java.lang.Object
com.luciad.view.lightspeed.editor.operation.TLspEditOperationResult

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.

Since:
2012.0
  • Field Details

    • FAILED

      public static final TLspEditOperationResult FAILED
      Predefined result indicating that the operation failed. Contains no undoable.
    • SUCCESS

      public static final TLspEditOperationResult SUCCESS
      Predefined result indicating that the operation succeeded. Edit handles are assumed to be valid. Contains no undoable.
    • SUCCESS_HANDLES_INVALID

      public static final TLspEditOperationResult 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 successful
      aHandlesInvalid - 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 successful
      aHandlesInvalid - whether or not edit handles became invalid because of the operation
      aUndoable - An undoable to undo the edit operation.
  • Method Details

    • getUndoable

      public ILcdUndoable 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