public class CellNavigationStrategy extends Object
Subclasses can implement their custom navigation algorithms
Constructor and Description |
---|
CellNavigationStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
collapse(ColumnViewer viewer,
ViewerCell cellToCollapse,
Event event) |
void |
expand(ColumnViewer viewer,
ViewerCell cellToExpand,
Event event) |
ViewerCell |
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 cell
|
boolean |
shouldCancelEvent(ColumnViewer viewer,
Event event)
This method is consulted to decide whether an event has to be canceled or
not.
|
public boolean isNavigationEvent(ColumnViewer viewer, Event event)
viewer
- the viewer we are working forevent
- the key eventtrue
if a new cell is searchedpublic boolean isCollapseEvent(ColumnViewer viewer, ViewerCell cellToCollapse, Event event)
viewer
- the viewer we are working forcellToCollapse
- the cell to collapseevent
- the key eventtrue
if this event triggers collapsing of a nodepublic boolean isExpandEvent(ColumnViewer viewer, ViewerCell cellToExpand, Event event)
viewer
- the viewer we are working forcellToExpand
- the cell to expandevent
- the key eventtrue
if this event triggers expanding of a nodepublic void expand(ColumnViewer viewer, ViewerCell cellToExpand, Event event)
viewer
- the viewer working forcellToExpand
- the cell the user wants to expandevent
- the event triggering the expansionpublic void collapse(ColumnViewer viewer, ViewerCell cellToCollapse, Event event)
viewer
- the viewer working forcellToCollapse
- the cell the user wants to collapseevent
- the event triggering the expansionpublic ViewerCell findSelectedCell(ColumnViewer viewer, ViewerCell currentSelectedCell, Event event)
viewer
- the viewer we are working forcurrentSelectedCell
- the cell currently selectedevent
- the key eventnull
if the
default implementation is taken. E.g. it's fairly impossible to
react on PAGE_DOWN requestspublic boolean shouldCancelEvent(ColumnViewer viewer, Event event)
viewer
- the viewer working forevent
- the eventtrue
if the event has to be canceledprotected void init()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.