Class TreeView.Builder<B extends TreeView.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
,Scrollable.Builder<B>
- Enclosing class:
TreeView
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theTreeView
object.The number of columns of the treeview has changed.The position of the cursor (focused cell) has changed.onMoveCursor
(TreeView.MoveCursorCallback handler) TheGtkTreeView
::move-cursor signal is a [keybinding signal]SignalAction
which gets emitted when the user presses one of the cursor keys.The "row-activated" signal is emitted when the methodTreeView.rowActivated(org.gnome.gtk.TreePath, org.gnome.gtk.TreeViewColumn)
is called.The given row has been collapsed (child nodes are hidden).The given row has been expanded (child nodes are shown).onSelectAll
(TreeView.SelectAllCallback handler) The given row is about to be collapsed (hide its children nodes).The given row is about to be expanded (show its children nodes).setActivateOnSingleClick
(boolean activateOnSingleClick) The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.setEnableGridLines
(TreeViewGridLines enableGridLines) setEnableSearch
(boolean enableSearch) setEnableTreeLines
(boolean enableTreeLines) setExpanderColumn
(TreeViewColumn expanderColumn) setFixedHeightMode
(boolean fixedHeightMode) Setting the ::fixed-height-mode property totrue
speeds upGtkTreeView
by assuming that all rows have the same height.setHeadersClickable
(boolean headersClickable) setHeadersVisible
(boolean headersVisible) setHoverExpand
(boolean hoverExpand) Enables or disables the hover expansion mode oftreeView
.setHoverSelection
(boolean hoverSelection) Enables or disables the hover selection mode oftreeView
.setLevelIndentation
(int levelIndentation) Extra indentation for each level.setReorderable
(boolean reorderable) setRubberBanding
(boolean rubberBanding) setSearchColumn
(int searchColumn) setShowExpanders
(boolean showExpanders) true
if the view has expanders.setTooltipColumn
(int tooltipColumn) Methods inherited from class org.gnome.gtk.Widget.Builder
onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, setCanFocus, setCanTarget, setCssClasses, setCssName, setCursor, setFocusable, setFocusOnClick, setHalign, setHasTooltip, setHeightRequest, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequest
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRole
Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
Methods inherited from interface org.gnome.gtk.Scrollable.Builder
setHadjustment, setHscrollPolicy, setVadjustment, setVscrollPolicy
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theTreeView
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toTreeView
.- Overrides:
build
in classWidget.Builder<B extends TreeView.Builder<B>>
- Returns:
- a new instance of
TreeView
with the properties that were set in the Builder object.
-
setActivateOnSingleClick
The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.- Parameters:
activateOnSingleClick
- the value for theactivate-on-single-click
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEnableGridLines
-
setEnableSearch
-
setEnableTreeLines
-
setExpanderColumn
-
setFixedHeightMode
Setting the ::fixed-height-mode property totrue
speeds upGtkTreeView
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 thefixed-height-mode
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setHeadersClickable
-
setHeadersVisible
-
setHoverExpand
Enables or disables the hover expansion mode oftreeView
. 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
orGtkEntryCompletion
.- Parameters:
hoverExpand
- the value for thehover-expand
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setHoverSelection
Enables or disables the hover selection mode oftreeView
. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modesSelectionMode.SINGLE
andSelectionMode.BROWSE
.This mode is primarily intended for treeviews in popups, e.g. in
GtkComboBox
orGtkEntryCompletion
.- Parameters:
hoverSelection
- the value for thehover-selection
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setLevelIndentation
Extra indentation for each level.- Parameters:
levelIndentation
- the value for thelevel-indentation
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setModel
-
setReorderable
-
setRubberBanding
-
setSearchColumn
-
setShowExpanders
true
if the view has expanders.- Parameters:
showExpanders
- the value for theshow-expanders
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTooltipColumn
-
onColumnsChanged
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
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
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onMoveCursor
TheGtkTreeView
::move-cursor signal is a [keybinding signal]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
The "row-activated" signal is emitted when the methodTreeView.rowActivated(org.gnome.gtk.TreePath, org.gnome.gtk.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 tofalse
, or when the user single-clicks a row when that property set totrue
.This signal is also emitted when a non-editable row is selected and one of the keys:
Space
,Shift
+Space
,Return
orEnter
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
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
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
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSelectCursorParent
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSelectCursorRow
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onStartInteractiveSearch
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onTestCollapseRow
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
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
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onUnselectAll
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-