org.odftoolkit.simple.common.navigation.TextSelection
in Simple API.public class TextSelection extends Selection
Modifier and Type | Method and Description |
---|---|
void |
addHref(URL url)
Deprecated.
Add a hypertext reference to the selection
|
void |
applyStyle(OdfStyleBase style)
Deprecated.
Apply a style to the selection so that the text style of this selection
will append the specified style
|
void |
cut()
Deprecated.
Delete the selection from the document
the other matched selection in the same container element will be updated automatically
because the start index of the following selections will be changed when the previous
selection has been deleted
|
OdfElement |
getContainerElement()
Deprecated.
Get the mParagraph element or mHeading element that contain this text
|
OdfElement |
getElement()
Deprecated.
Get the mParagraph element or mHeading element that contain this TextSelection
|
int |
getIndex()
Deprecated.
Get the start index of the text content of its container element
|
String |
getText()
Deprecated.
Get the text content of this TextSelection
|
void |
pasteAtEndOf(Selection positionItem)
Deprecated.
Paste this selection just after a specific selection.
|
void |
pasteAtFrontOf(Selection positionItem)
Deprecated.
Paste this selection just before a specific selection.
|
protected void |
refresh(int offset)
Deprecated.
A quick method to update the mIndex of this selection
|
protected void |
refreshAfterFrontalDelete(Selection deleteItem)
Deprecated.
when a selected item has been delete, the selections after this deleted selection should be refresh
because these selections mIndex will be changed
|
protected void |
refreshAfterFrontalInsert(Selection pasteItem)
Deprecated.
when a selected item has been inserted, the selection after the inserted item should be refresh
because these selections mIndex will be changed
|
void |
replaceWith(String newText)
Deprecated.
Replace the text content of selection with a new string
|
String |
toString()
Deprecated.
return a String Object representing this selection value
the text content of the selection, start index in the container element and the
text content of the container element will be provided
|
public OdfElement getElement()
getElement
in class Selection
public OdfElement getContainerElement()
public int getIndex()
public String getText()
public void cut() throws InvalidNavigationException
cut
in class Selection
InvalidNavigationException
- if the selection is unavailable.public void applyStyle(OdfStyleBase style) throws InvalidNavigationException
style
- the style can be from the current document or user definedInvalidNavigationException
- if the selection is unavailable.public void replaceWith(String newText) throws InvalidNavigationException
newText
- the replace text StringInvalidNavigationException
- if the selection is unavailable.public void pasteAtFrontOf(Selection positionItem) throws InvalidNavigationException
pasteAtFrontOf
in class Selection
positionItem
- a selection that is used to point out the positionInvalidNavigationException
- if the selection is unavailable.public void pasteAtEndOf(Selection positionItem) throws InvalidNavigationException
pasteAtEndOf
in class Selection
positionItem
- a selection that is used to point out the positionInvalidNavigationException
- if the selection is unavailable.public void addHref(URL url) throws InvalidNavigationException
url
- the url of the hypertext referenceInvalidNavigationException
- if the selection is unavailable.protected void refreshAfterFrontalDelete(Selection deleteItem)
Selection
refreshAfterFrontalDelete
in class Selection
deleteItem
- the deleted selectionprotected void refreshAfterFrontalInsert(Selection pasteItem)
Selection
refreshAfterFrontalInsert
in class Selection
pasteItem
- the inserted selectionprotected void refresh(int offset)
Selection
public String toString()
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.