Class Toggle.Builder<B extends Toggle.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Toggle
- Since:
- 1.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theToggleobject.The toggle child.setDescription(String description) The description of the toggle.setEnabled(boolean enabled) Whether this toggle is enabled.setIconName(String iconName) The toggle icon name.The toggle label.The toggle name.setTooltip(String tooltip) The tooltip of the toggle.setUseUnderline(boolean useUnderline) Whether an embedded underline in the label indicates a mnemonic.Methods inherited from class GObject.Builder
onNotifyMethods inherited from class Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theToggleobject. This will callGObject.withProperties(Type, String[], Value[])to create a new GObject instance, which is then cast toToggle.- Overrides:
buildin classGObject.Builder<B extends Toggle.Builder<B>>- Returns:
- a new instance of
Togglewith the properties that were set in the Builder object.
-
setChild
The toggle child.
When the child is set, icon and label are not displayed.
It's recommended to still set the label, as it can still be used by the screen reader.
- Parameters:
child- the value for thechildproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setDescription
The description of the toggle.
The description will be read out when using screen reader. If not set,
Toggle:tooltipwill be used instead.See
Gtk.AccessibleProperty.description.- Parameters:
description- the value for thedescriptionproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
setEnabled
Whether this toggle is enabled.- Parameters:
enabled- the value for theenabledproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setIconName
-
setLabel
The toggle label.
The label will be displayed alone or next to the icon, unless
Toggle:childis set, but will still be read out by the screen reader.- Parameters:
label- the value for thelabelproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setName
-
setTooltip
The tooltip of the toggle.
The tooltip can be marked up with the Pango text markup language.
Tooltip text will also be used as accessible description. Use
Toggle:descriptionto set it separately.- Parameters:
tooltip- the value for thetooltipproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-
setUseUnderline
Whether an embedded underline in the label indicates a mnemonic.
See
Toggle:label.- Parameters:
useUnderline- the value for theuse-underlineproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.7
-