Class HierarchicalTreeAlternatingRowConfigLabelAccumulator
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.grid.cell.AlternatingRowConfigLabelAccumulator
-
- org.eclipse.nebula.widgets.nattable.hierarchical.HierarchicalTreeAlternatingRowConfigLabelAccumulator
-
- All Implemented Interfaces:
ILayerCommandHandler<DisposeResourcesCommand>
,IConfigLabelAccumulator
,IConfigLabelProvider
,ILayerListener
public class HierarchicalTreeAlternatingRowConfigLabelAccumulator extends AlternatingRowConfigLabelAccumulator implements ILayerListener, ILayerCommandHandler<DisposeResourcesCommand>
Specialization of theAlternatingRowConfigLabelAccumulator
that calculates the even/odd row labels in a hierarchical tree by inspecting the row spanning of the first level node. For better performance the calculation results are cached. As the cache needs to be cleared on structural changes, this class also implements theILayerListener
to clear the cache automatically onRowStructuralChangeEvent
s if registered on the given layer viaILayer.addLayerListener(ILayerListener)
.- Since:
- 1.6
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.grid.cell.AlternatingRowConfigLabelAccumulator
EVEN_ROW_CONFIG_TYPE, layer, ODD_ROW_CONFIG_TYPE
-
-
Constructor Summary
Constructors Constructor Description HierarchicalTreeAlternatingRowConfigLabelAccumulator(ILayer layer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition)
Add labels applicable to this cell positionvoid
calculateLabels()
Triggers a new background thread for calculation of the row label cache.void
clearCache()
Clears the local cache of calculated row position to label mappings.boolean
doCommand(ILayer targetLayer, DisposeResourcesCommand command)
Class<DisposeResourcesCommand>
getCommandClass()
void
handleLayerEvent(ILayerEvent event)
Handle an event notification from anILayer
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.grid.cell.AlternatingRowConfigLabelAccumulator
getProvidedLabels
-
-
-
-
Method Detail
-
accumulateConfigLabels
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition)
Description copied from interface:IConfigLabelAccumulator
Add labels applicable to this cell position- Specified by:
accumulateConfigLabels
in interfaceIConfigLabelAccumulator
- Overrides:
accumulateConfigLabels
in classAlternatingRowConfigLabelAccumulator
- Parameters:
configLabels
- the labels currently applied to the cell. The labels contributed by this provider must be added to this stackcolumnPosition
- of the cell for which labels are being gatheredrowPosition
- of the cell for which labels are being gathered
-
calculateLabels
public void calculateLabels()
Triggers a new background thread for calculation of the row label cache.
-
clearCache
public void clearCache()
Clears the local cache of calculated row position to label mappings.
-
handleLayerEvent
public void handleLayerEvent(ILayerEvent event)
Description copied from interface:ILayerListener
Handle an event notification from anILayer
- Specified by:
handleLayerEvent
in interfaceILayerListener
- Parameters:
event
- the event
-
doCommand
public boolean doCommand(ILayer targetLayer, DisposeResourcesCommand command)
- Specified by:
doCommand
in interfaceILayerCommandHandler<DisposeResourcesCommand>
- Parameters:
targetLayer
- the target layercommand
- the command- Returns:
- true if the command has been handled, false otherwise
-
getCommandClass
public Class<DisposeResourcesCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<DisposeResourcesCommand>
-
-