Class ColumnOverrideLabelAccumulator

java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.cell.AbstractOverrider
org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator
All Implemented Interfaces:
IConfigLabelAccumulator, IConfigLabelProvider, IPersistable

public class ColumnOverrideLabelAccumulator extends AbstractOverrider implements IPersistable
Registers/Adds configuration labels for a given column (by index). Custom ICellEditor, ICellPainter, IStyle can then be registered in the IConfigRegistry against these labels. Also @see RowOverrideLabelAccumulator
  • Field Details

  • Constructor Details

    • ColumnOverrideLabelAccumulator

      public ColumnOverrideLabelAccumulator(ILayer layer)
  • Method Details

    • accumulateConfigLabels

      public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition)
      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
    • registerColumnOverrides

      public void registerColumnOverrides(int columnIndex, String... configLabels)
      Register labels to be contributed a column. This label will be applied to all cells in the column.
      Parameters:
      columnIndex - The column index of the column to which the config label should be contributed.
      configLabels - The config labels to add.
    • registerColumnOverrides

      public void registerColumnOverrides(int columnIndex, List<String> configLabels)
      Register labels to be contributed a column. This label will be applied to all cells in the column.
      Parameters:
      columnIndex - The column index of the column to which the config label should be contributed.
      configLabels - The config labels to add.
    • registerColumnOverridesOnTop

      public void registerColumnOverridesOnTop(int columnIndex, String... configLabels)
      Register labels to be contributed a column. This label will be applied to all cells in the column. Using this method will add the labels on top of the label stack.
      Parameters:
      columnIndex - The column index of the column to which the config label should be contributed.
      configLabels - The config labels to add.
    • registerColumnOverridesOnTop

      public void registerColumnOverridesOnTop(int columnIndex, List<String> configLabels)
      Register labels to be contributed a column. This label will be applied to all cells in the column. Using this method will add the labels on top of the label stack.
      Parameters:
      columnIndex - The column index of the column to which the config label should be contributed.
      configLabels - The config labels to add.
    • unregisterOverrides

      public void unregisterOverrides(int columnIndex, String configLabel)
      Unregister a label that was contributed for a column.
      Parameters:
      columnIndex - The column index of the column to which a config label was contributed.
      configLabel - The config label to remove.
    • unregisterOverrides

      public void unregisterOverrides(int columnIndex, String... configLabels)
      Unregister labels that were contributed for a column.
      Parameters:
      columnIndex - The column index of the column to which a config label was contributed.
      configLabels - The config labels to remove.
    • registerOverrides

      public void registerOverrides(String configLabel)
      Register a label to be contributed to all columns. This label will be applied to all cells.
      Parameters:
      configLabel - The config label that should be added to all cells.
    • registerOverrides

      public void registerOverrides(List<String> configLabels)
      Register labels to be contributed to all columns. These labels will be applied to all cells.
      Parameters:
      configLabels - The config labels that should be added to all cells.
    • registerOverridesOnTop

      public void registerOverridesOnTop(String configLabel)
      Register a label to be contributed to all columns. This label will be applied to all cells.
      Parameters:
      configLabel - The config label that should be added to all cells.
    • registerOverridesOnTop

      public void registerOverridesOnTop(List<String> configLabels)
      Register labels to be contributed to all columns. These labels will be applied to all cells.
      Parameters:
      configLabels - The config labels that should be added to all cells.
    • unregisterOverrides

      public void unregisterOverrides(String configLabel)
      Unregister a label that was contributed for all columns.
      Parameters:
      configLabel - The config label to remove.
    • unregisterOverrides

      public void unregisterOverrides(List<String> configLabels)
      Unregister labels that were contributed for all columns.
      Parameters:
      configLabels - The config labels to remove.
    • saveState

      public void saveState(String prefix, Properties properties)
      Save the overrides to a properties file. A line is stored for every column. Example for column 0: prefix.columnOverrideLabelAccumulator.0 = LABEL1,LABEL2
      Specified by:
      saveState in interface IPersistable
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to save the state to.
    • loadState

      public void loadState(String prefix, Properties properties)
      Load the overrides state from the given properties file.
      Specified by:
      loadState in interface IPersistable
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to load the state from.
      See Also: