Package org.openstreetmap.josm.data
Interface ReorderableModel<T>
-
- Type Parameters:
T
- item type
- All Known Subinterfaces:
ReorderableTableModel<T>
,SortableModel<T>
,SortableTableModel<T>
- All Known Implementing Classes:
FilterModel
,FilterTableModel
,LayerListDialog.LayerListModel
,MemberTableModel
,SourceEditor.ActiveSourcesModel
,ToolbarPreferences.Settings.ActionDefinitionModel
public interface ReorderableModel<T>
Defines a 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, java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved by a given number of positions.default boolean
canMoveDown(java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved down (by 1 position).default boolean
canMoveUp(java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved up (by 1 position).default boolean
doMove(int delta, int... selectedRows)
Performs the move operation, without any check nor selection handling.T
getValue(int index)
Get object value at given index.T
setValue(int index, T value)
Set object value at given index.
-
-
-
Method Detail
-
getValue
T getValue(int index)
Get object value at given index.- Parameters:
index
- index- Returns:
- object value at given index
-
setValue
T setValue(int index, T value)
Set object value at given index.- Parameters:
index
- indexvalue
- new value- Returns:
- the value previously at the specified position
-
canMove
default boolean canMove(int delta, java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved by a given number of positions.- Parameters:
delta
- negative or positive deltarowCount
- row count supplierrows
- indexes of rows to move- Returns:
true
if rows can be moved
-
canMoveUp
default boolean canMoveUp(java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved up (by 1 position).- Parameters:
rowCount
- row count supplierrows
- indexes of rows to move up- Returns:
true
if rows can be moved up
-
canMoveDown
default boolean canMoveDown(java.util.function.IntSupplier rowCount, int... rows)
Checks that a range of rows can be moved down (by 1 position).- Parameters:
rowCount
- row count supplierrows
- indexes of rows to move down- Returns:
true
if rows can be moved down
-
doMove
default boolean doMove(int delta, int... selectedRows)
Performs the move operation, without any check nor selection handling.- Parameters:
delta
- negative or positive deltaselectedRows
- rows to move- Returns:
true
if rows have been moved
-
-