Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013

ag.ion.bion.officelayer.internal.text
Class TextRange

java.lang.Object
  extended by ag.ion.bion.officelayer.internal.text.TextRange
All Implemented Interfaces:
ITextRange
Direct Known Subclasses:
Bookmark

public class TextRange
extends java.lang.Object
implements ITextRange

Range of text in a text document.


Constructor Summary
TextRange(IDocument document, com.sun.star.text.XTextRange xTextRange)
          Constructs new TextRange.
 
Method Summary
 short compareRange(ITextRange textRangeToCompare)
          Compares this text range with the given text range.
 ITextTableCell getCell()
          Returns cell of the texttable if the text range is part of cell.
 IPageStyle getPageStyle()
          Returns related page style of the text range.
 com.sun.star.text.XTextRange getXTextRange()
          Returns OpenOffice.org XTextRange interface.
 void setDocument(IDocument document)
          Sets the document of the text range.
 void setText(java.lang.String text)
          Sets text of the text range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextRange

public TextRange(IDocument document,
                 com.sun.star.text.XTextRange xTextRange)
          throws java.lang.IllegalArgumentException
Constructs new TextRange.

Parameters:
document - OpenOffice.org document of the text range
xTextRange - OpenOffice.org XTextRange interface
Throws:
java.lang.IllegalArgumentException - if one the OpenOffice.org interface is not valid
Method Detail

getXTextRange

public com.sun.star.text.XTextRange getXTextRange()
Returns OpenOffice.org XTextRange interface. This method is not part of the public API. It should never used from outside.

Specified by:
getXTextRange in interface ITextRange
Returns:
OpenOffice.org XTextRange interface

getPageStyle

public IPageStyle getPageStyle()
                        throws TextException
Returns related page style of the text range.

Specified by:
getPageStyle in interface ITextRange
Returns:
page style of the text range
Throws:
TextException - if the page style is not available

setText

public void setText(java.lang.String text)
Sets text of the text range.

Specified by:
setText in interface ITextRange
Parameters:
text - text to be used

getCell

public ITextTableCell getCell()
Returns cell of the texttable if the text range is part of cell.

Specified by:
getCell in interface ITextRange
Returns:
cell of the texttable if the text range is part of cell or null if the text range is not part of a cell

compareRange

public short compareRange(ITextRange textRangeToCompare)
                   throws TextException
Compares this text range with the given text range. Returns 1 if this range starts before the given text range, 0 if the text ranges start at the same position and -1 if this text range starts behind the given text range.

Specified by:
compareRange in interface ITextRange
Parameters:
textRangeToCompare - the text range to compare
Returns:
1 if this range starts before the given text range, 0 if the text ranges start at the same position and -1 if this text range starts behind the given text range
Throws:
TextException - if the text ranges to compare are not within the same text.

setDocument

public void setDocument(IDocument document)
Sets the document of the text range. This makes sense if the text range was generated as the document was unknown.

Specified by:
setDocument in interface ITextRange
Parameters:
document - document to be used

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013