org.eclipse.nebula.widgets.nattable.hideshow
Class ColumnHideShowLayer

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
      extended by org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
          extended by org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer
              extended by org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer
All Implemented Interfaces:
ILayer, ILayerListener, IUniqueIndexLayer, IPersistable
Direct Known Subclasses:
BaseColumnHideShowLayerFixture, ColumnHideShowLayerFixture

public class ColumnHideShowLayer
extends AbstractColumnHideShowLayer


Field Summary
static String PERSISTENCE_KEY_HIDDEN_COLUMN_INDEXES
           
 
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
underlyingLayer
 
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, layerPainter
 
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
 
Constructor Summary
ColumnHideShowLayer(IUniqueIndexLayer underlyingLayer)
           
 
Method Summary
 Collection<Integer> getHiddenColumnIndexes()
          Will collect and return all indexes of the columns that are hidden in this layer.
 void handleLayerEvent(ILayerEvent event)
          Handle layer event notification.
 void hideColumnPositions(Collection<Integer> columnPositions)
           
 boolean isColumnIndexHidden(int columnIndex)
          Will check if the column at the specified index is hidden or not.
 void loadState(String prefix, Properties properties)
          Underlying layers must load state first.
 void saveState(String prefix, Properties properties)
          Saves the state to the given Properties using the specified prefix.
 void showAllColumns()
           
 void showColumnIndexes(Collection<Integer> columnIndexes)
           
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer
getColumnCount, getColumnIndexByPosition, getColumnPositionByIndex, getColumnPositionByX, getColumnPositionsByIndexes, getRowPositionByIndex, getStartXOfColumnPosition, getWidth, invalidateCache, localToUnderlyingColumnPosition, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingRowPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalRowPosition, underlyingToLocalRowPositions
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayer
addLayerListener, configure, dispose, doCommand, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, hasLayerListener, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingRowPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalRowPosition, underlyingToLocalRowPositions, unregisterCommandHandler, unregisterPersistable
 

Field Detail

PERSISTENCE_KEY_HIDDEN_COLUMN_INDEXES

public static final String PERSISTENCE_KEY_HIDDEN_COLUMN_INDEXES
See Also:
Constant Field Values
Constructor Detail

ColumnHideShowLayer

public ColumnHideShowLayer(IUniqueIndexLayer underlyingLayer)
Method Detail

handleLayerEvent

public void handleLayerEvent(ILayerEvent event)
Description copied from class: AbstractLayer
Handle layer event notification. Convert it to your context and propagate UP. If you override this method you MUST NOT FORGET to raise the event up the layer stack by calling super.fireLayerEvent(event) - unless you plan to eat the event yourself.

Specified by:
handleLayerEvent in interface ILayerListener
Overrides:
handleLayerEvent in class AbstractColumnHideShowLayer
Parameters:
event - the event

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
Overrides:
saveState in class AbstractLayerTransform
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)
Description copied from class: AbstractLayerTransform
Underlying layers must load state first. If this is not done, IStructuralChangeEvent from underlying layers will reset caches after state has been loaded

Specified by:
loadState in interface IPersistable
Overrides:
loadState in class AbstractLayerTransform
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.

isColumnIndexHidden

public boolean isColumnIndexHidden(int columnIndex)
Description copied from class: AbstractColumnHideShowLayer
Will check if the column at the specified index is hidden or not. Checks this layer and also the sublayers for the visibility. Note: As the ColumnGroupModel.ColumnGroups are created index based, this method only works correctly with indexes rather than positions.

Specified by:
isColumnIndexHidden in class AbstractColumnHideShowLayer
Parameters:
columnIndex - The column index of the column whose visibility state should be checked.
Returns:
true if the column at the specified index is hidden, false if it is visible.

getHiddenColumnIndexes

public Collection<Integer> getHiddenColumnIndexes()
Description copied from class: AbstractColumnHideShowLayer
Will collect and return all indexes of the columns that are hidden in this layer. Note: It is not intended that it also collects the column indexes of underlying layers. This would cause issues on calculating positions as every layer is responsible for those calculations itself.

Specified by:
getHiddenColumnIndexes in class AbstractColumnHideShowLayer
Returns:
Collection of all column indexes that are hidden in this layer.

hideColumnPositions

public void hideColumnPositions(Collection<Integer> columnPositions)

showColumnIndexes

public void showColumnIndexes(Collection<Integer> columnIndexes)

showAllColumns

public void showAllColumns()


Copyright © 2015. All rights reserved.