Class SelectionManager

java.lang.Object
org.odftoolkit.odfdom.incubator.search.SelectionManager

public class SelectionManager extends Object
The SelectionManager can manage all the selections that are returned to end users by a Navigation instance. The SelectionManager contains a repository of all selections, and will refresh the status/mIndex of selections after certain operation.
  • Constructor Details

    • SelectionManager

      public SelectionManager()
  • Method Details

    • registerItem

      public void registerItem(Selection item)
      Register the selection item
      Parameters:
      item - the selection item
    • refreshAfterCut

      public void refreshAfterCut(Selection cutItem)
      Refresh the selections in repository after a item is cut.
      Parameters:
      cutItem - the cut item
    • refreshAfterPasteAtFrontOf

      public void refreshAfterPasteAtFrontOf(Selection item, Selection positionItem)
      Refresh the selections in repository after a pastedAtFrontOf operation is called.
      Parameters:
      item - the pasted item
      positionItem - the position item
    • refreshAfterPasteAtEndOf

      public void refreshAfterPasteAtEndOf(Selection item, Selection positionItem)
      Refresh the selections in repository after a pastedAtEndOf operation is called.
      Parameters:
      item - the pasted item
      positionItem - the position item
    • unregisterItem

      public void unregisterItem(Selection item)
      Remove the selection from repository.
      Parameters:
      item - selection item
    • unregisterAll

      public void unregisterAll()
      Removes all selections from the SelectionManager.
    • refresh

      public void refresh(OdfElement containerElement, int offset, int positionIndex)
      A direct method to update all the selections contained in a mElement after a certain position.
      Parameters:
      containerElement - the container mElement
      offset - the offset
      positionIndex - the mIndex of a certain position