Class SortColumnCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractColumnCommand
-
- org.eclipse.nebula.widgets.nattable.sort.command.SortColumnCommand
-
- All Implemented Interfaces:
ILayerCommand
public class SortColumnCommand extends AbstractColumnCommand
Command to trigger sorting.- See Also:
SortHeaderLayer
,SortCommandHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description SortColumnCommand(ILayer layer, int columnPosition)
Create aSortColumnCommand
that triggers sorting for replacing an existing sort state (no accumulate) without specifying a sort direction.SortColumnCommand(ILayer layer, int columnPosition, boolean accumulate)
Create aSortColumnCommand
that triggers sorting without specifying a sort direction.SortColumnCommand(ILayer layer, int columnPosition, boolean accumulate, SortDirectionEnum sortDirection)
SortColumnCommand(ILayer layer, int columnPosition, SortDirectionEnum sortDirection)
Create aSortColumnCommand
that triggers sorting for replacing an existing sort state (no accumulate).protected
SortColumnCommand(SortColumnCommand command)
Constructor that is used to clone a command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SortColumnCommand
cloneCommand()
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.SortDirectionEnum
getSortDirection()
boolean
isAccumulate()
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractColumnCommand
convertToTargetLayer, getColumnPosition, getLayer, toString
-
-
-
-
Constructor Detail
-
SortColumnCommand
public SortColumnCommand(ILayer layer, int columnPosition)
Create aSortColumnCommand
that triggers sorting for replacing an existing sort state (no accumulate) without specifying a sort direction.- Parameters:
layer
- The layer to which the column position belongs.columnPosition
- The position of the column for which the sorting should be applied.
-
SortColumnCommand
public SortColumnCommand(ILayer layer, int columnPosition, boolean accumulate)
Create aSortColumnCommand
that triggers sorting without specifying a sort direction.- Parameters:
layer
- The layer to which the column position belongs.columnPosition
- The position of the column for which the sorting should be applied.accumulate
-true
if the sorting should be accumulated to an already applied sorting,false
if the sorting should replace an existing sorting.
-
SortColumnCommand
public SortColumnCommand(ILayer layer, int columnPosition, SortDirectionEnum sortDirection)
Create aSortColumnCommand
that triggers sorting for replacing an existing sort state (no accumulate).- Parameters:
layer
- The layer to which the column position belongs.columnPosition
- The position of the column for which the sorting should be applied.
-
SortColumnCommand
public SortColumnCommand(ILayer layer, int columnPosition, boolean accumulate, SortDirectionEnum sortDirection)
- Parameters:
layer
- The layer to which the column position belongs.columnPosition
- The position of the column for which the sorting should be applied.accumulate
-true
if the sorting should be accumulated to an already applied sorting,false
if the sorting should replace an existing sorting.sortDirection
- The sort direction that should be used for sorting. Can benull
which means that the sort direction will be used that is calculated by the ISortModel for the given column.
-
SortColumnCommand
protected SortColumnCommand(SortColumnCommand command)
Constructor that is used to clone a command.- Parameters:
command
- The command instance that should be cloned.
-
-
Method Detail
-
isAccumulate
public boolean isAccumulate()
- Returns:
true
if the sorting should be accumulated to an already applied sorting,false
if the sorting should replace an existing sorting.
-
getSortDirection
public SortDirectionEnum getSortDirection()
- Returns:
- The sort direction that should be used for sorting. Can be
null
which means that the sort direction will be used that is calculated by the ISortModel for the given column.
-
cloneCommand
public SortColumnCommand 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.- Returns:
- a cloned instance of the command
- See Also:
GridLayer.doCommand(ILayerCommand)
-
-