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

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.AbstractRowHideShowLayer
              extended by org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer
All Implemented Interfaces:
IRowHideShowCommandLayer, ILayer, ILayerListener, IUniqueIndexLayer, IPersistable
Direct Known Subclasses:
BaseRowHideShowLayerFixture, RowHideShowLayerFixture

public class RowHideShowLayer
extends AbstractRowHideShowLayer
implements IRowHideShowCommandLayer


Field Summary
static String PERSISTENCE_KEY_HIDDEN_ROW_INDEXES
           
 
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
underlyingLayer
 
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
layerPainter
 
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
 
Constructor Summary
RowHideShowLayer(IUniqueIndexLayer underlyingLayer)
           
 
Method Summary
 Collection<Integer> getHiddenRowIndexes()
          Will collect and return all indexes of the rows that are hidden in this layer.
 void handleLayerEvent(ILayerEvent event)
          Handle layer event notification.
 void hideRowIndexes(Collection<Integer> rowIndexes)
          Hide the rows with the given indexes.
 void hideRowPositions(Collection<Integer> rowPositions)
          Hide the rows at the given positions.
 boolean isRowIndexHidden(int rowIndex)
          Will check if the row 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 showAllRows()
          Show all rows that where previously hidden.
 void showRowIndexes(Collection<Integer> rowIndexes)
          Show the rows with the given indexes again.
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.hideshow.AbstractRowHideShowLayer
cacheVisibleRowIndexes, getColumnPositionByIndex, getHeight, getRowCount, getRowIndexByPosition, getRowPositionByIndex, getRowPositionByY, getRowPositionsByIndexes, getStartYOfRowPosition, invalidateCache, localToUnderlyingRowPosition, underlyingToLocalRowPosition, underlyingToLocalRowPositions
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingColumnPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions
 
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, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingColumnPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, unregisterCommandHandler, unregisterPersistable
 

Field Detail

PERSISTENCE_KEY_HIDDEN_ROW_INDEXES

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

RowHideShowLayer

public RowHideShowLayer(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 AbstractRowHideShowLayer
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.

isRowIndexHidden

public boolean isRowIndexHidden(int rowIndex)
Description copied from class: AbstractRowHideShowLayer
Will check if the row at the specified index is hidden or not. Checks this layer and also the sublayers for the visibility.

Specified by:
isRowIndexHidden in class AbstractRowHideShowLayer
Parameters:
rowIndex - The row index of the row whose visibility state should be checked.
Returns:
true if the row at the specified index is hidden, false if it is visible.

getHiddenRowIndexes

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

Specified by:
getHiddenRowIndexes in class AbstractRowHideShowLayer
Returns:
Collection of all row indexes that are hidden in this layer.

hideRowPositions

public void hideRowPositions(Collection<Integer> rowPositions)
Description copied from interface: IRowHideShowCommandLayer
Hide the rows at the given positions.

Specified by:
hideRowPositions in interface IRowHideShowCommandLayer
Parameters:
rowPositions - The positions of the rows to hide.

hideRowIndexes

public void hideRowIndexes(Collection<Integer> rowIndexes)
Description copied from interface: IRowHideShowCommandLayer
Hide the rows with the given indexes.

Specified by:
hideRowIndexes in interface IRowHideShowCommandLayer
Parameters:
rowIndexes - The indexes of the rows to hide.

showRowIndexes

public void showRowIndexes(Collection<Integer> rowIndexes)
Description copied from interface: IRowHideShowCommandLayer
Show the rows with the given indexes again.

Specified by:
showRowIndexes in interface IRowHideShowCommandLayer
Parameters:
rowIndexes - The indexes of the rows that should be showed again.

showAllRows

public void showAllRows()
Description copied from interface: IRowHideShowCommandLayer
Show all rows that where previously hidden.

Specified by:
showAllRows in interface IRowHideShowCommandLayer


Copyright © 2014. All rights reserved.