Interface IUnitTextFragment

All Superinterfaces:
IUnitFragment

public interface IUnitTextFragment extends IUnitFragment
A text fragment representing a textual document generated by a unit.
  • Method Details

    • getDocument

      IGenericDocument getDocument()
      Retrieve the underlying source document used to render this fragment, if there is one.
      Returns:
      a document, or null
    • getSelectedText

      String getSelectedText()
      Retrieve the selected text string.
      Returns:
      the selected text, or null if there is no text selection
    • getCaretCoordinates

      ICoordinates getCaretCoordinates()
      Retrieve the caret position.
      Returns:
      the caret coordinates, or null if not applicable
    • setCaretCoordinates

      void setCaretCoordinates(ICoordinates coord, boolean record)
      Set the caret position.
      Parameters:
      coord - new caret coordinates
      record - true to record the move in the navigation history
    • getDocumentObjectsAtCaret

      List<Object> getDocumentObjectsAtCaret()
      Retrieve the list of unit-specific objects related to the current caret position or currently active item in the fragment. The objects and their type are document-(and therefore, unit-) specific.
      Returns:
      a list of related document objects