Class HierarchicalTraversalStrategy
java.lang.Object
org.eclipse.nebula.widgets.nattable.hierarchical.HierarchicalTraversalStrategy
- All Implemented Interfaces:
ITraversalStrategy
Wrapper for basic
ITraversalStrategy implementations that add target
checks. Requests for traversal scope, cycle and step count will be delegated
to the wrapped ITraversalStrategy.
isValidTarget(ILayerCell, ILayerCell) will check whether the
ILayerCell from which the movement should be performed is part of a
collapsed parent node and therefore the ILayerCell 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
FieldsModifier and TypeFieldDescriptionprotected ITraversalStrategyTheITraversalStrategythat is wrapped by thisHierarchicalTraversalStrategy.protected HierarchicalTreeLayerTheHierarchicalTreeLayeron which thisITraversalStrategyis 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
ConstructorsConstructorDescriptionHierarchicalTraversalStrategy(ITraversalStrategy baseStrategy, HierarchicalTreeLayer layer) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanisCycle()booleanisValidTarget(ILayerCell from, ILayerCell to) Checks whether theILayerCellthat would be selected after the selection movement is valid or not.
-
Field Details
-
baseStrategy
TheITraversalStrategythat is wrapped by thisHierarchicalTraversalStrategy. -
layer
TheHierarchicalTreeLayeron which thisITraversalStrategyis applied.
-
-
Constructor Details
-
HierarchicalTraversalStrategy
- Parameters:
baseStrategy- TheITraversalStrategythat should be wrapped by thisHierarchicalTraversalStrategy.layer- TheHierarchicalTreeLayeron which thisITraversalStrategyis applied.
-
-
Method Details
-
getTraversalScope
- Specified by:
getTraversalScopein interfaceITraversalStrategy- Returns:
- The
ITraversalStrategy.TraversalScopethis traversal strategy specifies.
-
isCycle
public boolean isCycle()- Specified by:
isCyclein interfaceITraversalStrategy- Returns:
trueif on traversal the selection should cycle,falseif the selection should stay at the last/first position without cycling.
-
getStepCount
public int getStepCount()- Specified by:
getStepCountin interfaceITraversalStrategy- Returns:
- The number of steps to jump on traversal.
-
isValidTarget
Description copied from interface:ITraversalStrategyChecks whether theILayerCellthat 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:
isValidTargetin interfaceITraversalStrategy- Parameters:
from- TheILayerCellfrom which the selection movement is started.to- TheILayerCellto which the selection movement should be performed.- Returns:
trueif the target is a valid target for selection movement,falseif not
-