org.odftoolkit.simple.common.navigation
public abstract class Selection extends Object
Selection
describes one of the matched results, which is
recognized by the container element, the start index of the text content in
this element and the text content.Modifier and Type | Field and Description |
---|---|
protected Navigation |
search |
Constructor and Description |
---|
Selection() |
Modifier and Type | Method and Description |
---|---|
abstract void |
cut()
Cut current
Selection . |
OdfElement |
getElement()
Get the container element of this
Selection . |
int |
getIndex()
Get the start index of the text content in the container element.
|
Navigation |
getNavigation() |
abstract void |
pasteAtEndOf(Selection positionItem)
Paste current
Selection at end of the specified position
Selection . |
abstract void |
pasteAtFrontOf(Selection positionItem)
Paste current
Selection at front of the specified position
Selection . |
protected abstract void |
refresh(int offset)
A quick method to update the index of this
Selection . |
protected abstract void |
refreshAfterFrontalDelete(Selection deletedItem)
When a selected item has been deleted, the
Selection s after
this deleted Selection should be refreshed, as these
Selection s index have been changed. |
protected abstract void |
refreshAfterFrontalInsert(Selection insertedItem)
When a selected item has been inserted, the
Selection after
the inserted item should be refresh, as these Selection s
index have been changed. |
protected Navigation search
public Navigation getNavigation()
public OdfElement getElement()
Selection
.public int getIndex()
TextSelection
and its sub
classes, other type of Selection
will return 0.public abstract void cut() throws InvalidNavigationException
Selection
.InvalidNavigationException
public abstract void pasteAtFrontOf(Selection positionItem) throws InvalidNavigationException
Selection
at front of the specified position
Selection
.positionItem
- the position Selection
InvalidNavigationException
public abstract void pasteAtEndOf(Selection positionItem) throws InvalidNavigationException
Selection
at end of the specified position
Selection
.positionItem
- the position Selection
InvalidNavigationException
protected abstract void refreshAfterFrontalDelete(Selection deletedItem)
Selection
s after
this deleted Selection
should be refreshed, as these
Selection
s index have been changed.deletedItem
- the deleted Selection
protected abstract void refreshAfterFrontalInsert(Selection insertedItem)
Selection
after
the inserted item should be refresh, as these Selection
s
index have been changed.insertedItem
- the inserted Selection
protected abstract void refresh(int offset)
Selection
.offset
- the offset that the index should be added.Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.