Package org.openstreetmap.josm.gui.util
Interface ReorderableTableModel<T>
-
- Type Parameters:
T
- item type
- All Superinterfaces:
ReorderableModel<T>
- All Known Subinterfaces:
SortableTableModel<T>
- All Known Implementing Classes:
FilterTableModel
,LayerListDialog.LayerListModel
,MemberTableModel
,SourceEditor.ActiveSourcesModel
,ToolbarPreferences.Settings.ActionDefinitionModel
public interface ReorderableTableModel<T> extends ReorderableModel<T>
Defines a list/table model that can be reordered.- Since:
- 15226
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
canMove(int delta)
Checks that the currently selected range of rows can be moved by a number of positions.default boolean
canMoveDown()
Checks that the currently selected range of rows can be moved down.default boolean
canMoveDown(int... rows)
Checks that a range of rows can be moved down.default boolean
canMoveUp()
Checks that the currently selected range of rows can be moved up.default boolean
canMoveUp(int... rows)
Checks that a range of rows can be moved up.int
getRowCount()
Returns the number of rows in the list/table.default int[]
getSelectedIndices()
Returns an array of all of the selected indices in the selection model, in increasing order.javax.swing.ListSelectionModel
getSelectionModel()
Returns the selection model.default boolean
move(int delta, int... selectedRows)
Move selected rows by any number of positions, if possible.default boolean
moveDown()
Move down selected rows, if possible.default boolean
moveDown(int... selectedRows)
Move down selected rows by 1 position, if possible.default boolean
moveUp()
Move up selected rows, if possible.default boolean
moveUp(int... selectedRows)
Move up selected rows, if possible.default java.util.stream.IntStream
selectedIndices()
Returns a stream of all of the selected indices in the selection model, in increasing order.-
Methods inherited from interface org.openstreetmap.josm.data.ReorderableModel
canMove, canMoveDown, canMoveUp, doMove, getValue, setValue
-
-
-
-
Method Detail
-
getSelectionModel
javax.swing.ListSelectionModel getSelectionModel()
Returns the selection model.- Returns:
- the selection model (never null)
- See Also:
JList.getSelectionModel()
,JTable.getSelectionModel()
-
getRowCount
int getRowCount()
Returns the number of rows in the list/table.- Returns:
- the number of rows in the list/table
- See Also:
ListModel.getSize()
,TableModel.getRowCount()
-
getSelectedIndices
default int[] getSelectedIndices()
Returns an array of all of the selected indices in the selection model, in increasing order.- Returns:
- an array of all of the selected indices in the selection model, in increasing order
- See Also:
selectedIndices()
-
selectedIndices
default java.util.stream.IntStream selectedIndices()
Returns a stream of all of the selected indices in the selection model, in increasing order.- Returns:
- a stream of all of the selected indices in the selection model, in increasing order
- Since:
- 17773
-
canMove
default boolean canMove(int delta)
Checks that the currently selected range of rows can be moved by a number of positions.- Parameters:
delta
- negative or positive delta- Returns:
true
if rows can be moved
-
canMoveUp
default boolean canMoveUp()
Checks that the currently selected range of rows can be moved up.- Returns:
true
if rows can be moved up
-
canMoveUp
default boolean canMoveUp(int... rows)
Checks that a range of rows can be moved up.- Parameters:
rows
- indexes of rows to move up- Returns:
true
if rows can be moved up
-
canMoveDown
default boolean canMoveDown()
Checks that the currently selected range of rows can be moved down.- Returns:
true
if rows can be moved down
-
canMoveDown
default boolean canMoveDown(int... rows)
Checks that a range of rows can be moved down.- Parameters:
rows
- indexes of rows to move down- Returns:
true
if rows can be moved down
-
moveUp
default boolean moveUp()
Move up selected rows, if possible.- Returns:
true
if the move was performed- See Also:
canMoveUp()
-
moveUp
default boolean moveUp(int... selectedRows)
Move up selected rows, if possible.- Parameters:
selectedRows
- rows to move up- Returns:
true
if the move was performed- See Also:
canMoveUp()
-
moveDown
default boolean moveDown()
Move down selected rows, if possible.- Returns:
true
if the move was performed- See Also:
canMoveDown()
-
moveDown
default boolean moveDown(int... selectedRows)
Move down selected rows by 1 position, if possible.- Parameters:
selectedRows
- rows to move down- Returns:
true
if the move was performed- See Also:
canMoveDown()
-
move
default boolean move(int delta, int... selectedRows)
Move selected rows by any number of positions, if possible.- Parameters:
delta
- negative or positive deltaselectedRows
- rows to move- Returns:
true
if the move was performed- See Also:
canMove(int)
-
-