com.ephox.editlive.view.selection
Interface SelectionManager


public interface SelectionManager

Methods that make working with the selection model of EditLive! much easier. Instance available via ELJBean.getSelectionManager().

Since:
7.5

Method Summary
 Caret getCaret()
          Wrapper to JTextComponent.getCaret().
 Collection<Element> getCellsAtCursor()
          Returns a collection of all cells at the cursor.
 Element getElementAtBeginningOfSelection()
          Returns the first element in the selection.
 List<Element> getSelectedCells()
          Returns all selected cells.
 List<Element> getSelectedElements()
          Returns all selected elements.
 boolean isElementSelectionMode()
          Checks if the caret is in Element selection mode, which is required for element-based methods in this class.
 

Method Detail

getCaret

Caret getCaret()
Wrapper to JTextComponent.getCaret().


isElementSelectionMode

boolean isElementSelectionMode()
Checks if the caret is in Element selection mode, which is required for element-based methods in this class. Element selection mode is activated in the following cases: Element selection is indicated visually by using square boxes to highlight elements instead of normal text selection.

Returns:
true if element selection mode is active.

getElementAtBeginningOfSelection

Element getElementAtBeginningOfSelection()
Returns the first element in the selection. When element selection mode is active, this returns the first element in that selection. When element selection mode is not active, the active element at position Caret.getDot() is returned.


getSelectedCells

List<Element> getSelectedCells()
Returns all selected cells. If the user has not selected any cells, returns an empty list.


getSelectedElements

List<Element> getSelectedElements()
Returns all selected elements. This will return all elements within range based on how the user created the current selection. If text was highlighted, it returns content elements. If the document navigator was used to select an element, it is the only thing returned. If the user highlighted multiple cells, they are all returned (similar to getSelectedCells().


getCellsAtCursor

Collection<Element> getCellsAtCursor()
Returns a collection of all cells at the cursor. If only text within one cell is selected, the collection contains one element matching TableManager.getTableCellAncestor(Element). If multiple cells are selected, it returns getSelectedCells(). If no cells are found, it returns an empty collection.


Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved.