Serializable
public class RowSorterEvent extends EventObject
RowSorterEvent
provides notification of changes to a RowSorter
. Two types of notification are possible: Type.SORT_ORDER_CHANGED
: indicates the sort order has changed. This is typically followed by a notification of: Type.SORTED
: indicates the contents of the model have been transformed in some way. For example, the contents may have been sorted or filtered. Modifier and Type | Class | Description |
---|---|---|
static enum |
RowSorterEvent.Type |
Enumeration of the types of RowSorterEvent s. |
source
Constructor | Description |
---|---|
RowSorterEvent |
Creates a RowSorterEvent of type SORT_ORDER_CHANGED . |
RowSorterEvent |
Creates a RowSorterEvent . |
Modifier and Type | Method | Description |
---|---|---|
int |
convertPreviousRowIndexToModel |
Returns the location of index in terms of the model prior to the sort. |
int |
getPreviousRowCount() |
Returns the number of rows before the sort. |
RowSorter |
getSource() |
Returns the source of the event as a RowSorter . |
RowSorterEvent.Type |
getType() |
Returns the type of event. |
toString
public RowSorterEvent(RowSorter<?> source)
RowSorterEvent
of type SORT_ORDER_CHANGED
.source
- the source of the changeIllegalArgumentException
- if source
is null
public RowSorterEvent(RowSorter<?> source, RowSorterEvent.Type type, int[] previousRowIndexToModel)
RowSorterEvent
.source
- the source of the changetype
- the type of eventpreviousRowIndexToModel
- the mapping from model indices to view indices prior to the sort, may be null
IllegalArgumentException
- if source or type
is null
public RowSorter<?> getSource()
RowSorter
.getSource
in class EventObject
RowSorter
public RowSorterEvent.Type getType()
public int convertPreviousRowIndexToModel(int index)
index
in terms of the model prior to the sort. This method is only useful for events of type SORTED
. This method will return -1 if the index is not valid, or the locations prior to the sort have not been provided.index
- the index in terms of the viewpublic int getPreviousRowCount()
SORTED
and if the last locations have not been provided will return 0.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/event/RowSorterEvent.html