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). CustomICellEditor
,ICellPainter
,IStyle
can then be registered in theIConfigRegistry
against these labels. Also @seeRowOverrideLabelAccumulator
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALL_COLUMN_KEY
This key is used to register overrides for all columns.static String
PERSISTENCE_KEY
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description ColumnOverrideLabelAccumulator(ILayer layer)
-
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 positionvoid
loadState(String prefix, Properties properties)
Load the overrides state from the given properties file.void
registerColumnOverrides(int columnIndex, String... configLabels)
Register labels to be contributed a column.void
registerColumnOverrides(int columnIndex, List<String> configLabels)
Register labels to be contributed a column.void
registerColumnOverridesOnTop(int columnIndex, String... configLabels)
Register labels to be contributed a column.void
registerColumnOverridesOnTop(int columnIndex, List<String> configLabels)
Register labels to be contributed a column.void
registerOverrides(String configLabel)
Register a label to be contributed to all columns.void
registerOverrides(List<String> configLabels)
Register labels to be contributed to all columns.void
registerOverridesOnTop(String configLabel)
Register a label to be contributed to all columns.void
registerOverridesOnTop(List<String> configLabels)
Register labels to be contributed to all columns.void
saveState(String prefix, Properties properties)
Save the overrides to a properties file.void
unregisterOverrides(int columnIndex, String configLabel)
Unregister a label that was contributed for a column.void
unregisterOverrides(int columnIndex, String... configLabels)
Unregister labels that were contributed for a column.void
unregisterOverrides(String configLabel)
Unregister a label that was contributed for all columns.void
unregisterOverrides(List<String> configLabels)
Unregister labels that were contributed for all columns.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.cell.AbstractOverrider
addOverrides, getOverrides, getOverrides, getProvidedLabels, registerOverrides, registerOverrides, registerOverridesOnTop, registerOverridesOnTop, removeOverride
-
-
-
-
Field Detail
-
PERSISTENCE_KEY
public static final String PERSISTENCE_KEY
- See Also:
- Constant Field Values
-
ALL_COLUMN_KEY
public static final String ALL_COLUMN_KEY
This key is used to register overrides for all columns.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ColumnOverrideLabelAccumulator
public ColumnOverrideLabelAccumulator(ILayer layer)
-
-
Method Detail
-
accumulateConfigLabels
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition)
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
-
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 interfaceIPersistable
- 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 interfaceIPersistable
- 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:
saveState(String, Properties)
-
-