com.spire.doc.documents
Class TextSelection

java.lang.Object
  extended by com.spire.doc.documents.TextSelection
All Implemented Interfaces:
java.lang.Iterable

public class TextSelection
extends java.lang.Object
implements java.lang.Iterable

Represent a selection of text inside paragraph.


Constructor Summary
TextSelection(Paragraph para, int startCharPos, int endCharPos)
          Initializes a new instance of the TextSelection class.
TextSelection(Paragraph startPara, Paragraph endPara, int startCharPos, int endCharPos)
          Initializes a new instance of the class.
 
Method Summary
 java.lang.String get(int index)
           
 TextRange getAsOneRange()
          Gets as one range.
 TextRange getAsOneRange(boolean IsCopyFormat)
          Gets as one range.
 TextRange[] getAsRange()
          Gets as range.
 TextRange[] getAsRange(boolean isCopyFormat)
          Gets as range.
 int getCount()
          Gets the count of text chunks.
 TextRange[] getRanges()
          Gets the ranges in one paragraph.
 java.lang.String getSelectedText()
          Gets the selected text.
 java.util.Iterator iterator()
          Returns an enumerator that iterates through a collection.
 void set(int index, java.lang.String value)
           
 

Constructor Detail

TextSelection

public TextSelection(Paragraph startPara,
                     Paragraph endPara,
                     int startCharPos,
                     int endCharPos)
Initializes a new instance of the class.

Parameters:
startPara - The paragraph.
startCharPos - The start char position.
endCharPos - The end char position.

TextSelection

public TextSelection(Paragraph para,
                     int startCharPos,
                     int endCharPos)
Initializes a new instance of the TextSelection class.

Parameters:
para - The paragraph
startCharPos - The start char position.
endCharPos - The end char position.
Method Detail

getSelectedText

public java.lang.String getSelectedText()
Gets the selected text.

Returns:
The selected text.

get

public java.lang.String get(int index)

set

public void set(int index,
                java.lang.String value)

getCount

public int getCount()
Gets the count of text chunks.

Returns:
The count.

getRanges

public TextRange[] getRanges()
Gets the ranges in one paragraph.

Returns:

getAsRange

public TextRange[] getAsRange()
Gets as range. more than one paragraph,every paragraph to one text range.

Returns:
TextRange[]

getAsRange

public TextRange[] getAsRange(boolean isCopyFormat)
Gets as range. more than one paragraph,every paragraph to one text range.

Parameters:
isCopyFormat - Is copy existing formats to textrange
Returns:
TextRange[]

getAsOneRange

public TextRange getAsOneRange()
Gets as one range.

Returns:

getAsOneRange

public TextRange getAsOneRange(boolean IsCopyFormat)
Gets as one range.

Parameters:
IsCopyFormat - Is copy existing formats to textrange
Returns:

iterator

public java.util.Iterator iterator()
Returns an enumerator that iterates through a collection.

Returns:
object that can be used to iterate through the collection