Class ChooseColumnsFromCategoriesCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<ChooseColumnsFromCategoriesCommand>
org.eclipse.nebula.widgets.nattable.columnCategories.ChooseColumnsFromCategoriesCommandHandler
- All Implemented Interfaces:
IColumnCategoriesDialogListener
,ILayerCommandHandler<ChooseColumnsFromCategoriesCommand>
public class ChooseColumnsFromCategoriesCommandHandler
extends AbstractLayerCommandHandler<ChooseColumnsFromCategoriesCommand>
implements IColumnCategoriesDialogListener
-
Constructor Summary
ConstructorsConstructorDescriptionChooseColumnsFromCategoriesCommandHandler
(ColumnHideShowLayer columnHideShowLayer, ColumnHeaderLayer columnHeaderLayer, DataLayer columnHeaderDataLayer, ColumnCategoriesModel model) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getDestinationPositions
(SelectionLayer.MoveDirectionEnum direction, List<List<Integer>> selectedPositions) Calculates the destination positions taking into account the move direction and single/contiguous selection.void
itemsMoved
(SelectionLayer.MoveDirectionEnum direction, List<Integer> selectedPositions) Moves the columns up or down by firing commands on the dialog.void
itemsRemoved
(List<Integer> removedColumnPositions) void
itemsSelected
(List<Integer> addedColumnIndexes) Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
Constructor Details
-
ChooseColumnsFromCategoriesCommandHandler
public ChooseColumnsFromCategoriesCommandHandler(ColumnHideShowLayer columnHideShowLayer, ColumnHeaderLayer columnHeaderLayer, DataLayer columnHeaderDataLayer, ColumnCategoriesModel model)
-
-
Method Details
-
doCommand
- Specified by:
doCommand
in classAbstractLayerCommandHandler<ChooseColumnsFromCategoriesCommand>
-
getCommandClass
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<ChooseColumnsFromCategoriesCommand>
-
itemsRemoved
- Specified by:
itemsRemoved
in interfaceIColumnCategoriesDialogListener
-
itemsSelected
- Specified by:
itemsSelected
in interfaceIColumnCategoriesDialogListener
-
itemsMoved
Moves the columns up or down by firing commands on the dialog. Individual columns are moved using theColumnReorderCommand
Contiguously selected columns are moved using theMultiColumnReorderCommand
- Specified by:
itemsMoved
in interfaceIColumnCategoriesDialogListener
- Parameters:
direction
- the direction to moveselectedPositions
- the column positions to move
-
getDestinationPositions
protected List<Integer> getDestinationPositions(SelectionLayer.MoveDirectionEnum direction, List<List<Integer>> selectedPositions) Calculates the destination positions taking into account the move direction and single/contiguous selection.- Parameters:
direction
- the direction to moveselectedPositions
- grouped together if they are contiguous.Example: if 2,3,4, 9, 12 are selected, they are grouped as [[2, 3, 4], 9, 12]
- While moving up the destination position for [2, 3, 4] is 1
- While moving up the destination position for [2, 3, 4] is 6
- Returns:
- a List of destination positions
-