Class ColumnGroupReorderCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.group.performance.command.ColumnGroupReorderCommand
-
- All Implemented Interfaces:
ILayerCommand
public class ColumnGroupReorderCommand extends Object implements ILayerCommand
Command to trigger reordering of a column group.The command does not inherit the ColumnReorderCommand as then it would be consumed first by the ColumnReorderLayer in the body layer stack and would not come to the column header layer stack.
- Since:
- 1.6
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ColumnGroupReorderCommand(ColumnGroupReorderCommand command)
Clone constructor.ColumnGroupReorderCommand(ILayer layer, int level, int fromColumnPosition, int toColumnPosition)
ColumnGroupReorderCommand(ILayer layer, int level, int fromColumnPosition, int toColumnPosition, boolean performConversion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnGroupReorderCommand
cloneCommand()
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.boolean
convertToTargetLayer(ILayer targetLayer)
Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer.int
getFromColumnPosition()
int
getLevel()
int
getToColumnPosition()
boolean
isReorderToLeftEdge()
-
-
-
Constructor Detail
-
ColumnGroupReorderCommand
public ColumnGroupReorderCommand(ILayer layer, int level, int fromColumnPosition, int toColumnPosition)
- Parameters:
layer
- The layer to which the positions match.level
- The group level on which the group reorder should be performed.fromColumnPosition
- The column position of the group that should be reordered.toColumnPosition
- The column position to which the reorder should be performed.
-
ColumnGroupReorderCommand
public ColumnGroupReorderCommand(ILayer layer, int level, int fromColumnPosition, int toColumnPosition, boolean performConversion)
- Parameters:
layer
- The layer to which the positions match.level
- The group level on which the group reorder should be performed.fromColumnPosition
- The column position of the group that should be reordered.toColumnPosition
- The column position to which the reorder should be performed.performConversion
- Configure whether a position conversion should be performed or not. If this value is set tofalse
convertToTargetLayer(ILayer)
does not perform any logic and will always returntrue
. In that case layer has to be the positionLayer of the ColumnGroupHeaderLayer, typically the SelectionLayer. Otherwise this command will not work correctly.
-
ColumnGroupReorderCommand
protected ColumnGroupReorderCommand(ColumnGroupReorderCommand command)
Clone constructor.- Parameters:
command
- The command to clone.
-
-
Method Detail
-
getLevel
public int getLevel()
- Returns:
- The group level on which the group reorder should be performed.
-
getFromColumnPosition
public int getFromColumnPosition()
- Returns:
- The column position of the group that should be reordered.
-
getToColumnPosition
public int getToColumnPosition()
- Returns:
- The column position to which the reorder should be performed.
-
isReorderToLeftEdge
public boolean isReorderToLeftEdge()
- Returns:
true
if the reorder should be performed to the left edge of the to position,false
if the reorder should happen to the right edge, e.g. on reordering to the end of the table.
-
convertToTargetLayer
public boolean convertToTargetLayer(ILayer targetLayer)
Description copied from interface:ILayerCommand
Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer. If it is not possible to convert the command to the target layer, then this method will return false and the state of this command object will remain unchanged. Note: Commands should not be processed if they fail conversion.- Specified by:
convertToTargetLayer
in interfaceILayerCommand
- Parameters:
targetLayer
- the target layer- Returns:
- true if the command is valid after conversion, false if the command is no longer valid.
-
cloneCommand
public ColumnGroupReorderCommand cloneCommand()
Description copied from interface:ILayerCommand
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.- Specified by:
cloneCommand
in interfaceILayerCommand
- Returns:
- a cloned instance of the command
- See Also:
GridLayer.doCommand(ILayerCommand)
-
-