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 TextCursor

java.lang.Object
  extended by ag.ion.bion.officelayer.internal.text.TextCursor
All Implemented Interfaces:
ITextCursor

public class TextCursor
extends java.lang.Object
implements ITextCursor

Cursor of a text document.


Constructor Summary
TextCursor(ITextDocument textDocument, com.sun.star.text.XTextCursor xTextCursor)
          Constructs new TextCursor.
 
Method Summary
 ICharacterProperties getCharacterProperties()
          Returns the character properties.
 ITextRange getEnd()
          Returns end position of the cursor.
 short getEndPageNumber()
          Returns the page number of the text cursor end, returns -1 if page number could not be determined.
 ITextRange getStart()
          Returns start position of the cursor.
 short getStartPageNumber()
          Returns the page number of the text cursor start, returns -1 if page number could not be determined.
 java.lang.String getString()
          Gets the text that is marked by the cursor.
 void goLeft(short stepNumber, boolean mark)
          Goes to the submitted position.
 void goRight(short stepNumber, boolean mark)
          Goes to the submitted position.
 void gotoEnd(boolean mark)
          Sets the cursor to the end position (wherever it is currently)
 void gotoEndOfParagraph(boolean mark)
          Moves the cursor to the end of the current paragraph.
 void gotoEndOfSentence(boolean mark)
          Moves the cursor to the end of the current sentence.
 boolean gotoEndOfWord(boolean mark)
          Moves the cursor to the end of the current word.
 void gotoNextParagraph(boolean mark)
          Moves the cursor to the next paragraph.
 void gotoNextSentence(boolean mark)
          Moves the cursor to the next sentence.
 boolean gotoNextWord(boolean mark)
          Moves the cursor to the next word.
 void gotoPreviousParagraph(boolean mark)
          Moves the cursor to the previous paragraph.
 void gotoPreviousSentence(boolean mark)
          Moves the cursor to the previous sentence.
 boolean gotoPreviousWord(boolean mark)
          Moves the cursor to the previous word.
 void gotoRange(ITextRange range, boolean mark)
          Goes to the submitted position.
 void gotoStart(boolean mark)
          Sets the cursor to the start position (wherever it is currently)
 void gotoStartOfParagraph(boolean mark)
          Moves the cursor to the start of the current paragraph.
 void gotoStartOfSentence(boolean mark)
          Moves the cursor to the start of the current sentence.
 boolean gotoStartOfWord(boolean mark)
          Moves the cursor to the start of the current word.
 void insertDocument(java.io.InputStream inputStream, IFilter filter)
          Inserts a file stream at the current cursor location.
 void insertDocument(java.lang.String url)
          Inserts a text document at the current cursor location.
 void insertPageBreak()
          Inserts page break at the current cursor position.
 boolean isEndOfParagraph()
          Returns if the cursor is positioned at the end of a paragraph.
 boolean isEndOfSentence()
          Returns if the cursor is positioned at the end of a sentence.
 boolean isEndOfWord()
          Returns if the cursor is positioned at the end of a word.
 boolean isStartOfParagraph()
          Returns if the cursor is positioned at the start of a paragraph.
 boolean isStartOfSentence()
          Returns if the cursor is positioned at the start of a sentence.
 boolean isStartOfWord()
          Returns if the cursor is positioned at the start of a word.
 void setString(java.lang.String content)
          Sets content to the cursor.
 boolean supportsParagraphCursor()
          Returns if the current cursor supports paragraph cursor operations.
 boolean supportsSentenceCursor()
          Returns if the current cursor supports sentence cursor operations.
 boolean supportsWordCursor()
          Returns if the current cursor supports word cursor operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextCursor

public TextCursor(ITextDocument textDocument,
                  com.sun.star.text.XTextCursor xTextCursor)
Constructs new TextCursor.

Parameters:
textDocument - text document to be used
xTextCursor - OpenOffice.org XTextCursor interface
Throws:
java.lang.IllegalArgumentException - if the submitted OpenOffice.org XTextCursor or XTextDocument interface is not valid
Method Detail

getCharacterProperties

public ICharacterProperties getCharacterProperties()
Returns the character properties.

Specified by:
getCharacterProperties in interface ITextCursor
Returns:
character properties

gotoEnd

public void gotoEnd(boolean mark)
Sets the cursor to the end position (wherever it is currently)

