Class SplitButton.Builder<B extends SplitButton.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
Accessible.Builder<B>,Actionable.Builder<B>,BuilderInterface
- Enclosing class:
SplitButton
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theSplitButtonobject.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) TheGMenuModelfrom which the popup will be created.setPopover(Popover popover) TheGtkPopoverthat 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, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequestMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRoleMethods inherited from interface org.gnome.gtk.Actionable.Builder
setActionName, setActionTargetMethods inherited from interface org.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theSplitButtonobject. 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:
buildin classWidget.Builder<B extends SplitButton.Builder<B>>- Returns:
- a new instance of
SplitButtonwith 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-shrinkandGtk.MenuButton:can-shrink.- Parameters:
canShrink- the value for thecan-shrinkproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.4
-
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 thedirectionproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setDropdownTooltip
The tooltip of the dropdown button.The tooltip can be marked up with the Pango text markup language.
- Parameters:
dropdownTooltip- the value for thedropdown-tooltipproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.2
-
setIconName
The name of the icon used to automatically populate the button.Setting the icon name will set
SplitButton:labelandSplitButton:childtoNULL.- Parameters:
iconName- the value for theicon-nameproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setLabel
-
setMenuModel
TheGMenuModelfrom which the popup will be created.If the menu model is
NULL, the dropdown is disabled.A
Popoverwill be created from the menu model withPopoverMenu.fromModel(org.gnome.gio.MenuModel). Actions will be connected as documented for this function.If
SplitButton:popoveris already set, it will be dissociated from the button, and the property is set toNULL.- Parameters:
menuModel- the value for themenu-modelproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPopover
TheGtkPopoverthat will be popped up when the dropdown is clicked.If the popover is
NULL, the dropdown is disabled.If
SplitButton:menu-modelis set, the menu model is dissociated from the button, and the property is set toNULL.- Parameters:
popover- the value for thepopoverproperty- Returns:
- the
Builderinstance 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-underlineproperty- Returns:
- the
Builderinstance 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::clickedsignal.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance is returned, to allow method chaining - See Also:
-