Class GridLayer
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
org.eclipse.nebula.widgets.nattable.layer.CompositeLayer
org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer
- All Implemented Interfaces:
ILayer,ILayerListener,IPersistable
- Direct Known Subclasses:
ColumnStructureUpdatesExampleGridLayer,DefaultGridLayer,FilterRowExampleGridLayer,GlazedListsGridLayer,GlazedListsGridLayer,SelectionExampleGridLayer,StaticFilterExampleGridLayer
Top level layer. It is composed of the smaller child layers: RowHeader,
ColumnHeader, Corner and Body It does not have its own coordinate system
unlike the other layers. It simply delegates most functions to its child
layers.
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoCommand(ILayerCommand command) Opportunity to respond to a command as it flows down the stack.protected booleandoCommandOnChildLayers(ILayerCommand command) How the GridLayer processes commands is very important.protected voidinit(boolean useDefaultConfiguration) protected voidLayers should use this method to register their command handlers and call it from their constructor.voidsetBodyLayer(ILayer bodyLayer) voidsetColumnHeaderLayer(ILayer columnHeaderLayer) voidsetCornerLayer(ILayer cornerLayer) voidsetRowHeaderLayer(ILayer rowHeaderLayer) toString()Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.CompositeLayer
addConfigLabelAccumulatorForRegion, configure, dispose, getBoundsByPosition, getCellByPosition, getCellPainter, getChildLayerByLayoutCoordinate, getChildLayerByRegionName, getChildLayerLayout, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnPositionOffset, getColumnWidthByPosition, getConfigLabelAccumulatorByRegionName, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getHeightOffset, getLayoutXByColumnPosition, getLayoutXByPixelX, getLayoutXCount, getLayoutXYByChildLayer, getLayoutXYByPixelXY, getLayoutXYByPosition, getLayoutYByPixelY, getLayoutYByRowPosition, getLayoutYCount, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getProvidedLabels, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getRowPositionOffset, getStartXOfColumnPosition, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, getWidthOffset, isColumnPositionResizable, isDynamicSizeLayer, isRowPositionResizable, loadState, localToUnderlyingColumnPosition, localToUnderlyingRowPosition, saveState, setChildLayer, setConfigLabelAccumulatorForRegion, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, underlyingToLocalRowPosition, underlyingToLocalRowPositionsMethods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getClientAreaProvider, getConfigLabelAccumulator, getLayerPainter, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setClientAreaProvider, setConfigLabelAccumulator, setLayerPainter, setRegionName, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable
-
Constructor Details
-
GridLayer
-
GridLayer
-
GridLayer
protected GridLayer(boolean useDefaultConfiguration)
-
-
Method Details
-
init
protected void init(boolean useDefaultConfiguration) -
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
-
doCommandOnChildLayers
How the GridLayer processes commands is very important. Do not change this unless you know what you are doing and understand the full ramifications of your change. Otherwise your grid will not behave correctly! The Body is always given the first chance to process a command. There are two reasons for this: (1) most commands (80%) are destined for the body anyways so it's faster to check there first (2) the other layers all transitively depend on the body so it's not wise to ask them to do stuff until after the body has done it. This is especially true of grid initialization where the body must be initialized before any of its dependent layers. Because of this, if you want to intercept well-known commands to implement custom behavior (for example, you want to intercept theSelectCellCommand) then you must inject your special layer into the body. An injected column or row header will never see the command because it will be consumed first by the body. In practice, it's a good idea to implement all your command-handling logic in the body.- Overrides:
doCommandOnChildLayersin classCompositeLayer
-
getCornerLayer
-
setCornerLayer
-
getColumnHeaderLayer
-
setColumnHeaderLayer
-
getRowHeaderLayer
-
setRowHeaderLayer
-
getBodyLayer
-
setBodyLayer
-
toString
- Overrides:
toStringin 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.
-