Class RowReorderEvent
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.event.RowVisualChangeEvent
org.eclipse.nebula.widgets.nattable.layer.event.RowStructuralChangeEvent
org.eclipse.nebula.widgets.nattable.reorder.event.RowReorderEvent
- All Implemented Interfaces:
ILayerEvent
,IStructuralChangeEvent
,IVisualChangeEvent
Event indicating that one or multiple rows are moved to a new position.
-
Constructor Summary
ConstructorDescriptionRowReorderEvent
(ILayer layer, int[] beforeFromRowPositions, int[] beforeFromRowIndexes, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) RowReorderEvent
(ILayer layer, int beforeFromRowPosition, int beforeFromRowIndex, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) RowReorderEvent
(ILayer layer, List<Integer> beforeFromRowPositions, List<Integer> beforeFromRowIndexes, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) RowReorderEvent
(RowReorderEvent event) 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
setBeforeToRowIndex
(int beforeIndex) Setter for the beforeToRowIndex that needs to be called used in case a reorder operation was performed to a hidden row.void
setConvertedBeforePositions
(ILayer layer, Collection<Range> fromRowPositionRanges, int toRowPosition) 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.RowStructuralChangeEvent
getChangedPositionRectangles, getColumnDiffs, isHorizontalStructureChanged, isVerticalStructureChanged
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.event.RowVisualChangeEvent
getLayer, getRowIndexes, getRowPositionRanges, setRowPositionRanges, 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
-
RowReorderEvent
public RowReorderEvent(ILayer layer, int beforeFromRowPosition, int beforeFromRowIndex, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) - Parameters:
layer
- The layer to which the row positions match.beforeFromRowPosition
- The row position that was reordered, before the reorder operation was performed.beforeFromRowIndex
- The index of the reordered position.beforeToRowPosition
- The position of the row to which the reorder operation was performed, before the reorder operation was performedbeforeToRowIndex
- The index of the row to which the reorder operation was performed.reorderToTopEdge
- whether the reorder operation was performed to the top or the bottom edge.- Since:
- 1.6
-
RowReorderEvent
public RowReorderEvent(ILayer layer, List<Integer> beforeFromRowPositions, List<Integer> beforeFromRowIndexes, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) - Parameters:
layer
- The layer to which the row positions match.beforeFromRowPositions
- The row positions that were reordered, before the reorder operation was performed.beforeFromRowIndexes
- The indexes of the reordered positions.beforeToRowPosition
- The position of the row to which the reorder operation was performed, before the reorder operation was performedbeforeToRowIndex
- The index of the row to which the reorder operation was performed.reorderToTopEdge
- whether the reorder operation was performed to the top or the bottom edge.- Since:
- 1.6
-
RowReorderEvent
public RowReorderEvent(ILayer layer, int[] beforeFromRowPositions, int[] beforeFromRowIndexes, int beforeToRowPosition, int beforeToRowIndex, boolean reorderToTopEdge) - Parameters:
layer
- The layer to which the row positions match.beforeFromRowPositions
- The row positions that were reordered, before the reorder operation was performed.beforeFromRowIndexes
- The indexes of the reordered positions.beforeToRowPosition
- The position of the row to which the reorder operation was performed, before the reorder operation was performedbeforeToRowIndex
- The index of the row to which the reorder operation was performed.reorderToTopEdge
- whether the reorder operation was performed to the top or the bottom edge.- Since:
- 2.0
-
RowReorderEvent
Constructor for internal use to clone this event.- Parameters:
event
- The event out of which the new one should be created
-
-
Method Details
-
getBeforeFromRowIndexes
- Returns:
- The indexes of the reordered rows.
- Since:
- 1.6
-
getBeforeFromRowIndexesArray
public int[] getBeforeFromRowIndexesArray()- Returns:
- The indexes of the reordered rows.
- Since:
- 2.0
-
getBeforeFromRowPositionRanges
- Returns:
- The position ranges of the reordered rows.
-
getBeforeToRowPosition
public int getBeforeToRowPosition()- Returns:
- The position of the row to which the reorder operation was performed.
-
getBeforeToRowIndex
public int getBeforeToRowIndex()- Returns:
- The index of the row to which the reorder operation was performed.
- Since:
- 1.6
-
setBeforeToRowIndex
public void setBeforeToRowIndex(int beforeIndex) Setter for the beforeToRowIndex that needs to be called used in case a reorder operation was performed to a hidden row.- Parameters:
beforeIndex
- The index of the row to which the reorder operation was performed.- Since:
- 1.6
-
isReorderToTopEdge
public boolean isReorderToTopEdge()- Returns:
true
if the rows were reordered to the top edge of the toRowPosition,false
if the reorder operation was performed on the bottom edge (e.g. at the end of a table)
-
getRowDiffs
-
setConvertedBeforePositions
public void setConvertedBeforePositions(ILayer layer, Collection<Range> fromRowPositionRanges, int toRowPosition) 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 row 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.fromRowPositionRanges
- The converted row position ranges that were reordered before the reorder happened.toRowPosition
- The converted row 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 classRowVisualChangeEvent
- 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.
-