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

    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
    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
    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
    Returns 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 boolean
    move(int delta, int... selectedRows)
    Move selected rows by any number of positions, if possible.
    default boolean
    Move down selected rows, if possible.
    default boolean
    moveDown(int... selectedRows)
    Move down selected rows by 1 position, if possible.
    default boolean
    Move up selected rows, if possible.
    default boolean
    moveUp(int... selectedRows)
    Move up selected rows, if possible.
    default IntStream
    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 Details

    • getSelectionModel

      Returns the selection model.
      Returns:
      the selection model (never null)
      See Also:
    • getRowCount

      Returns the number of rows in the list/table.
      Returns:
      the number of rows in the list/table
      See Also:
    • 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

      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:
    • 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:
    • moveDown

      default boolean moveDown()
      Move down selected rows, if possible.
      Returns:
      true if the move was performed
      See Also:
    • 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:
    • move

      default boolean move(int delta, int... selectedRows)
      Move selected rows by any number of positions, if possible.
      Parameters:
      delta - negative or positive delta
      selectedRows - rows to move
      Returns:
      true if the move was performed
      See Also: