Class SplitButton.Builder<B extends SplitButton.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
,Actionable.Builder<B>
- Enclosing class:
SplitButton
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSplitButton
object.onActivate
(SplitButton.ActivateCallback handler) Emitted to animate press then release.onClicked
(SplitButton.ClickedCallback handler) Emitted when the button has been activated (pressed and released).setCanShrink
(boolean canShrink) Whether the button can be smaller than the natural size of its contents.The child widget.setDirection
(ArrowType direction) The direction in which the popup will be popped up.setDropdownTooltip
(String dropdownTooltip) The tooltip of the dropdown button.setIconName
(String iconName) The name of the icon used to automatically populate the button.The label for the button.setMenuModel
(MenuModel menuModel) TheGMenuModel
from which the popup will be created.setPopover
(Popover popover) TheGtkPopover
that will be popped up when the dropdown is clicked.setUseUnderline
(boolean useUnderline) Whether an underline in the text indicates a mnemonic.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 org.gnome.gtk.Actionable.Builder
setActionName, setActionTarget
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 theSplitButton
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 toSplitButton
.- Overrides:
build
in classWidget.Builder<B extends SplitButton.Builder<B>>
- Returns:
- a new instance of
SplitButton
with the properties that were set in the Builder object.
-
setCanShrink
Whether the button can be smaller than the natural size of its contents.If set to
TRUE
, the label will ellipsize.See
Gtk.Button:can-shrink
andGtk.MenuButton:can-shrink
.- Parameters:
canShrink
- the value for thecan-shrink
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setChild
-
setDirection
The direction in which the popup will be popped up.The dropdown arrow icon will point at the same direction.
If the does not fit in the available space in the given direction, GTK will try its best to keep it inside the screen and fully visible.
If you pass
GTK_ARROW_NONE
, it's equivalent toGTK_ARROW_DOWN
.- Parameters:
direction
- the value for thedirection
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDropdownTooltip
-
setIconName
The name of the icon used to automatically populate the button.Setting the icon name will set
SplitButton:label
andSplitButton:child
toNULL
.- Parameters:
iconName
- the value for theicon-name
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setLabel
-
setMenuModel
TheGMenuModel
from which the popup will be created.If the menu model is
NULL
, the dropdown is disabled.A
Popover
will be created from the menu model withPopoverMenu.fromModel(org.gnome.gio.MenuModel)
. Actions will be connected as documented for this function.If
SplitButton:popover
is already set, it will be dissociated from the button, and the property is set toNULL
.- Parameters:
menuModel
- the value for themenu-model
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPopover
TheGtkPopover
that will be popped up when the dropdown is clicked.If the popover is
NULL
, the dropdown is disabled.If
SplitButton:menu-model
is set, the menu model is dissociated from the button, and the property is set toNULL
.- Parameters:
popover
- the value for thepopover
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setUseUnderline
Whether an underline in the text indicates a mnemonic.See
SplitButton:label
.- Parameters:
useUnderline
- the value for theuse-underline
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onActivate
Emitted to animate press then release.This is an action signal. Applications should never connect to this signal, but use the
SplitButton::clicked
signal.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onClicked
Emitted when the button has been activated (pressed and released).- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-