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 booleancanMove(int delta)Checks that the currently selected range of rows can be moved by a number of positions.default booleancanMoveDown()Checks that the currently selected range of rows can be moved down.default booleancanMoveDown(int... rows)Checks that a range of rows can be moved down.default booleancanMoveUp()Checks that the currently selected range of rows can be moved up.default booleancanMoveUp(int... rows)Checks that a range of rows can be moved up.intgetRowCount()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.ListSelectionModelgetSelectionModel()Returns the selection model.default booleanmove(int delta, int... selectedRows)Move selected rows by any number of positions, if possible.default booleanmoveDown()Move down selected rows, if possible.default booleanmoveDown(int... selectedRows)Move down selected rows by 1 position, if possible.default booleanmoveUp()Move up selected rows, if possible.default booleanmoveUp(int... selectedRows)Move up selected rows, if possible.default java.util.stream.IntStreamselectedIndices()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:
trueif rows can be moved
-
canMoveUp
default boolean canMoveUp()
Checks that the currently selected range of rows can be moved up.- Returns:
trueif 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:
trueif rows can be moved up
-
canMoveDown
default boolean canMoveDown()
Checks that the currently selected range of rows can be moved down.- Returns:
trueif 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:
trueif rows can be moved down
-
moveUp
default boolean moveUp()
Move up selected rows, if possible.- Returns:
trueif 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:
trueif the move was performed- See Also:
canMoveUp()
-
moveDown
default boolean moveDown()
Move down selected rows, if possible.- Returns:
trueif 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:
trueif 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:
trueif the move was performed- See Also:
canMove(int)
-
-