Class RowHideShowLayer
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
-
- org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
-
- org.eclipse.nebula.widgets.nattable.hideshow.AbstractRowHideShowLayer
-
- org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer
-
- All Implemented Interfaces:
IRowHideShowLayer
,ILayer
,ILayerListener
,IUniqueIndexLayer
,IPersistable
- Direct Known Subclasses:
RowHideShowLayerFixture
public class RowHideShowLayer extends AbstractRowHideShowLayer implements IRowHideShowLayer
-
-
Field Summary
Fields Modifier and Type Field Description 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
commandHandlers, eventHandlers, eventHelperLock, layerPainter
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description RowHideShowLayer(IUniqueIndexLayer underlyingLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelStack
getConfigLabelsByPosition(int columnPosition, int rowPosition)
Returns the config labels for the cell at the given coordinates.Collection<Integer>
getHiddenRowIndexes()
Will collect and return all indexes of the rows that are hidden in this layer.int[]
getHiddenRowIndexesArray()
Will collect and return all indexes of the rows that are hidden in this layer.Collection<String>
getProvidedLabels()
void
handleLayerEvent(ILayerEvent event)
Handle layer event notification.boolean
hasHiddenRows()
Check if this layer actively hides rows.void
hideRowIndexes(int... rowIndexes)
Hide the rows with the given indexes.void
hideRowIndexes(Collection<Integer> rowIndexes)
Hide the rows with the given indexes.void
hideRowPositions(int... rowPositions)
Hide the rows at the given positions.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(int... rowIndexes)
Show the rows with the given indexes again.void
showRowIndexes(Collection<Integer> rowIndexes)
Show the rows with the given indexes again.void
showRowPosition(int rowPosition, boolean showToTop, boolean showAll)
Show the row(s) that are hidden next to the given row position.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.hideshow.AbstractRowHideShowLayer
cacheVisibleRowIndexes, getCellByPosition, getColumnPositionByIndex, getHeight, getRowCount, getRowIndexByPosition, getRowPositionByIndex, getRowPositionByY, getRowPositionsByIndexes, getRowPositionsByIndexes, getStartYOfRowPosition, getUnderlyingLayer, invalidateCache, localToUnderlyingRowPosition, underlyingToLocalRowPosition, underlyingToLocalRowPositions
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform
configure, dispose, doCommand, getCellPainter, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isDynamicSizeLayer, 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, getCellPainter, getClientAreaProvider, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isDynamicSizeLayer, 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 callingsuper.fireLayerEvent(event)
- unless you plan to eat the event yourself.- Specified by:
handleLayerEvent
in interfaceILayerListener
- Overrides:
handleLayerEvent
in classAbstractRowHideShowLayer
- 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 interfaceIPersistable
- Overrides:
saveState
in classAbstractLayerTransform
- 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 interfaceIPersistable
- Overrides:
loadState
in classAbstractLayerTransform
- 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.
-
getConfigLabelsByPosition
public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition)
Description copied from interface:ILayer
Returns the config labels for the cell at the given coordinates. Needed to retrieve the corresponding configurations out of theIConfigRegistry
.- Specified by:
getConfigLabelsByPosition
in interfaceILayer
- Overrides:
getConfigLabelsByPosition
in classAbstractLayerTransform
- Parameters:
columnPosition
- The column position of the cell.rowPosition
- The row position of the cell.- Returns:
- The
LabelStack
with the config labels for the cell at the given coordinates.
-
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 classAbstractRowHideShowLayer
- 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.
Since 2.0 it is recommended to use
AbstractRowHideShowLayer.getHiddenRowIndexesArray()
to avoid unnecessary autoboxing operations.- Specified by:
getHiddenRowIndexes
in classAbstractRowHideShowLayer
- Returns:
- Collection of all row indexes that are hidden in this layer.
-
getHiddenRowIndexesArray
public int[] getHiddenRowIndexesArray()
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:
getHiddenRowIndexesArray
in classAbstractRowHideShowLayer
- Returns:
- All row indexes that are hidden in this layer.
-
hasHiddenRows
public boolean hasHiddenRows()
Description copied from class:AbstractRowHideShowLayer
Check if this layer actively hides rows.- Specified by:
hasHiddenRows
in classAbstractRowHideShowLayer
- Returns:
true
if rows are hidden by this layer,false
if not.
-
hideRowPositions
public void hideRowPositions(int... rowPositions)
Description copied from interface:IRowHideShowLayer
Hide the rows at the given positions.- Specified by:
hideRowPositions
in interfaceIRowHideShowLayer
- Parameters:
rowPositions
- The positions of the rows to hide.
-
hideRowPositions
public void hideRowPositions(Collection<Integer> rowPositions)
Description copied from interface:IRowHideShowLayer
Hide the rows at the given positions.- Specified by:
hideRowPositions
in interfaceIRowHideShowLayer
- Parameters:
rowPositions
- The positions of the rows to hide.
-
hideRowIndexes
public void hideRowIndexes(int... rowIndexes)
Description copied from interface:IRowHideShowLayer
Hide the rows with the given indexes.- Specified by:
hideRowIndexes
in interfaceIRowHideShowLayer
- Parameters:
rowIndexes
- The indexes of the rows to hide.
-
hideRowIndexes
public void hideRowIndexes(Collection<Integer> rowIndexes)
Description copied from interface:IRowHideShowLayer
Hide the rows with the given indexes.- Specified by:
hideRowIndexes
in interfaceIRowHideShowLayer
- Parameters:
rowIndexes
- The indexes of the rows to hide.
-
showRowIndexes
public void showRowIndexes(int... rowIndexes)
Description copied from interface:IRowHideShowLayer
Show the rows with the given indexes again.- Specified by:
showRowIndexes
in interfaceIRowHideShowLayer
- Parameters:
rowIndexes
- The indexes of the rows that should be showed again.
-
showRowIndexes
public void showRowIndexes(Collection<Integer> rowIndexes)
Description copied from interface:IRowHideShowLayer
Show the rows with the given indexes again.- Specified by:
showRowIndexes
in interfaceIRowHideShowLayer
- Parameters:
rowIndexes
- The indexes of the rows that should be showed again.
-
showRowPosition
public void showRowPosition(int rowPosition, boolean showToTop, boolean showAll)
Description copied from interface:IRowHideShowLayer
Show the row(s) that are hidden next to the given row position.- Specified by:
showRowPosition
in interfaceIRowHideShowLayer
- Parameters:
rowPosition
- The row position whose neighbors should be shown again.showToTop
- Whether the row positions to the top or the bottom of the given row position should be shown again.showAll
- Whether all hidden adjacent rows should be shown again or only the single direct adjacent row.
-
showAllRows
public void showAllRows()
Description copied from interface:IRowHideShowLayer
Show all rows that where previously hidden.- Specified by:
showAllRows
in interfaceIRowHideShowLayer
-
getProvidedLabels
public Collection<String> getProvidedLabels()
- Specified by:
getProvidedLabels
in interfaceILayer
- Overrides:
getProvidedLabels
in classAbstractLayer
- Returns:
- The collection of labels that are provided by this layer.
-
-