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
Defines a list/table model that can be reordered.
- Since:
- 15226
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanMove(int delta) Checks that the currently selected range of rows can be moved by a number of positions.default booleanChecks 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 booleanChecks 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.intReturns the number of rows in the list/table.default int[]Returns an array of all of the selected indices in the selection model, in increasing order.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 IntStreamReturns 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 Details
-
getSelectionModel
Returns the selection model.- Returns:
- the selection model (never null)
- See Also:
-
getRowCount
int getRowCount()Returns the number of rows in the list/table.- Returns:
- the number of rows in the list/table
- See Also:
-
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
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
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
Checks that the currently selected range of rows can be moved up.- Returns:
trueif rows can be moved up
-
canMoveUp
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
Checks that the currently selected range of rows can be moved down.- Returns:
trueif rows can be moved down
-
canMoveDown
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
Move up selected rows, if possible.- Returns:
trueif the move was performed- See Also:
-
moveUp
Move up selected rows, if possible.- Parameters:
selectedRows- rows to move up- Returns:
trueif the move was performed- See Also:
-
moveDown
Move down selected rows, if possible.- Returns:
trueif the move was performed- See Also:
-
moveDown
Move down selected rows by 1 position, if possible.- Parameters:
selectedRows- rows to move down- Returns:
trueif the move was performed- See Also:
-
move
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:
-