Class HierarchicalTraversalStrategy
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.hierarchical.HierarchicalTraversalStrategy
-
- All Implemented Interfaces:
ITraversalStrategy
public class HierarchicalTraversalStrategy extends Object implements ITraversalStrategy
Wrapper for basicITraversalStrategy
implementations that add target checks. Requests for traversal scope, cycle and step count will be delegated to the wrappedITraversalStrategy
.isValidTarget(ILayerCell, ILayerCell)
will check whether theILayerCell
from which the movement should be performed is part of a collapsed parent node and therefore theILayerCell
to move the selection to would be in a hidden area.- Since:
- 1.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.nebula.widgets.nattable.selection.ITraversalStrategy
ITraversalStrategy.TraversalScope
-
-
Field Summary
Fields Modifier and Type Field Description protected ITraversalStrategy
baseStrategy
TheITraversalStrategy
that is wrapped by thisHierarchicalTraversalStrategy
.protected HierarchicalTreeLayer
layer
TheHierarchicalTreeLayer
on which thisITraversalStrategy
is applied.-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.selection.ITraversalStrategy
AXIS_CYCLE_TRAVERSAL_STRATEGY, AXIS_TRAVERSAL_STRATEGY, TABLE_CYCLE_TRAVERSAL_STRATEGY, TABLE_TRAVERSAL_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description HierarchicalTraversalStrategy(ITraversalStrategy baseStrategy, HierarchicalTreeLayer layer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getStepCount()
ITraversalStrategy.TraversalScope
getTraversalScope()
boolean
isCycle()
boolean
isValidTarget(ILayerCell from, ILayerCell to)
Checks whether theILayerCell
that would be selected after the selection movement is valid or not.
-
-
-
Field Detail
-
baseStrategy
protected ITraversalStrategy baseStrategy
TheITraversalStrategy
that is wrapped by thisHierarchicalTraversalStrategy
.
-
layer
protected HierarchicalTreeLayer layer
TheHierarchicalTreeLayer
on which thisITraversalStrategy
is applied.
-
-
Constructor Detail
-
HierarchicalTraversalStrategy
public HierarchicalTraversalStrategy(ITraversalStrategy baseStrategy, HierarchicalTreeLayer layer)
- Parameters:
baseStrategy
- TheITraversalStrategy
that should be wrapped by thisHierarchicalTraversalStrategy
.layer
- TheHierarchicalTreeLayer
on which thisITraversalStrategy
is applied.
-
-
Method Detail
-
getTraversalScope
public ITraversalStrategy.TraversalScope getTraversalScope()
- Specified by:
getTraversalScope
in interfaceITraversalStrategy
- Returns:
- The
ITraversalStrategy.TraversalScope
this traversal strategy specifies.
-
isCycle
public boolean isCycle()
- Specified by:
isCycle
in interfaceITraversalStrategy
- Returns:
true
if on traversal the selection should cycle,false
if the selection should stay at the last/first position without cycling.
-
getStepCount
public int getStepCount()
- Specified by:
getStepCount
in interfaceITraversalStrategy
- Returns:
- The number of steps to jump on traversal.
-
isValidTarget
public boolean isValidTarget(ILayerCell from, ILayerCell to)
Description copied from interface:ITraversalStrategy
Checks whether theILayerCell
that would be selected after the selection movement is valid or not. In case the target is invalid, the responsible command handler is able to react accordingly, e.g. move the next valid cell.This is for example useful for editing traversal. If the selection movement is triggered on committing a value in an editor, the next editable cell should be selected and the editor opened immediately.
- Specified by:
isValidTarget
in interfaceITraversalStrategy
- Parameters:
from
- TheILayerCell
from which the selection movement is started.to
- TheILayerCell
to which the selection movement should be performed.- Returns:
true
if the target is a valid target for selection movement,false
if not
-
-