Class AlternatingRowConfigLabelAccumulator
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.grid.cell.AlternatingRowConfigLabelAccumulator
-
- All Implemented Interfaces:
IConfigLabelAccumulator
,IConfigLabelProvider
- Direct Known Subclasses:
HierarchicalTreeAlternatingRowConfigLabelAccumulator
public class AlternatingRowConfigLabelAccumulator extends Object implements IConfigLabelProvider
Applies 'odd'/'even' labels to all the rows. These labels are the used to apply color to alternate rows.- See Also:
DefaultRowStyleConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description static String
EVEN_ROW_CONFIG_TYPE
protected ILayer
layer
The layer that should be used for row index transformation ornull
if no transformation should be performed.static String
ODD_ROW_CONFIG_TYPE
-
Constructor Summary
Constructors Constructor Description AlternatingRowConfigLabelAccumulator()
Creates an AlternatingRowConfigLabelAccumulator that operates on row positions.AlternatingRowConfigLabelAccumulator(ILayer layer)
Creates an AlternatingRowConfigLabelAccumulator that operates on row indices.
-
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 positionCollection<String>
getProvidedLabels()
Returns the labels that are provided by thisIConfigLabelAccumulator
.
-
-
-
Field Detail
-
ODD_ROW_CONFIG_TYPE
public static final String ODD_ROW_CONFIG_TYPE
- See Also:
- Constant Field Values
-
EVEN_ROW_CONFIG_TYPE
public static final String EVEN_ROW_CONFIG_TYPE
- See Also:
- Constant Field Values
-
layer
protected ILayer layer
The layer that should be used for row index transformation ornull
if no transformation should be performed.- Since:
- 1.6
-
-
Constructor Detail
-
AlternatingRowConfigLabelAccumulator
public AlternatingRowConfigLabelAccumulator()
Creates an AlternatingRowConfigLabelAccumulator that operates on row positions. In several layer compositions, this will lead to jumping alternating colors, as e.g. the ViewportLayer updates row positions on scrolling.
-
AlternatingRowConfigLabelAccumulator
public AlternatingRowConfigLabelAccumulator(ILayer layer)
Creates an AlternatingRowConfigLabelAccumulator that operates on row indices. To achieve that it uses the given layer to calculate the row index by given row position.- Parameters:
layer
- The layer that should be used for row index transformation, typically the ViewportLayer or body layer stack.
-
-
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
- 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
-
getProvidedLabels
public Collection<String> getProvidedLabels()
Returns the labels that are provided by thisIConfigLabelAccumulator
. It needs to return all labels that might be applied to support the usage of corresponding selectors in NatTable CSS styling.- Specified by:
getProvidedLabels
in interfaceIConfigLabelProvider
- Returns:
- The labels that are provided by this
IConfigLabelAccumulator
. - Since:
- 1.4
-
-