Class DisplayColumnStyleEditorCommandHandler
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<DisplayColumnStyleEditorCommand>
-
- org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler
-
- All Implemented Interfaces:
ILayerCommandHandler<DisplayColumnStyleEditorCommand>
,IPersistable
public class DisplayColumnStyleEditorCommandHandler extends AbstractLayerCommandHandler<DisplayColumnStyleEditorCommand> implements IPersistable
1. Captures a new style using theStyleEditorDialog
2. Registers style from step 1 in theConfigRegistry
with a new label 3. Applies the label from step 2 to all cells in the selected column
-
-
Field Summary
Fields Modifier and Type Field Description protected ColumnOverrideLabelAccumulator
columnLabelAccumulator
protected ColumnStyleEditorDialog
dialog
protected static String
PERSISTENCE_PREFIX
protected SelectionLayer
selectionLayer
protected Map<String,Style>
stylesToPersist
protected static String
USER_EDITED_COLUMN_STYLE_LABEL_PREFIX
protected static String
USER_EDITED_STYLE_LABEL
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description DisplayColumnStyleEditorCommandHandler(SelectionLayer selectionLayer, ColumnOverrideLabelAccumulator labelAccumulator, IConfigRegistry configRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applySelectedStyle()
protected void
applySelectedStyle(Style newColumnCellStyle, String configLabel)
protected void
applySelectedStyleToColumns(DisplayColumnStyleEditorCommand command, int[] columnIndeces)
boolean
doCommand(DisplayColumnStyleEditorCommand command)
Class<DisplayColumnStyleEditorCommand>
getCommandClass()
protected String
getConfigLabel(int columnIndex)
void
loadState(String prefix, Properties properties)
Restore the state out of the given Properties identified by the specified prefix.protected int
parseColumnIndexFromKey(String keyString)
void
saveState(String prefix, Properties properties)
Saves the state to the given Properties using the specified prefix.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
-
-
-
Field Detail
-
PERSISTENCE_PREFIX
protected static final String PERSISTENCE_PREFIX
- See Also:
- Constant Field Values
-
USER_EDITED_STYLE_LABEL
protected static final String USER_EDITED_STYLE_LABEL
- See Also:
- Constant Field Values
-
USER_EDITED_COLUMN_STYLE_LABEL_PREFIX
protected static final String USER_EDITED_COLUMN_STYLE_LABEL_PREFIX
- See Also:
- Constant Field Values
-
selectionLayer
protected final SelectionLayer selectionLayer
-
columnLabelAccumulator
protected ColumnOverrideLabelAccumulator columnLabelAccumulator
-
dialog
protected ColumnStyleEditorDialog dialog
-
-
Constructor Detail
-
DisplayColumnStyleEditorCommandHandler
public DisplayColumnStyleEditorCommandHandler(SelectionLayer selectionLayer, ColumnOverrideLabelAccumulator labelAccumulator, IConfigRegistry configRegistry)
-
-
Method Detail
-
doCommand
public boolean doCommand(DisplayColumnStyleEditorCommand command)
- Specified by:
doCommand
in classAbstractLayerCommandHandler<DisplayColumnStyleEditorCommand>
-
getCommandClass
public Class<DisplayColumnStyleEditorCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<DisplayColumnStyleEditorCommand>
-
applySelectedStyleToColumns
protected void applySelectedStyleToColumns(DisplayColumnStyleEditorCommand command, int[] columnIndeces)
-
applySelectedStyle
protected void applySelectedStyle()
-
getConfigLabel
protected String getConfigLabel(int columnIndex)
-
loadState
public void loadState(String prefix, Properties properties)
Description copied from interface:IPersistable
Restore the state out of the given Properties identified by the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- 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.
-
parseColumnIndexFromKey
protected int parseColumnIndexFromKey(String keyString)
-
saveState
public void saveState(String prefix, Properties properties)
Description copied from interface:IPersistable
Saves the state to the given Properties using the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- 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.
-
-