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
-
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, layerPainterFields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionCompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer) CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer, boolean useDefaultConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoCommand(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.intgetColumnPositionByIndex(int columnIndex) protected intgetLayoutXByColumnPosition(int compositeColumnPosition) protected org.eclipse.swt.graphics.PointgetLayoutXYByPosition(int compositeColumnPosition, int compositeRowPosition) protected intgetLayoutYByRowPosition(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.intgetRowPositionByIndex(int rowIndex) voidhandleLayerEvent(ILayerEvent event) Handle layer event notification.booleanisFrozen()voidloadState(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.Modifies a column spanned cell in case the spanned cell is in the frozen area but the origin column is not visible as the frozen state was created in scrolled state.Modifies a row spanned cell in case the spanned cell is in the frozen area but the origin row is not visible as the frozen state was created in scrolled state.protected voidLayers should use this method to register their command handlers and call it from their constructor.voidsaveState(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, underlyingToLocalRowPositionsMethods 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, unregisterPersistableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Details
-
CompositeFreezeLayer
public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer) -
CompositeFreezeLayer
public CompositeFreezeLayer(FreezeLayer freezeLayer, ViewportLayer viewportLayer, SelectionLayer selectionLayer, boolean useDefaultConfiguration)
-
-
Method Details
-
handleLayerEvent
Description copied from class:AbstractLayerHandle 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:
handleLayerEventin interfaceILayerListener- Overrides:
handleLayerEventin classAbstractLayer- Parameters:
event- the event
-
isFrozen
public boolean isFrozen() -
registerCommandHandlers
protected void registerCommandHandlers()Description copied from class:AbstractLayerLayers 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:
registerCommandHandlersin classAbstractLayer
-
doCommand
Description copied from class:CompositeLayerOpportunity 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:
doCommandin interfaceILayer- Overrides:
doCommandin classCompositeLayer- Parameters:
command- The command to execute.- Returns:
trueif the command has been handled and was therefore consumed,falseotherwise.
-
getColumnPositionByIndex
public int getColumnPositionByIndex(int columnIndex) - Specified by:
getColumnPositionByIndexin interfaceIUniqueIndexLayer
-
getRowPositionByIndex
public int getRowPositionByIndex(int rowIndex) - Specified by:
getRowPositionByIndexin interfaceIUniqueIndexLayer
-
getLayoutXByColumnPosition
protected int getLayoutXByColumnPosition(int compositeColumnPosition) - Overrides:
getLayoutXByColumnPositionin classCompositeLayer
-
getLayoutYByRowPosition
protected int getLayoutYByRowPosition(int compositeRowPosition) - Overrides:
getLayoutYByRowPositionin classCompositeLayer
-
getLayoutXYByPosition
protected org.eclipse.swt.graphics.Point getLayoutXYByPosition(int compositeColumnPosition, int compositeRowPosition) - Overrides:
getLayoutXYByPositionin classCompositeLayer
-
modifyColumnSpanLayerCell
Modifies a column spanned cell in case the spanned cell is in the frozen area but the origin column is not visible as the frozen state was created in scrolled state.- Parameters:
cell- The cell to check and modify.- Returns:
- The given
ILayerCellor a modified one in case it needs to be updated. - Since:
- 2.1
-
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
-
modifyRowSpanLayerCell
Modifies a row spanned cell in case the spanned cell is in the frozen area but the origin row is not visible as the frozen state was created in scrolled state.- Parameters:
cell- The cell to check and modify.- Returns:
- The given
ILayerCellor a modified one in case it needs to be updated. - Since:
- 2.1
-
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
Description copied from interface:IPersistableSaves 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:
saveStatein interfaceIPersistable- Overrides:
saveStatein 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
Description copied from interface:IPersistableRestore 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:
loadStatein interfaceIPersistable- Overrides:
loadStatein 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.
-