Class ColumnReorderEvent
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.event.ColumnVisualChangeEvent
org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralChangeEvent
org.eclipse.nebula.widgets.nattable.reorder.event.ColumnReorderEvent
- All Implemented Interfaces:
ILayerEvent
,IStructuralChangeEvent
,IVisualChangeEvent
Event indicating that one or multiple columns are moved to a new position.
-
Constructor Summary
ConstructorDescriptionColumnReorderEvent
(ILayer layer, int[] beforeFromColumnPositions, int[] beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) ColumnReorderEvent
(ILayer layer, int beforeFromColumnPosition, int beforeFromColumnIndex, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) ColumnReorderEvent
(ILayer layer, List<Integer> beforeFromColumnPositions, List<Integer> beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) Constructor for internal use to clone this event. -
Method Summary
Modifier and TypeMethodDescriptionboolean
convertToLocal
(ILayer targetLayer) Convert the column/row positions carried by the event to the layer about to handle the event.int[]
int
int
boolean
void
setBeforeToColumnIndex
(int beforeIndex) Setter for the beforeToColumnIndex that needs to be called used in case a reorder operation was performed to a hidden column.void
setConvertedBeforePositions
(ILayer layer, Collection<Range> fromColumnPositionRanges, int toColumnPosition) This method is intended to be used for position conversion of the before positions.Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralChangeEvent
getChangedPositionRectangles, getRowDiffs, isHorizontalStructureChanged, isVerticalStructureChanged
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.event.ColumnVisualChangeEvent
getColumnIndexes, getColumnPositionRanges, getLayer, setColumnPositionRanges, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.event.IVisualChangeEvent
getLayer
-
Constructor Details
-
ColumnReorderEvent
public ColumnReorderEvent(ILayer layer, int beforeFromColumnPosition, int beforeFromColumnIndex, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) - Parameters:
layer
- The layer to which the column positions match.beforeFromColumnPosition
- The column position that was reordered, before the reorder operation was performed.beforeFromColumnIndex
- The index of the reordered position.beforeToColumnPosition
- The position of the column to which the reorder operation was performed, before the reorder operation was performedbeforeToColumnIndex
- The index of the column to which the reorder operation was performed.reorderToLeftEdge
- whether the reorder operation was performed to the left or the right edge.- Since:
- 1.6
-
ColumnReorderEvent
public ColumnReorderEvent(ILayer layer, List<Integer> beforeFromColumnPositions, List<Integer> beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) - Parameters:
layer
- The layer to which the column positions match.beforeFromColumnPositions
- The column positions that were reordered, before the reorder operation was performed.beforeFromColumnIndexes
- The indexes of the reordered positions.beforeToColumnPosition
- The position of the column to which the reorder operation was performed, before the reorder operation was performedbeforeToColumnIndex
- The index of the column to which the reorder operation was performed.reorderToLeftEdge
- whether the reorder operation was performed to the left or the right edge.- Since:
- 1.6
-
ColumnReorderEvent
public ColumnReorderEvent(ILayer layer, int[] beforeFromColumnPositions, int[] beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge) - Parameters:
layer
- The layer to which the column positions match.beforeFromColumnPositions
- The column positions that were reordered, before the reorder operation was performed.beforeFromColumnIndexes
- The indexes of the reordered positions.beforeToColumnPosition
- The position of the column to which the reorder operation was performed, before the reorder operation was performedbeforeToColumnIndex
- The index of the column to which the reorder operation was performed.reorderToLeftEdge
- whether the reorder operation was performed to the left or the right edge.- Since:
- 2.0
-
ColumnReorderEvent
Constructor for internal use to clone this event.- Parameters:
event
- The event out of which the new one should be created
-
-
Method Details
-
getBeforeFromColumnIndexes
- Returns:
- The indexes of the reordered columns.
- Since:
- 1.6
-
getBeforeFromColumnIndexesArray
public int[] getBeforeFromColumnIndexesArray()- Returns:
- The indexes of the reordered columns.
- Since:
- 2.0
-
getBeforeFromColumnPositionRanges
- Returns:
- The position ranges of the reordered columns.
-
getBeforeToColumnPosition
public int getBeforeToColumnPosition()- Returns:
- The position of the column to which the reorder operation was performed.
-
getBeforeToColumnIndex
public int getBeforeToColumnIndex()- Returns:
- The index of the column to which the reorder operation was performed.
- Since:
- 1.6
-
setBeforeToColumnIndex
public void setBeforeToColumnIndex(int beforeIndex) Setter for the beforeToColumnIndex that needs to be called used in case a reorder operation was performed to a hidden column.- Parameters:
beforeIndex
- The index of the column to which the reorder operation was performed.- Since:
- 1.6
-
isReorderToLeftEdge
public boolean isReorderToLeftEdge()- Returns:
true
if the columns were reordered to the left edge of the toColumnPosition,false
if the reorder operation was performed on the right edge (e.g. at the end of a table)
-
getColumnDiffs
-
setConvertedBeforePositions
public void setConvertedBeforePositions(ILayer layer, Collection<Range> fromColumnPositionRanges, int toColumnPosition) This method is intended to be used for position conversion of the before positions. The locally stored before positions are the positions of the reordered columns positions before the reorder is applied. Needed in case the conversion needs to be done before other states in the given layer are updated, and therefore the local before position cannot be determined anymore.- Parameters:
layer
- The layer that performed the conversion of the before positions.fromColumnPositionRanges
- The converted column position ranges that were reordered before the reorder happened.toColumnPosition
- The converted column position to which a reorder happened before the reordering was performed.- Since:
- 1.6
-
convertToLocal
Description copied from interface:ILayerEvent
Convert the column/row positions carried by the event to the layer about to handle the event.- Specified by:
convertToLocal
in interfaceILayerEvent
- Overrides:
convertToLocal
in classColumnVisualChangeEvent
- Parameters:
targetLayer
- layer about to receive the event- Returns:
- TRUE if successfully converted, FALSE otherwise
-
cloneEvent
- Returns:
- A cloned copy of the event. This cloned copy is provided to each listener.
-