Interface ITextOperationTarget

All Known Implementing Classes:
ProjectionViewer, SourceViewer, TextConsoleViewer, TextViewer

public interface ITextOperationTarget
Defines the target for text operations. canDoOperation informs the clients about the ability of the target to perform the specified operation at the current point in time. doOperation executes the specified operation.

In order to provide backward compatibility for clients of ITextOperationTarget, extension interfaces are used as a means of evolution. The following extension interfaces exist:

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Text operation code for copying the selected text to the clipboard.
    static final int
    Text operation code for moving the selected text to the clipboard.
    static final int
    Text operation code for deleting the selected text or if selection is empty the character at the right of the current position.
    static final int
    Text operation code for inserting the clipboard content at the current position.
    static final int
    Text operation code for prefixing the selected text block.
    static final int
    Text operation code for printing the complete text.
    static final int
    Text operation code for redoing the last undone edit command.
    static final int
    Text operation code for selecting the complete text.
    static final int
    Text operation code for shifting the selected text block to the left.
    static final int
    Text operation code for shifting the selected text block to the right.
    static final int
    Text operation code for removing the prefix from the selected text block.
    static final int
    Text operation code for undoing the last edit command.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canDoOperation(int operation)
    Returns whether the operation specified by the given operation code can be performed.
    void
    doOperation(int operation)
    Performs the operation specified by the operation code on the target.
  • Field Details

    • UNDO

      static final int UNDO
      Text operation code for undoing the last edit command.
      See Also:
    • REDO

      static final int REDO
      Text operation code for redoing the last undone edit command.
      See Also:
    • CUT

      static final int CUT
      Text operation code for moving the selected text to the clipboard.
      See Also:
    • COPY

      static final int COPY
      Text operation code for copying the selected text to the clipboard.
      See Also:
    • PASTE

      static final int PASTE
      Text operation code for inserting the clipboard content at the current position.
      See Also:
    • DELETE

      static final int DELETE
      Text operation code for deleting the selected text or if selection is empty the character at the right of the current position.
      See Also:
    • SELECT_ALL

      static final int SELECT_ALL
      Text operation code for selecting the complete text.
      See Also:
    • SHIFT_RIGHT

      static final int SHIFT_RIGHT
      Text operation code for shifting the selected text block to the right.
      See Also:
    • SHIFT_LEFT

      static final int SHIFT_LEFT
      Text operation code for shifting the selected text block to the left.
      See Also:
    • PRINT

      static final int PRINT
      Text operation code for printing the complete text.
      See Also:
    • PREFIX

      static final int PREFIX
      Text operation code for prefixing the selected text block.
      See Also:
    • STRIP_PREFIX

      static final int STRIP_PREFIX
      Text operation code for removing the prefix from the selected text block.
      See Also:
  • Method Details

    • canDoOperation

      boolean canDoOperation(int operation)
      Returns whether the operation specified by the given operation code can be performed.
      Parameters:
      operation - the operation code
      Returns:
      true if the specified operation can be performed
    • doOperation

      void doOperation(int operation)
      Performs the operation specified by the operation code on the target. doOperation must only be called if canDoOperation returns true.
      Parameters:
      operation - the operation code