Class ColumnGroupUtils
java.lang.Object
org.eclipse.nebula.widgets.nattable.group.ColumnGroupUtils
-
Method Summary
Modifier and TypeMethodDescriptiongetMoveDirection(int fromColumnPosition, int toColumnPosition) Calculates the move direction based on the from and to position.getVisibleIndexesToTheRight(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) Deprecated.getVisibleIndexesToTheRight(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisBetweenTwoGroups(ColumnGroupHeaderLayer columnGroupHeaderLayer, int toPosition, boolean reorderToLeftEdge, SelectionLayer.MoveDirectionEnum moveDirection) Checks if the edge of a column position is the left-most or the right most column on any level of a column group.static booleanisBetweenTwoGroups(ColumnGroupHeaderLayer columnGroupHeaderLayer, int level, int toPosition, boolean reorderToLeftEdge, SelectionLayer.MoveDirectionEnum moveDirection) Checks if the edge of a column position for a specific grouping level is the left-most or the right most column of a column group.static booleanisBetweenTwoGroups(ILayer natLayer, int startX, int endX, ColumnGroupModel model) static booleanisBetweenTwoGroups(ILayer natLayer, int startX, int endX, ColumnGroupHeaderLayer layer, int level) Checks if the column positions at the given x coordinates belong to the same group or not.static booleanisColumnIndexHiddenInUnderLyingLayer(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer) Deprecated.static booleanisColumnIndexHiddenInUnderLyingLayer(int columnIndex, IUniqueIndexLayer underlyingLayer) static booleanisColumnPositionHiddenInUnderLyingLayer(int columnPosition, ILayer layer, IUniqueIndexLayer underlyingLayer) Deprecated.static booleanisColumnPositionHiddenInUnderLyingLayer(int columnPosition, IUniqueIndexLayer underlyingLayer) static booleanisFirstVisibleColumnIndexInGroup(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisFirstVisibleColumnIndexInGroup(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisGroupReordered(GroupModel.Group fromGroup, int[] fromColumnPositions) Check if a complete group is reordered.static booleanisInTheSameGroup(int fromColumnIndex, int toColumnIndex, ColumnGroupModel model) static booleanisInTheSameGroup(ColumnGroupHeaderLayer layer, int level, int fromPosition, int toPosition) Checks if the two given column positions on the given layer belong to the same group at the given level on the givenColumnGroupHeaderLayer.static booleanisLastVisibleColumnIndexInGroup(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisLastVisibleColumnIndexInGroup(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisLeftEdgeOfAColumnGroup(ILayer natLayer, int columnPosition, int columnIndex, ColumnGroupModel model) See ColumnGroupUtilsTeststatic booleanisReorderValid(ColumnGroupHeaderLayer columnGroupHeaderLayer, int fromPosition, int toPosition, boolean reorderToLeftEdge) Checks if a reorder operation is valid by checking the unbreakable states of the groups below the from and the to position.static booleanisReorderValid(ColumnGroupHeaderLayer columnGroupHeaderLayer, int level, int fromPosition, int toPosition, boolean reorderToLeftEdge) Checks if a reorder operation is valid by checking the unbreakable states of the groups below the from and the to position.static booleanisRightEdgeOfAColumnGroup(ILayer natLayer, int columnPosition, int columnIndex, ColumnGroupModel model) See ColumnGroupUtilsTeststatic booleanisStaticOrFirstVisibleColumn(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) static booleanisStaticOrFirstVisibleColumn(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) Checks whethercolumnIndexis either a defined static column or (if not) the first visible column in the group containing group.
-
Method Details
-
getMoveDirection
public static SelectionLayer.MoveDirectionEnum getMoveDirection(int fromColumnPosition, int toColumnPosition) Calculates the move direction based on the from and to position.- Parameters:
fromColumnPosition- The column position from which a move is triggered.toColumnPosition- The column position to which a move is triggered.- Returns:
- The direction of the triggered move operation.
-
isInTheSameGroup
public static boolean isInTheSameGroup(int fromColumnIndex, int toColumnIndex, ColumnGroupModel model) -
isStaticOrFirstVisibleColumn
@Deprecated public static boolean isStaticOrFirstVisibleColumn(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) Checks whethercolumnIndexis either a defined static column or (if not) the first visible column in the group containing group. This method provides downward compatibility for all group definitions without static columns. When no static columns are defined the first visible column will be used.- Parameters:
columnIndex- The column index to check.layer- unusedunderlyingLayer- The underlying layer.model- The column group model.- Returns:
TRUEif the givencolumnIndexis either a defined static column or (if not) the first visible column the it's group
-
isStaticOrFirstVisibleColumn
public static boolean isStaticOrFirstVisibleColumn(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) Checks whethercolumnIndexis either a defined static column or (if not) the first visible column in the group containing group. This method provides downward compatibility for all group definitions without static columns. When no static columns are defined the first visible column will be used.- Parameters:
columnIndex- The column index to check.underlyingLayer- The underlying layer.model- The column group model.- Returns:
TRUEif the givencolumnIndexis either a defined static column or (if not) the first visible column the it's group- Since:
- 2.0
-
isFirstVisibleColumnIndexInGroup
@Deprecated public static boolean isFirstVisibleColumnIndexInGroup(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The column index to check.layer- unusedunderlyingLayer- The underlying layer.model- The column group model.- Returns:
trueif the given column index is the first column in a column group.
-
isFirstVisibleColumnIndexInGroup
public static boolean isFirstVisibleColumnIndexInGroup(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The column index to check.underlyingLayer- The underlying layer.model- The column group model.- Returns:
trueif the given column index is the first column in a column group.- Since:
- 2.0
-
isLastVisibleColumnIndexInGroup
@Deprecated public static boolean isLastVisibleColumnIndexInGroup(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The column index to check.layer- unusedunderlyingLayer- The underlying layer.model- The column group model.- Returns:
trueif the given column index is the last column in a column group.
-
isLastVisibleColumnIndexInGroup
public static boolean isLastVisibleColumnIndexInGroup(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The column index to check.underlyingLayer- The underlying layer.model- The column group model.- Returns:
trueif the given column index is the last column in a column group.- Since:
- 2.0
-
getVisibleIndexesToTheRight
@Deprecated public static List<Integer> getVisibleIndexesToTheRight(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The index to check.layer- unusedunderlyingLayer- The underlying layer to retrieve the visible columns to the right.model- TheColumnGroupModelto get the group from.- Returns:
- The column indexes to the right of the given column index (inclusive)
-
getVisibleIndexesToTheRight
public static List<Integer> getVisibleIndexesToTheRight(int columnIndex, IUniqueIndexLayer underlyingLayer, ColumnGroupModel model) - Parameters:
columnIndex- The index to check.underlyingLayer- The underlying layer to retrieve the visible columns to the right.model- TheColumnGroupModelto get the group from.- Returns:
- The column indexes to the right of the given column index (inclusive)
- Since:
- 2.0
-
isColumnIndexHiddenInUnderLyingLayer
@Deprecated public static boolean isColumnIndexHiddenInUnderLyingLayer(int columnIndex, ILayer layer, IUniqueIndexLayer underlyingLayer) Deprecated.- Parameters:
columnIndex- The column index to check.layer- unusedunderlyingLayer- The underlying layer to check against.- Returns:
trueif the column is hidden in the underlying layer,falseif not.
-
isColumnIndexHiddenInUnderLyingLayer
public static boolean isColumnIndexHiddenInUnderLyingLayer(int columnIndex, IUniqueIndexLayer underlyingLayer) - Parameters:
columnIndex- The column index to check.underlyingLayer- The underlying layer to check against.- Returns:
trueif the column is hidden in the underlying layer,falseif not.- Since:
- 2.0
-
isColumnPositionHiddenInUnderLyingLayer
@Deprecated public static boolean isColumnPositionHiddenInUnderLyingLayer(int columnPosition, ILayer layer, IUniqueIndexLayer underlyingLayer) Deprecated.- Parameters:
columnPosition- The column position matching the underlying layer.layer- unusedunderlyingLayer- The underlying layer to check against.- Returns:
trueif the column position is hidden in the underlying layer,falseif not.
-
isColumnPositionHiddenInUnderLyingLayer
public static boolean isColumnPositionHiddenInUnderLyingLayer(int columnPosition, IUniqueIndexLayer underlyingLayer) - Parameters:
columnPosition- The column position matching the underlying layer.underlyingLayer- The underlying layer to check against.- Returns:
trueif the column position is hidden in the underlying layer,falseif not.- Since:
- 2.0
-
isRightEdgeOfAColumnGroup
public static boolean isRightEdgeOfAColumnGroup(ILayer natLayer, int columnPosition, int columnIndex, ColumnGroupModel model) See ColumnGroupUtilsTest- Returns:
- TRUE if the given column is the right most column in a group
-
isLeftEdgeOfAColumnGroup
public static boolean isLeftEdgeOfAColumnGroup(ILayer natLayer, int columnPosition, int columnIndex, ColumnGroupModel model) See ColumnGroupUtilsTest- Returns:
- TRUE if the given column is the left most column in a group
-
isBetweenTwoGroups
public static boolean isBetweenTwoGroups(ILayer natLayer, int startX, int endX, ColumnGroupModel model) - Returns:
- TRUE if there is a column group boundary between startX and endX
-
isInTheSameGroup
public static boolean isInTheSameGroup(ColumnGroupHeaderLayer layer, int level, int fromPosition, int toPosition) Checks if the two given column positions on the given layer belong to the same group at the given level on the givenColumnGroupHeaderLayer.- Parameters:
layer- TheColumnGroupHeaderLayerwhich is needed to perform the check against.level- The grouping level to check.fromPosition- The column position to check based on the position layer of the givenColumnGroupHeaderLayer.toPosition- The column position to check based on the position layer of the givenColumnGroupHeaderLayer.- Returns:
trueif both given positions belong to the same group,falseif not.- Since:
- 1.6
-
isBetweenTwoGroups
public static boolean isBetweenTwoGroups(ILayer natLayer, int startX, int endX, ColumnGroupHeaderLayer layer, int level) Checks if the column positions at the given x coordinates belong to the same group or not.- Parameters:
natLayer- The layer to which the given positions match. Typically the NatTable itself.startX- The x coordinate of the column that should be checked. Typically the drag start x coordinate.endX- The x coordinate of the column that should be checked. Typically the drag end x coordinate.layer- TheColumnGroupHeaderLayerwhich is needed to perform the check against.level- The grouping level to check.- Returns:
trueif there is a column group boundary between startX and endX,falseif both positions are in the same group.- Since:
- 1.6
-
isBetweenTwoGroups
public static boolean isBetweenTwoGroups(ColumnGroupHeaderLayer columnGroupHeaderLayer, int toPosition, boolean reorderToLeftEdge, SelectionLayer.MoveDirectionEnum moveDirection) Checks if the edge of a column position is the left-most or the right most column on any level of a column group.- Parameters:
columnGroupHeaderLayer- TheColumnGroupHeaderLayerto handle the checks.toPosition- The position to check. Needs to be related to the positionLayer.reorderToLeftEdge-trueif the check should be performed to the left edge or the right edge of the toPosition.moveDirection- The direction in which the reordering is performed.- Returns:
trueif the destination would be between two groups,falseif the destination would be inside a group.- Since:
- 1.6
-
isBetweenTwoGroups
public static boolean isBetweenTwoGroups(ColumnGroupHeaderLayer columnGroupHeaderLayer, int level, int toPosition, boolean reorderToLeftEdge, SelectionLayer.MoveDirectionEnum moveDirection) Checks if the edge of a column position for a specific grouping level is the left-most or the right most column of a column group.- Parameters:
columnGroupHeaderLayer- TheColumnGroupHeaderLayerto handle the checks.level- The grouping level on which the check should be performed.toPosition- The position to check. Needs to be related to the positionLayer.reorderToLeftEdge-trueif the check should be performed to the left edge or the right edge of the toPosition.moveDirection- The direction in which the reordering is performed.- Returns:
trueif the destination would be between two groups,falseif the destination would be inside a group.- Since:
- 1.6
-
isReorderValid
public static boolean isReorderValid(ColumnGroupHeaderLayer columnGroupHeaderLayer, int fromPosition, int toPosition, boolean reorderToLeftEdge) Checks if a reorder operation is valid by checking the unbreakable states of the groups below the from and the to position.- Parameters:
columnGroupHeaderLayer- TheColumnGroupHeaderLayerto get the groups to check.fromPosition- The position from which a column should be reordered.toPosition- The position to which a column should be reordered.reorderToLeftEdge-trueif the reorder should be performed to the left edge of the toPosition.- Returns:
trueif the reorder operation would be valid,falseif the either the source or the target belongs to an unbreakable group.- Since:
- 1.6
-
isReorderValid
public static boolean isReorderValid(ColumnGroupHeaderLayer columnGroupHeaderLayer, int level, int fromPosition, int toPosition, boolean reorderToLeftEdge) Checks if a reorder operation is valid by checking the unbreakable states of the groups below the from and the to position.- Parameters:
columnGroupHeaderLayer- TheColumnGroupHeaderLayerto get the groups to check.level- The grouping level that should be checked.fromPosition- The position from which a column should be reordered.toPosition- The position to which a column should be reordered.reorderToLeftEdge-trueif the reorder should be performed to the left edge of the toPosition.- Returns:
trueif the reorder operation would be valid,falseif the either the source or the target belongs to an unbreakable group.- Since:
- 1.6
-
isGroupReordered
Check if a complete group is reordered.- Parameters:
fromGroup- The group to check.fromColumnPositions- The column positions to check.- Returns:
trueif the fromColumnPositions are all part of the given group.- Since:
- 1.6
-
getVisibleIndexesToTheRight(int, IUniqueIndexLayer, ColumnGroupModel)