textselection-ag凯发旗舰厅



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.
 
method summary
 java.lang.string get(int index)
          gets the string at the specified index.
 textrange getasonerange()
          gets as one range.
 textrange getasonerange(boolean iscopyformat)
          gets as one range.
 int getcount()
          gets the count of text chunks.
 textrange[] getranges()
          gets the ranges.
 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)
          sets the string at the specified index.
 
constructor detail

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)
gets the string at the specified index.
parameters:
index - index
returns:
string

set

public void set(int index,
                java.lang.string value)
sets the string at the specified index.
parameters:
index - index
value - value

getcount

public int getcount()
gets the count of text chunks.
returns:
the count.

getranges

public textrange[] getranges()
gets the ranges.
returns:
textrange[]

getasonerange

public textrange getasonerange()
gets as one range.
returns:
textrange[]

getasonerange

public textrange getasonerange(boolean iscopyformat)
gets as one range.
parameters:
iscopyformat - is copy existing formats to textrange
returns:
textrange

iterator

public java.util.iterator iterator()
returns an enumerator that iterates through a collection.
returns:
an iterator object that can be used to iterate through the collection.


网站地图