org.odftoolkit.simple.common.navigation
Class CellSelection
java.lang.Object
org.odftoolkit.simple.common.navigation.Selection
org.odftoolkit.simple.common.navigation.TextSelection
org.odftoolkit.simple.common.navigation.CellSelection
public class CellSelection
- extends TextSelection
Based on TextSelection
, CellSelection
updates table
cell value and value type when the cell text is replaced by other content.
This is a more complete realization than TextSelection for cell content
replacement, which keeps the synchronization among cell value, value type and
display text.
- Since:
- 0.3
- See Also:
TextSelection
,
CellValueAdapter
Fields inherited from class org.odftoolkit.simple.common.navigation.Selection |
search |
Methods inherited from class org.odftoolkit.simple.common.navigation.TextSelection |
addComment, addHref, applyStyle, createSpanElement, cut, getContainerElement, getElement, getIndex, getText, getTextNavigation, isSelectionReplaced, newTextSelection, pasteAtEndOf, pasteAtFrontOf, refresh, refreshAfterFrontalDelete, refreshAfterFrontalInsert, replaceWith, replaceWith, replaceWith, replaceWith, replaceWith, replaceWith, replaceWith, setSelectionReplaced, toString |
advancedReplaceWith
public void advancedReplaceWith(String newText,
CellValueAdapter adapter)
throws InvalidNavigationException
- Replace the text content of selection with a new string. The cell value
and value type will be updated follow by the rules which are designed in
the
CellValueAdapter
.
- Parameters:
newText
- the replace text Stringadapter
- the CellValueAdapter
used to adapt cell value and
value type
- Throws:
InvalidNavigationException
- if the selection is unavailable.- See Also:
TextSelection.replaceWith(String)
,
CellValueAdapter
advancedReplaceWith
public void advancedReplaceWith(String newText)
throws InvalidNavigationException
- Replace the text content of selection with a new string. The cell value
and value type will be updated follow by the rules which are designed in
the
DefaultCellValueAdapter
.
- Parameters:
newText
- the replace text String
- Throws:
InvalidNavigationException
- if the selection is unavailable.- See Also:
DefaultCellValueAdapter
getCell
public Cell getCell()
- Get the selected table cell.
- Returns:
- the selected table cell
Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.