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:
  • Field Details

    • ODD_ROW_CONFIG_TYPE

      public static final String ODD_ROW_CONFIG_TYPE
      See Also:
    • EVEN_ROW_CONFIG_TYPE

      public static final String EVEN_ROW_CONFIG_TYPE
      See Also:
    • layer

      protected ILayer layer
      The layer that should be used for row index transformation or null if no transformation should be performed.
      Since:
      1.6
  • Constructor Details

    • 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 Details

    • 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 interface IConfigLabelAccumulator
      Parameters:
      configLabels - the labels currently applied to the cell. The labels contributed by this provider must be added to this stack
      columnPosition - of the cell for which labels are being gathered
      rowPosition - of the cell for which labels are being gathered
    • getProvidedLabels

      public Collection<String> getProvidedLabels()
      Returns the labels that are provided by this IConfigLabelAccumulator. 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 interface IConfigLabelProvider
      Returns:
      The labels that are provided by this IConfigLabelAccumulator.
      Since:
      1.4