Class Switch.Builder<B extends Switch.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:
Switch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theSwitchobject.onActivate(Switch.ActivateCallback handler) Emitted to animate the switch.onStateSet(Switch.StateSetCallback handler) Emitted to change the underlying state.setActive(boolean active) Whether theGtkSwitchwidget 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, 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 theSwitchobject. 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:
buildin classWidget.Builder<B extends Switch.Builder<B>>- Returns:
- a new instance of
Switchwith the properties that were set in the Builder object.
-
setActive
Whether theGtkSwitchwidget is in its on or off state.- Parameters:
active- the value for theactiveproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setState
The backend state that is controlled by the switch.Applications should usually set the
Gtk.Switch:activeproperty, except when indicating a change to the backend state which occurs separately from the user's interaction.See
Gtk.Switch::state-setfor details.- Parameters:
state- the value for thestateproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
onActivate
Emitted to animate the switch.Applications should never connect to this signal, but use the
Gtk.Switch:activeproperty.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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 returntrueto prevent the default handler from running.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-