public class CopyDataCommandHandler extends AbstractLayerCommandHandler<CopyDataToClipboardCommand>
SelectionLayer
to the clipboard.
This handler is registered by default with the SelectionLayer
, without references
to the header regions. You can override the copy data behaviour by registering an instance
of this handler to a layer above the SelectionLayer
. This way the registered custom
instance will consume a CopyDataToClipboardCommand
and the registered default handler
won't be called.Constructor and Description |
---|
CopyDataCommandHandler(SelectionLayer selectionLayer)
Creates an instance that only checks the
SelectionLayer for data to add to the
clipboard. |
CopyDataCommandHandler(SelectionLayer selectionLayer,
ILayer columnHeaderDataLayer,
ILayer rowHeaderDataLayer)
Creates an instance that checks the
SelectionLayer and the header layers if they are given. |
Modifier and Type | Method and Description |
---|---|
protected ILayerCell[] |
assembleBody(int currentRowPosition)
Collects and assembles the selected data per row position that should be copied to the clipboard.
|
protected ILayerCell[][] |
assembleColumnHeaders()
Creates the two dimensional array whose dimensions are calculated based on the selection
within the
SelectionLayer and the configured column and row headers. |
protected ILayerCell[][] |
assembleCopiedDataStructure()
Collects and assembles the selected data that should be copied to the clipboard.
|
boolean |
doCommand(CopyDataToClipboardCommand command) |
Class<CopyDataToClipboardCommand> |
getCommandClass() |
void |
setCopyFormattedText(boolean copyFormattedText)
TODO
|
doCommand
public CopyDataCommandHandler(SelectionLayer selectionLayer)
SelectionLayer
for data to add to the
clipboard.selectionLayer
- The SelectionLayer
within the NatTable. Can not be null
.public CopyDataCommandHandler(SelectionLayer selectionLayer, ILayer columnHeaderDataLayer, ILayer rowHeaderDataLayer)
SelectionLayer
and the header layers if they are given.selectionLayer
- The SelectionLayer
within the NatTable. Can not be null
.columnHeaderDataLayer
- The column header data layer within the NatTable grid. Can be null
.rowHeaderDataLayer
- The row header data layer within the NatTable grid. Can be null
.public void setCopyFormattedText(boolean copyFormattedText)
copyFormattedText
- public boolean doCommand(CopyDataToClipboardCommand command)
doCommand
in class AbstractLayerCommandHandler<CopyDataToClipboardCommand>
public Class<CopyDataToClipboardCommand> getCommandClass()
protected ILayerCell[][] assembleCopiedDataStructure()
protected ILayerCell[][] assembleColumnHeaders()
SelectionLayer
and the configured column and row headers.
If there is a column header configured for this handler, the column header information
will be added to the resulting array in here. If there is no column header configured
an empty array with the matching dimensions will be returned.protected ILayerCell[] assembleBody(int currentRowPosition)
currentRowPosition
- The row position of which the selected cells should be collected.Copyright © 2013. All Rights Reserved.