Interface ReorderableModel<T>

    • 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 - index
        value - 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 delta
        rowCount - row count supplier
        rows - 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 supplier
        rows - 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 supplier
        rows - 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 delta
        selectedRows - rows to move
        Returns:
        true if rows have been moved