Class TreeView.Builder<B extends TreeView.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, Scrollable.Builder<B>, BuilderInterface
Enclosing class:
TreeView

public static class TreeView.Builder<B extends TreeView.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Scrollable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public TreeView build()
      Finish building the TreeView object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to TreeView.
      Overrides:
      build in class Widget.Builder<B extends TreeView.Builder<B>>
      Returns:
      a new instance of TreeView with the properties that were set in the Builder object.
    • setActivateOnSingleClick

      public B setActivateOnSingleClick(boolean activateOnSingleClick)
      The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.
      Parameters:
      activateOnSingleClick - the value for the activate-on-single-click property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEnableGridLines

      public B setEnableGridLines(TreeViewGridLines enableGridLines)
    • setEnableSearch

      public B setEnableSearch(boolean enableSearch)
    • setEnableTreeLines

      public B setEnableTreeLines(boolean enableTreeLines)
    • setExpanderColumn

      public B setExpanderColumn(TreeViewColumn expanderColumn)
    • setFixedHeightMode

      public B setFixedHeightMode(boolean fixedHeightMode)
      Setting the ::fixed-height-mode property to true speeds up GtkTreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
      Parameters:
      fixedHeightMode - the value for the fixed-height-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHeadersClickable

      public B setHeadersClickable(boolean headersClickable)
    • setHeadersVisible

      public B setHeadersVisible(boolean headersVisible)
    • setHoverExpand

      public B setHoverExpand(boolean hoverExpand)

      Enables or disables the hover expansion mode of treeView. Hover expansion makes rows expand or collapse if the pointer moves over them.

      This mode is primarily intended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.

      Parameters:
      hoverExpand - the value for the hover-expand property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHoverSelection

      public B setHoverSelection(boolean hoverSelection)

      Enables or disables the hover selection mode of treeView. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes SelectionMode.SINGLE and SelectionMode.BROWSE.

      This mode is primarily intended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.

      Parameters:
      hoverSelection - the value for the hover-selection property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLevelIndentation

      public B setLevelIndentation(int levelIndentation)
      Extra indentation for each level.
      Parameters:
      levelIndentation - the value for the level-indentation property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setModel

      public B setModel(TreeModel model)
    • setReorderable

      public B setReorderable(boolean reorderable)
    • setRubberBanding

      public B setRubberBanding(boolean rubberBanding)
    • setSearchColumn

      public B setSearchColumn(int searchColumn)
    • setShowExpanders

      public B setShowExpanders(boolean showExpanders)
      true if the view has expanders.
      Parameters:
      showExpanders - the value for the show-expanders property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTooltipColumn

      public B setTooltipColumn(int tooltipColumn)
    • onColumnsChanged

      public B onColumnsChanged(TreeView.ColumnsChangedCallback handler)
      The number of columns of the treeview has changed.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onCursorChanged

      public B onCursorChanged(TreeView.CursorChangedCallback handler)
      The position of the cursor (focused cell) has changed.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onExpandCollapseCursorRow

      public B onExpandCollapseCursorRow(TreeView.ExpandCollapseCursorRowCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onMoveCursor

      public B onMoveCursor(TreeView.MoveCursorCallback handler)

      The GtkTreeView::move-cursor signal is a Gtk.SignalAction which gets emitted when the user presses one of the cursor keys.

      Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically. In contrast to gtk_tree_view_set_cursor() and gtk_tree_view_set_cursor_on_cell() when moving horizontally GtkTreeView::move-cursor does not reset the current selection.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRowActivated

      public B onRowActivated(TreeView.RowActivatedCallback handler)

      The "row-activated" signal is emitted when the method TreeView.rowActivated(TreePath, TreeViewColumn) is called.

      This signal is emitted when the user double-clicks a treeview row with the Gtk.TreeView:activate-on-single-click property set to false, or when the user single-clicks a row when that property set to true.

      This signal is also emitted when a non-editable row is selected and one of the keys: Space, Shift+Space, Return or Enter is pressed.

      For selection handling refer to the tree widget conceptual overview as well as GtkTreeSelection.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRowCollapsed

      public B onRowCollapsed(TreeView.RowCollapsedCallback handler)
      The given row has been collapsed (child nodes are hidden).
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRowExpanded

      public B onRowExpanded(TreeView.RowExpandedCallback handler)
      The given row has been expanded (child nodes are shown).
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSelectAll

      public B onSelectAll(TreeView.SelectAllCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSelectCursorParent

      public B onSelectCursorParent(TreeView.SelectCursorParentCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSelectCursorRow

      public B onSelectCursorRow(TreeView.SelectCursorRowCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onStartInteractiveSearch

      public B onStartInteractiveSearch(TreeView.StartInteractiveSearchCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onTestCollapseRow

      public B onTestCollapseRow(TreeView.TestCollapseRowCallback handler)
      The given row is about to be collapsed (hide its children nodes). Use this signal if you need to control the collapsibility of individual rows.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onTestExpandRow

      public B onTestExpandRow(TreeView.TestExpandRowCallback handler)
      The given row is about to be expanded (show its children nodes). Use this signal if you need to control the expandability of individual rows.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onToggleCursorRow

      public B onToggleCursorRow(TreeView.ToggleCursorRowCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onUnselectAll

      public B onUnselectAll(TreeView.UnselectAllCallback handler)
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: