org.odftoolkit.simple.common.navigation
Class CellSelection

java.lang.Object
  extended by org.odftoolkit.simple.common.navigation.Selection
      extended by org.odftoolkit.simple.common.navigation.TextSelection
          extended by 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

Field Summary
 
Fields inherited from class org.odftoolkit.simple.common.navigation.Selection
search
 
Method Summary
 void advancedReplaceWith(String newText)
          Replace the text content of selection with a new string.
 void advancedReplaceWith(String newText, CellValueAdapter adapter)
          Replace the text content of selection with a new string.
 Cell getCell()
          Get the selected table cell.
 
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
 
Methods inherited from class org.odftoolkit.simple.common.navigation.Selection
getNavigation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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 String
adapter - 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.