Class TreeTableView.TreeTableViewFocusModel<S>

    • Constructor Detail

      • TreeTableViewFocusModel

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

      • getItemCount

        protected int getItemCount()
        Returns the number of items in the data model that underpins the control. An example would be that a ListView focus model would likely return listView.getItems().size(). The valid range of focusable indices is between 0 and whatever is returned by this method.
        Specified by:
        getItemCount in class FocusModel<TreeItem<S>>
        Returns:
        the number of items in the data model that underpins the control
      • getModelItem

        protected TreeItem<S> getModelItem​(int index)
        Returns the item at the given index. An example using ListView would be listView.getItems().get(index).
        Specified by:
        getModelItem in class FocusModel<TreeItem<S>>
        Parameters:
        index - The index of the item that is requested from the underlying data model.
        Returns:
        Returns null if the index is out of bounds, or an element of type T that is related to the given index.
      • getFocusedCell

        public final TreeTablePosition<S,​?> 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,
                          TreeTableColumn<S,​?> column)
        Causes the item at the given index to receive the focus.
        Specified by:
        focus in class TableFocusModel<TreeItem<S>,​TreeTableColumn<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​(TreeTablePosition<S,​?> 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,
                                 TreeTableColumn<S,​?> column)
        Tests whether the row / cell at the given location currently has the focus within the TableView.
        Specified by:
        isFocused in class TableFocusModel<TreeItem<S>,​TreeTableColumn<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<TreeItem<S>>
        Parameters:
        index - The index of the item to get focus.
      • focusPrevious

        public void focusPrevious()
        Attempts to give focus to the row previous to the currently focused row. If the current focus owner is the first row, or is -1 (representing that there is no current focus owner), calling this method will have no result.
        Overrides:
        focusPrevious in class FocusModel<TreeItem<S>>
      • focusNext

        public void focusNext()
        Attempts to give focus to the row after to the currently focused row. If the current focus owner is the last row, calling this method will have no result.
        Overrides:
        focusNext in class FocusModel<TreeItem<S>>