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
Constructors Constructor Description ChooseColumnsFromCategoriesCommandHandler(ColumnHideShowLayer columnHideShowLayer, ColumnHeaderLayer columnHeaderLayer, DataLayer columnHeaderDataLayer, ColumnCategoriesModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doCommand(ChooseColumnsFromCategoriesCommand command)
Class<ChooseColumnsFromCategoriesCommand>
getCommandClass()
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.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 Detail
-
ChooseColumnsFromCategoriesCommandHandler
public ChooseColumnsFromCategoriesCommandHandler(ColumnHideShowLayer columnHideShowLayer, ColumnHeaderLayer columnHeaderLayer, DataLayer columnHeaderDataLayer, ColumnCategoriesModel model)
-
-
Method Detail
-
doCommand
protected boolean doCommand(ChooseColumnsFromCategoriesCommand command)
- Specified by:
doCommand
in classAbstractLayerCommandHandler<ChooseColumnsFromCategoriesCommand>
-
getCommandClass
public Class<ChooseColumnsFromCategoriesCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<ChooseColumnsFromCategoriesCommand>
-
itemsRemoved
public void itemsRemoved(List<Integer> removedColumnPositions)
- Specified by:
itemsRemoved
in interfaceIColumnCategoriesDialogListener
-
itemsSelected
public void itemsSelected(List<Integer> addedColumnIndexes)
- Specified by:
itemsSelected
in interfaceIColumnCategoriesDialogListener
-
itemsMoved
public void itemsMoved(SelectionLayer.MoveDirectionEnum direction, List<Integer> selectedPositions)
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
-
-