Class TableView.TableViewFocusModel<S>

    • Constructor Detail

      • TableViewFocusModel

        public TableViewFocusModel​(TableView<S> tableView)
        Creates a default TableViewFocusModel instance that will be used to manage focus of the provided TableView control.
        Parameters:
        tableView - The tableView upon which this focus model operates.
        Throws:
        NullPointerException - The TableView argument can not be null.
    • Method Detail

      • getFocusedCell

        public final TablePosition getFocusedCell()
        Gets the value of the property focusedCell.
        Property description:
        The position of the current item in the TableView which has the focus.
      • focus

        public void focus​(int row,
                          TableColumn<S,?> column)
        Causes the item at the given index to receive the focus.
        Specified by:
        focus in class TableFocusModel<S,TableColumn<S,?>>
        Parameters:
        row - The row index of the item to give focus to.
        column - The column of the item to give focus to. Can be null.
      • focus

        public void focus​(TablePosition pos)
        Convenience method for setting focus on a particular row or cell using a TablePosition.
        Parameters:
        pos - The table position where focus should be set.
      • isFocused

        public boolean isFocused​(int row,
                                 TableColumn<S,?> column)
        Tests whether the row / cell at the given location currently has the focus within the TableView.
        Specified by:
        isFocused in class TableFocusModel<S,TableColumn<S,?>>
        Parameters:
        row - the row
        column - the column
        Returns:
        true if the row / cell at the given location currently has the focus within the UI control
      • focus

        public void focus​(int index)
        Causes the item at the given index to receive the focus. This does not cause the current selection to change. Updates the focusedItem and focusedIndex properties such that focusedIndex = -1 unless
        0 <= index < model size
        .
        Overrides:
        focus in class FocusModel<S>
        Parameters:
        index - The index of the item to get focus.