org.eclipse.nebula.widgets.nattable.style.editor.command
Class DisplayColumnStyleEditorCommandHandler

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<DisplayColumnStyleEditorCommand>
      extended by 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 the StyleEditorDialog 2. Registers style from step 1 in the ConfigRegistry with a new label 3. Applies the label from step 2 to all cells in the selected column


Field Summary
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
DisplayColumnStyleEditorCommandHandler(SelectionLayer selectionLayer, ColumnOverrideLabelAccumulator labelAccumulator, IConfigRegistry configRegistry)
           
 
Method Summary
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

stylesToPersist

protected final Map<String,Style> stylesToPersist
Constructor Detail

DisplayColumnStyleEditorCommandHandler

public DisplayColumnStyleEditorCommandHandler(SelectionLayer selectionLayer,
                                              ColumnOverrideLabelAccumulator labelAccumulator,
                                              IConfigRegistry configRegistry)
Method Detail

doCommand

public boolean doCommand(DisplayColumnStyleEditorCommand command)
Specified by:
doCommand in class AbstractLayerCommandHandler<DisplayColumnStyleEditorCommand>

getCommandClass

public Class<DisplayColumnStyleEditorCommand> getCommandClass()
Specified by:
getCommandClass in interface ILayerCommandHandler<DisplayColumnStyleEditorCommand>

applySelectedStyleToColumns

protected void applySelectedStyleToColumns(DisplayColumnStyleEditorCommand command,
                                           int[] columnIndeces)

applySelectedStyle

protected void applySelectedStyle()

applySelectedStyle

protected void applySelectedStyle(Style newColumnCellStyle,
                                  String configLabel)

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 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.

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 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.


Copyright © 2014. All rights reserved.