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 the
AlternatingRowConfigLabelAccumulator 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 the ILayerListener to clear the cache
automatically on RowStructuralChangeEvents if registered on the given
layer via ILayer.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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) Add labels applicable to this cell positionvoidTriggers a new background thread for calculation of the row label cache.voidClears the local cache of calculated row position to label mappings.booleandoCommand(ILayer targetLayer, DisposeResourcesCommand command) voidhandleLayerEvent(ILayerEvent event) Handle an event notification from anILayerMethods inherited from class org.eclipse.nebula.widgets.nattable.grid.cell.AlternatingRowConfigLabelAccumulator
getProvidedLabels
-
Constructor Details
-
HierarchicalTreeAlternatingRowConfigLabelAccumulator
- Parameters:
layer- TheILayerthat is used to determine the row spanning in the first column. Should be the HierarchicalTreeLayer.
-
-
Method Details
-
accumulateConfigLabels
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
Description copied from interface:ILayerListenerHandle an event notification from anILayer- Specified by:
handleLayerEventin interfaceILayerListener- Parameters:
event- the event
-
doCommand
- Specified by:
doCommandin interfaceILayerCommandHandler<DisposeResourcesCommand>- Parameters:
targetLayer- the target layercommand- the command- Returns:
- true if the command has been handled, false otherwise
-
getCommandClass
- Specified by:
getCommandClassin interfaceILayerCommandHandler<DisposeResourcesCommand>
-