Package org.gnome.gtk
Class DropDown.Builder<B extends DropDown.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gobject.InitiallyUnowned.Builder<B>
org.gnome.gtk.Widget.Builder<B>
org.gnome.gtk.DropDown.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Enclosing class:
DropDown
public static class DropDown.Builder<B extends DropDown.Builder<B>>
extends Widget.Builder<B>
implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theDropDown
object.onActivate
(DropDown.ActivateCallback handler) Emitted to when the drop down is activated.setEnableSearch
(boolean enableSearch) Whether to show a search entry in the popup.setExpression
(Expression expression) An expression to evaluate to obtain strings to match against the search term.setFactory
(ListItemFactory factory) Factory for populating list items.setHeaderFactory
(ListItemFactory headerFactory) The factory for creating header widgets for the popup.setListFactory
(ListItemFactory listFactory) The factory for populating list items in the popup.Model for the displayed items.setSearchMatchMode
(StringFilterMatchMode searchMatchMode) The match mode for the search filter.setSelected
(int selected) The position of the selected item.setShowArrow
(boolean showArrow) Whether to show an arrow within the GtkDropDown widget.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
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theDropDown
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 toDropDown
.- Overrides:
build
in classWidget.Builder<B extends DropDown.Builder<B>>
- Returns:
- a new instance of
DropDown
with the properties that were set in the Builder object.
-
setEnableSearch
Whether to show a search entry in the popup.Note that search requires
Gtk.DropDown:expression
to be set.- Parameters:
enableSearch
- the value for theenable-search
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setExpression
An expression to evaluate to obtain strings to match against the search term.See
Gtk.DropDown:enable-search
for how to enable search. IfGtk.DropDown:factory
is not set, the expression is also used to bind strings to labels produced by a default factory.- Parameters:
expression
- the value for theexpression
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setFactory
Factory for populating list items.- Parameters:
factory
- the value for thefactory
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setHeaderFactory
The factory for creating header widgets for the popup.- Parameters:
headerFactory
- the value for theheader-factory
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setListFactory
The factory for populating list items in the popup.If this is not set,
Gtk.DropDown:factory
is used.- Parameters:
listFactory
- the value for thelist-factory
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setModel
-
setSearchMatchMode
The match mode for the search filter.- Parameters:
searchMatchMode
- the value for thesearch-match-mode
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSelected
The position of the selected item.If no item is selected, the property has the value
GTK_INVALID_LIST_POSITION
.- Parameters:
selected
- the value for theselected
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setShowArrow
Whether to show an arrow within the GtkDropDown widget.- Parameters:
showArrow
- the value for theshow-arrow
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onActivate
Emitted to when the drop down is activated.The
::activate
signal onGtkDropDown
is an action signal and emitting it causes the drop down to pop up its dropdown.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-