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 booleancanMove(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 booleancanMoveDown(java.util.function.IntSupplier rowCount, int... rows)Checks that a range of rows can be moved down (by 1 position).default booleancanMoveUp(java.util.function.IntSupplier rowCount, int... rows)Checks that a range of rows can be moved up (by 1 position).default booleandoMove(int delta, int... selectedRows)Performs the move operation, without any check nor selection handling.TgetValue(int index)Get object value at given index.TsetValue(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:
trueif 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:
trueif 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:
trueif 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:
trueif rows have been moved
-
-