Class CompositeFreezeLayer
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
-
- org.eclipse.nebula.widgets.nattable.layer.CompositeLayer
-
- org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer
-
- All Implemented Interfaces:
ILayer
,ILayerListener
,IUniqueIndexLayer
,IPersistable
public class CompositeFreezeLayer extends CompositeLayer implements IUniqueIndexLayer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.layer.CompositeLayer
CompositeLayer.CompositeLayerPainter
-
-
Field Summary
-
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 CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer)
CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer, boolean useDefaultConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doCommand(ILayerCommand command)
Opportunity to respond to a command as it flows down the stack.int[]
getColumnBounds(int columnPosition, int startColumn, int endColumn)
This method is used to determine the bounds of a cell with column span in case of an active freeze.int
getColumnPositionByIndex(int columnIndex)
protected int
getLayoutXByColumnPosition(int compositeColumnPosition)
protected org.eclipse.swt.graphics.Point
getLayoutXYByPosition(int compositeColumnPosition, int compositeRowPosition)
protected int
getLayoutYByRowPosition(int compositeRowPosition)
int[]
getRowBounds(int rowPosition, int startRow, int endRow)
This method is used to determine the bounds of a cell with row span in case of an active freeze.int
getRowPositionByIndex(int rowIndex)
void
handleLayerEvent(ILayerEvent event)
Handle layer event notification.boolean
isFrozen()
void
loadState(String prefix, Properties properties)
Restore the state out of the given Properties identified by the specified prefix.protected void
registerCommandHandlers()
Layers should use this method to register their command handlers and call it from their constructor.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.layer.CompositeLayer
addConfigLabelAccumulatorForRegion, configure, dispose, doCommandOnChildLayers, getBoundsByPosition, getCellByPosition, getCellPainter, getChildLayerByLayoutCoordinate, getChildLayerByRegionName, getChildLayerLayout, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnPositionOffset, getColumnWidthByPosition, getConfigLabelAccumulatorByRegionName, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getHeightOffset, getLayoutXByPixelX, getLayoutXCount, getLayoutXYByChildLayer, getLayoutXYByPixelXY, getLayoutYByPixelY, getLayoutYCount, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getProvidedLabels, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getRowPositionOffset, getStartXOfColumnPosition, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, getWidthOffset, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, setChildLayer, setConfigLabelAccumulatorForRegion, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositions
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getClientAreaProvider, getConfigLabelAccumulator, getLayerPainter, getRegionName, hasLayerListener, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setClientAreaProvider, 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, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getProvidedLabels, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartXOfColumnPosition, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositions, unregisterCommandHandler, unregisterPersistable
-
-
-
-
Constructor Detail
-
CompositeFreezeLayer
public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer)
-
CompositeFreezeLayer
public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer, boolean useDefaultConfiguration)
-
-
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 classAbstractLayer
- Parameters:
event
- the event
-
isFrozen
public boolean isFrozen()
-
registerCommandHandlers
protected void registerCommandHandlers()
Description copied from class:AbstractLayer
Layers should use this method to register their command handlers and call it from their constructor. This allows easy overriding if required of command handlers- Overrides:
registerCommandHandlers
in classAbstractLayer
-
doCommand
public boolean doCommand(ILayerCommand command)
Description copied from class:CompositeLayer
Opportunity to respond to a command as it flows down the stack. If the layer is not interested in the command it should allow the command to keep traveling down the stack.Note: Before the layer can process a command it must convert the command to its local coordinates using
ILayerCommand.convertToTargetLayer(ILayer)
Handle commands- Specified by:
doCommand
in interfaceILayer
- Overrides:
doCommand
in classCompositeLayer
- Parameters:
command
- The command to execute.- Returns:
true
if the command has been handled and was therefore consumed,false
otherwise.
-
getColumnPositionByIndex
public int getColumnPositionByIndex(int columnIndex)
- Specified by:
getColumnPositionByIndex
in interfaceIUniqueIndexLayer
-
getRowPositionByIndex
public int getRowPositionByIndex(int rowIndex)
- Specified by:
getRowPositionByIndex
in interfaceIUniqueIndexLayer
-
getLayoutXByColumnPosition
protected int getLayoutXByColumnPosition(int compositeColumnPosition)
- Overrides:
getLayoutXByColumnPosition
in classCompositeLayer
-
getLayoutYByRowPosition
protected int getLayoutYByRowPosition(int compositeRowPosition)
- Overrides:
getLayoutYByRowPosition
in classCompositeLayer
-
getLayoutXYByPosition
protected org.eclipse.swt.graphics.Point getLayoutXYByPosition(int compositeColumnPosition, int compositeRowPosition)
- Overrides:
getLayoutXYByPosition
in classCompositeLayer
-
getColumnBounds
public int[] getColumnBounds(int columnPosition, int startColumn, int endColumn)
This method is used to determine the bounds of a cell with column span in case of an active freeze. This is needed because column positions can be ambiguous if the start column of a spanned cell is moved below the frozen area.- Parameters:
columnPosition
- The column position that was used to retrieve the cell. Needed to identify the origin layout in order to know if the start needs to be searched in the frozen or the scrollable area.startColumn
- The start column position of the spanned cell.endColumn
- The end column position of the spanned cell.- Returns:
- int array that contains the start x position of a cell in the first element, and the width of the cell in the second element.
- Since:
- 1.6
-
getRowBounds
public int[] getRowBounds(int rowPosition, int startRow, int endRow)
This method is used to determine the bounds of a cell with row span in case of an active freeze. This is needed because row positions can be ambiguous if the start row of a spanned cell is moved below the frozen area.- Parameters:
rowPosition
- The row position that was used to retrieve the cell. Needed to identify the origin layout in order to know if the start needs to be searched in the frozen or the scrollable area.startRow
- The start row position of the spanned cell.endRow
- The end row position of the spanned cell.- Returns:
- int array that contains the start y position of a cell in the first element, and the height of the cell in the second element.
- Since:
- 1.6
-
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 classCompositeLayer
- 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 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
- Overrides:
loadState
in classCompositeLayer
- 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.
-
-