// Caret position.
maCaretPositionSpinner.setValue (new Integer (mxText.getCaretPosition()));
// Multi line methods.
XAccessibleMultiLineText xMultiText = (XAccessibleMultiLineText)
UnoRuntime.queryInterface( XAccessibleMultiLineText.class, mxText );
if( null != xMultiText ) {
try {
maCaretLineNoLabel.setText ( Integer.toString( xMultiText.getNumberOfLineWithCaret() ) );
TextSegment ts = xMultiText.getTextAtLineWithCaret();
maCaretLineTextLabel.setText ( "[" + ts.SegmentStart
+ "," + ts.SegmentEnd
+ "] \"" + ts.SegmentText + "\"");
maLineNoFromCaretPosLabel.setText ( Integer.toString( xMultiText.getLineNumberAtIndex( mxText.getCaretPosition() ) ) );
ts = xMultiText.getTextAtLineNumber(xMultiText.getLineNumberAtIndex( mxText.getCaretPosition() ) );
maLineTextFromCaretPosLabel.setText ( "[" + ts.SegmentStart
+ "," + ts.SegmentEnd
+ "] \"" + ts.SegmentText + "\"");
} catch( IndexOutOfBoundsException e) {
}