Class TablePosition<S,T>

java.lang.Object
javafx.scene.control.TablePositionBase<TableColumn<S,T>>
javafx.scene.control.TablePosition<S,T>
Type Parameters:
S - The type of the items contained within the TableView (i.e. the same generic type as the S in TableView<S>).
T - The type of the items contained within the TableColumn.

public class TablePosition<S,T> extends TablePositionBase<TableColumn<S,T>>
This class is used to represent a single row/column/cell in a TableView. This is used throughout the TableView API to represent which rows/columns/cells are currently selected, focused, being edited, etc. Note that this class is immutable once it is created.

Because the TableView can have different selection modes, the row and column properties in TablePosition can be 'disabled' to represent an entire row or column. This is done by setting the unrequired property to -1 or null.

Since:
JavaFX 2.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TablePosition(TableView<S> tableView, int row, TableColumn<S,T> tableColumn)
    Constructs a TablePosition instance to represent the given row/column position in the given TableView instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The column index that this TablePosition represents in the TableView.
    final TableColumn<S,T>
    The TableColumn that this TablePosition represents in the TableView.
    final TableView<S>
    The TableView that this TablePosition is related to.
    Returns a string representation of this TablePosition object.

    Methods declared in class TablePositionBase

    equals, getRow, hashCode
    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    The row that this TablePosition represents in the TableView.
    int
    Returns a hash code for this TablePosition object.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TablePosition

      public TablePosition(TableView<S> tableView, int row, TableColumn<S,T> tableColumn)
      Constructs a TablePosition instance to represent the given row/column position in the given TableView instance. Both the TableView and TableColumn are referenced weakly in this class, so it is possible that they will be null when their respective getters are called.
      Parameters:
      tableView - The TableView that this position is related to.
      row - The row that this TablePosition is representing.
      tableColumn - The TableColumn instance that this TablePosition represents.
  • Method Details

    • getColumn

      public int getColumn()
      The column index that this TablePosition represents in the TableView. It is -1 if the TableView or TableColumn instances are null at the time the class is instantiated (i.e. it is computed at construction).
      Specified by:
      getColumn in class TablePositionBase<TableColumn<S,T>>
      Returns:
      the column index that this TablePosition represents in the TableView
    • getTableView

      public final TableView<S> getTableView()
      The TableView that this TablePosition is related to.
      Returns:
      the TableView
    • getTableColumn

      public final TableColumn<S,T> getTableColumn()
      The TableColumn that this TablePosition represents in the TableView.
      Overrides:
      getTableColumn in class TablePositionBase<TableColumn<S,T>>
      Returns:
      the TableColumn that this TablePosition represents in the TableView
    • toString

      public String toString()
      Returns a string representation of this TablePosition object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this TablePosition object.