Package org.eclipse.jface.viewers
Class CellNavigationStrategy
java.lang.Object
org.eclipse.jface.viewers.CellNavigationStrategy
This class implementation the strategy how the table is navigated using the
keyboard.
Subclasses can implement their custom navigation algorithms
- Since:
- 3.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
collapse
(ColumnViewer viewer, ViewerCell cellToCollapse, Event event) void
expand
(ColumnViewer viewer, ViewerCell cellToExpand, Event event) findSelectedCell
(ColumnViewer viewer, ViewerCell currentSelectedCell, Event event) protected void
init()
This method is called by the framework to initialize this navigation strategy object.boolean
isCollapseEvent
(ColumnViewer viewer, ViewerCell cellToCollapse, Event event) boolean
isExpandEvent
(ColumnViewer viewer, ViewerCell cellToExpand, Event event) boolean
isNavigationEvent
(ColumnViewer viewer, Event event) is the given event an event which moves the selection to another cellboolean
shouldCancelEvent
(ColumnViewer viewer, Event event) This method is consulted to decide whether an event has to be canceled or not.
-
Constructor Details
-
CellNavigationStrategy
public CellNavigationStrategy()
-
-
Method Details
-
isCollapseEvent
- Parameters:
viewer
- the viewer we are working forcellToCollapse
- the cell to collapseevent
- the key event- Returns:
true
if this event triggers collapsing of a node
-
isExpandEvent
- Parameters:
viewer
- the viewer we are working forcellToExpand
- the cell to expandevent
- the key event- Returns:
true
if this event triggers expanding of a node
-
expand
- Parameters:
viewer
- the viewer working forcellToExpand
- the cell the user wants to expandevent
- the event triggering the expansion
-
collapse
- Parameters:
viewer
- the viewer working forcellToCollapse
- the cell the user wants to collapseevent
- the event triggering the expansion
-
findSelectedCell
public ViewerCell findSelectedCell(ColumnViewer viewer, ViewerCell currentSelectedCell, Event event) - Parameters:
viewer
- the viewer we are working forcurrentSelectedCell
- the cell currently selectedevent
- the key event- Returns:
- the cell which is highlighted next or
null
if the default implementation is taken. E.g. it's fairly impossible to react on PAGE_DOWN requests
-
shouldCancelEvent
This method is consulted to decide whether an event has to be canceled or not. By default events who collapse/expand tree-nodes are canceled- Parameters:
viewer
- the viewer working forevent
- the event- Returns:
true
if the event has to be canceled
-
init
protected void init()This method is called by the framework to initialize this navigation strategy object. Subclasses may extend.