Specified by:
gotoEnd in interface ITextCursor
Parameters:
mark - indicates if the space between the current position and the end is to be marked

gotoStart

public void gotoStart(boolean mark)
Sets the cursor to the start position (wherever it is currently)

Specified by:
gotoStart in interface ITextCursor
Parameters:
mark - indicates if the space between the current position and the start is to be marked

gotoRange

public void gotoRange(ITextRange range,
                      boolean mark)
Goes to the submitted position.

Specified by:
gotoRange in interface ITextCursor
Parameters:
range - the range that specifies where to got
mark - indicates if the space between the current position and the new one is to be marked

setString

public void setString(java.lang.String content)
Sets content to the cursor.

Specified by:
setString in interface ITextCursor
Parameters:
content - content to be used

getString

public java.lang.String getString()
Gets the text that is marked by the cursor.

Specified by:
getString in interface ITextCursor
Returns:
the text marked

goLeft

public void goLeft(short stepNumber,
                   boolean mark)
Goes to the submitted position.

Specified by:
goLeft in interface ITextCursor
Parameters:
stepNumber - stepNumber the number of cursor steps to jump
mark - mark indicates if the space between the current position and the new one is to be marked

goRight

public void goRight(short stepNumber,
                    boolean mark)
Goes to the submitted position.

Specified by:
goRight in interface ITextCursor
Parameters:
stepNumber - the number of cursor steps to jump
mark - mark indicates if the space between the current position and the new one is to be marked

getStart

public ITextRange getStart()
Returns start position of the cursor.

Specified by:
getStart in interface ITextCursor
Returns:
start position of the cursor

getEnd

public ITextRange getEnd()
Returns end position of the cursor.

Specified by:
getEnd in interface ITextCursor
Returns:
end position of the cursor

getStartPageNumber

public short getStartPageNumber()
Returns the page number of the text cursor start, returns -1 if page number could not be determined.

Specified by:
getStartPageNumber in interface ITextCursor
Returns:
the page number of the text cursor start, returns -1 if page number could not be determined

getEndPageNumber

public short getEndPageNumber()
Returns the page number of the text cursor end, returns -1 if page number could not be determined.

Specified by:
getEndPageNumber in interface ITextCursor
Returns:
the page number of the text cursor end, returns -1 if page number could not be determined

insertPageBreak

public void insertPageBreak()
                     throws NOAException
Inserts page break at the current cursor position.

Specified by:
insertPageBreak in interface ITextCursor
Throws:
NOAException - if the page break can not be set

insertDocument

public void insertDocument(java.lang.String url)
                    throws NOAException
Inserts a text document at the current cursor location.

