Class Switch.Builder<B extends Switch.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:
Switch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSwitch
object.onActivate
(Switch.ActivateCallback handler) Emitted to animate the switch.onStateSet
(Switch.StateSetCallback handler) Emitted to change the underlying state.setActive
(boolean active) Whether theGtkSwitch
widget is in its on or off state.setState
(boolean state) The backend state that is controlled by the switch.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 theSwitch
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 toSwitch
.- Overrides:
build
in classWidget.Builder<B extends Switch.Builder<B>>
- Returns:
- a new instance of
Switch
with the properties that were set in the Builder object.
-
setActive
Whether theGtkSwitch
widget is in its on or off state.- Parameters:
active
- the value for theactive
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setState
The backend state that is controlled by the switch.Applications should usually set the
Gtk.Switch:active
property, except when indicating a change to the backend state which occurs separately from the user's interaction.See
Gtk.Switch::state-set
for details.- Parameters:
state
- the value for thestate
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onActivate
Emitted to animate the switch.Applications should never connect to this signal, but use the
Gtk.Switch:active
property.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onStateSet
Emitted to change the underlying state.The ::state-set signal is emitted when the user changes the switch position. The default handler calls
Switch.setState(boolean)
with the value ofstate
.To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call
Switch.setState(boolean)
when the underlying state change is complete. The signal handler should returntrue
to prevent the default handler from running.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-