# Interface: com.pnfsoftware.jeb.client.api.IUnitTextFragment

A text fragment representing a textual document generated by a [unit](IUnit).

## Method: getCaretCoordinates
- return type: `com.pnfsoftware.jeb.core.output.text.ICoordinates`

Description: Retrieve the caret position.
return: the caret coordinates, or null if not applicable

## Method: getDocument
- return type: `com.pnfsoftware.jeb.core.output.IGenericDocument`

Description: Retrieve the underlying source document used to render this fragment, if there is one.
return: a document, or null

## Method: getDocumentObjectsAtCaret
- return type: `java.util.List<java.lang.Object>`

Description: 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.
return: a list of related document objects

## Method: getSelectedText
- return type: `java.lang.String`

Description: Retrieve the selected text string.
return: the selected text, or null if there is no text selection

## Method: setCaretCoordinates
- parameter: `coord`, type: `com.pnfsoftware.jeb.core.output.text.ICoordinates`
- parameter: `record`, type: `boolean`

Description: Set the caret position.
parameter: coord: new caret coordinates
parameter: record: true to record the move in the navigation history