Specified by:
insertDocument in interface ITextCursor
Parameters:
url - URL of the document (must look like file:///c:/test.odt)
Throws:
NOAException - if the text document can not be inserted

insertDocument

public void insertDocument(java.io.InputStream inputStream,
                           IFilter filter)
                    throws NOAException
Inserts a file stream at the current cursor location.

Specified by:
insertDocument in interface ITextCursor
Parameters:
inputStream - a file stream to be inserted
filter - the filter that the stream is baes on
Throws:
NOAException - if the file stream can not be inserted

supportsWordCursor

public boolean supportsWordCursor()
Returns if the current cursor supports word cursor operations.

Specified by:
supportsWordCursor in interface ITextCursor
Returns:
if the current cursor supports word cursor operations

isStartOfWord

public boolean isStartOfWord()
                      throws NOAException
Returns if the cursor is positioned at the start of a word.

Specified by:
isStartOfWord in interface ITextCursor
Returns:
if the cursor is positioned at the start of a word
Throws:
NOAException - if word cursor operations are not supported

isEndOfWord

public boolean isEndOfWord()
                    throws NOAException
Returns if the cursor is positioned at the end of a word.

Specified by:
isEndOfWord in interface ITextCursor
Returns:
if the cursor is positioned at the end of a word
Throws:
NOAException - if word cursor operations are not supported

gotoNextWord

public boolean gotoNextWord(boolean mark)
                     throws NOAException
Moves the cursor to the next word.

Specified by:
gotoNextWord in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Returns:
if the cursor could be positioned
Throws:
NOAException - if word cursor operations are not supported

gotoPreviousWord

public boolean gotoPreviousWord(boolean mark)
                         throws NOAException
Moves the cursor to the previous word.

Specified by:
gotoPreviousWord in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Returns:
if the cursor could be positioned
Throws:
NOAException - if word cursor operations are not supported

gotoEndOfWord

public boolean gotoEndOfWord(boolean mark)
                      throws NOAException
Moves the cursor to the end of the current word.

Specified by:
gotoEndOfWord in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Returns:
if the cursor could be positioned
Throws:
NOAException - if word cursor operations are not supported

gotoStartOfWord

public boolean gotoStartOfWord(boolean mark)
                        throws NOAException
Moves the cursor to the start of the current word.

Specified by:
gotoStartOfWord in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Returns:
if the cursor could be positioned
Throws:
NOAException - if word cursor operations are not supported

supportsSentenceCursor

public boolean supportsSentenceCursor()
Returns if the current cursor supports sentence cursor operations.

Specified by:
supportsSentenceCursor in interface ITextCursor
Returns:
if the current cursor supports sentence cursor operations

isStartOfSentence

public boolean isStartOfSentence()
                          throws NOAException
Returns if the cursor is positioned at the start of a sentence.

Specified by:
isStartOfSentence in interface ITextCursor
Returns:
if the cursor is positioned at the start of a sentence
Throws:
NOAException - if sentence cursor operations are not supported

isEndOfSentence

public boolean isEndOfSentence()
                        throws NOAException
Returns if the cursor is positioned at the end of a sentence.

Specified by:
isEndOfSentence in interface ITextCursor
Returns:
if the cursor is positioned at the end of a sentence
Throws:
NOAException - if sentence cursor operations are not supported

gotoNextSentence

public void gotoNextSentence(boolean mark)
                      throws NOAException
Moves the cursor to the next sentence.

Specified by:
gotoNextSentence in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if sentence cursor operations are not supported

gotoPreviousSentence

public void gotoPreviousSentence(boolean mark)
                          throws NOAException
Moves the cursor to the previous sentence.

Specified by:
gotoPreviousSentence in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if sentence cursor operations are not supported

gotoEndOfSentence

public void gotoEndOfSentence(boolean mark)
                       throws NOAException
Moves the cursor to the end of the current sentence.

Specified by:
gotoEndOfSentence in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if sentence cursor operations are not supported

gotoStartOfSentence

public void gotoStartOfSentence(boolean mark)
                         throws NOAException
Moves the cursor to the start of the current sentence.

Specified by:
gotoStartOfSentence in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if sentence cursor operations are not supported

supportsParagraphCursor

public boolean supportsParagraphCursor()
Returns if the current cursor supports paragraph cursor operations.

Specified by:
supportsParagraphCursor in interface ITextCursor
Returns:
if the current cursor supports paragraph cursor operations

isStartOfParagraph

public boolean isStartOfParagraph()
                           throws NOAException
Returns if the cursor is positioned at the start of a paragraph.

Specified by:
isStartOfParagraph in interface ITextCursor
Returns:
if the cursor is positioned at the start of a paragraph
Throws:
NOAException - if paragraph cursor operations are not supported

isEndOfParagraph

public boolean isEndOfParagraph()
                         throws NOAException
Returns if the cursor is positioned at the end of a paragraph.

Specified by:
isEndOfParagraph in interface ITextCursor
Returns:
if the cursor is positioned at the end of a paragraph
Throws:
NOAException - if paragraph cursor operations are not supported

gotoNextParagraph

public void gotoNextParagraph(boolean mark)
                       throws NOAException
Moves the cursor to the next paragraph.

Specified by:
gotoNextParagraph in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if paragraph cursor operations are not supported

gotoPreviousParagraph

public void gotoPreviousParagraph(boolean mark)
                           throws NOAException
Moves the cursor to the previous paragraph.

Specified by:
gotoPreviousParagraph in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if paragraph cursor operations are not supported

gotoEndOfParagraph

public void gotoEndOfParagraph(boolean mark)
                        throws NOAException
Moves the cursor to the end of the current paragraph.

Specified by:
gotoEndOfParagraph in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if paragraph cursor operations are not supported

gotoStartOfParagraph

public void gotoStartOfParagraph(boolean mark)
                          throws NOAException
Moves the cursor to the start of the current paragraph.

Specified by:
gotoStartOfParagraph in interface ITextCursor
Parameters:
mark - mark indicates if the space between the current position and the new one is to be marked
Throws:
NOAException - if paragraph cursor operations are not supported

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