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 theAlternatingRowConfigLabelAccumulatorthat 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 theILayerListenerto clear the cache automatically onRowStructuralChangeEvents 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 voidaccumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition)Add labels applicable to this cell positionvoidcalculateLabels()Triggers a new background thread for calculation of the row label cache.voidclearCache()Clears the local cache of calculated row position to label mappings.booleandoCommand(ILayer targetLayer, DisposeResourcesCommand command)Class<DisposeResourcesCommand>getCommandClass()voidhandleLayerEvent(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:IConfigLabelAccumulatorAdd labels applicable to this cell position- Specified by:
accumulateConfigLabelsin interfaceIConfigLabelAccumulator- Overrides:
accumulateConfigLabelsin 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:ILayerListenerHandle an event notification from anILayer- Specified by:
handleLayerEventin interfaceILayerListener- Parameters:
event- the event
-
doCommand
public boolean doCommand(ILayer targetLayer, DisposeResourcesCommand command)
- Specified by:
doCommandin 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:
getCommandClassin interfaceILayerCommandHandler<DisposeResourcesCommand>
-
-