Package org.gnome.adw
Class Toggle
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.adw.Toggle
- All Implemented Interfaces:
Proxy
A toggle within
ToggleGroup.
AdwToggle can optionally have a name, set with Toggle:name.
If the name is set, ToggleGroup:active-name can be used to access
toggles instead of index.
- Since:
- 1.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classToggle.Builder<B extends Toggle.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionToggle()Creates a new Toggle.Toggle(MemorySegment address) Create a Toggle proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ToggleasParent()Returns this instance as if it were its parent type.static Toggle.Builder<? extends Toggle.Builder> builder()AToggle.Builderobject constructs aTogglewith the specified properties.@Nullable WidgetgetChild()Gets the child widget ofself.booleanGets whether this Toggle is enabled.@Nullable StringGets the icon name ofself.intgetIndex()Gets the index of this Toggle within its toggle group.@Nullable StringgetLabel()Gets the label ofself.getName()Gets the name ofself.Gets the tooltip ofself.static @Nullable TypegetType()Get the GType of the Toggle classbooleanGets whether this Toggle uses underlines.voidSets the child of this Toggle tochild.voidsetEnabled(boolean enabled) Sets whether this Toggle is enabled.voidsetIconName(@Nullable String iconName) Sets the icon name of this Toggle toiconName.voidSets the label of this Toggle tolabel.voidSets the name of this Toggle toname.voidsetTooltip(String tooltip) Sets the tooltip of this Toggle totooltip.voidsetUseUnderline(boolean useUnderline) Sets whether an embedded underline in the label indicates a mnemonic.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Toggle
Create a Toggle proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Toggle
public Toggle()Creates a new Toggle.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getChild
Gets the child widget ofself.- Returns:
- the toggle child
- Since:
- 1.7
-
getEnabled
public boolean getEnabled()Gets whether this Toggle is enabled.- Returns:
- whether the toggle is enabled
- Since:
- 1.7
-
getIconName
Gets the icon name ofself.- Returns:
- the toggle icon name
- Since:
- 1.7
-
getIndex
public int getIndex()Gets the index of this Toggle within its toggle group.- Returns:
- the index, or
GTK_INVALID_LIST_POSITIONif it's not in a group - Since:
- 1.7
-
getLabel
-
getName
-
getTooltip
-
getUseUnderline
public boolean getUseUnderline()Gets whether this Toggle uses underlines.- Returns:
- whether the toggle uses underlines
- Since:
- 1.7
-
setChild
Sets the child of this Toggle tochild.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- a child widget- Since:
- 1.7
-
setEnabled
public void setEnabled(boolean enabled) Sets whether this Toggle is enabled.- Parameters:
enabled- whether the toggle should be enbled- Since:
- 1.7
-
setIconName
Sets the icon name of this Toggle toiconName.The icon will be displayed alone or next to the label, unless
Toggle:childis set.- Parameters:
iconName- the icon name- Since:
- 1.7
-
setLabel
Sets the label of this Toggle tolabel.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- a label- Since:
- 1.7
-
setName
Sets the name of this Toggle toname.Allows accessing this Toggle by its name instead of index.
See
ToggleGroup:active-name.- Parameters:
name- a name- Since:
- 1.7
-
setTooltip
Sets the tooltip of this Toggle totooltip.tooltipcan be marked up with the Pango text markup language.- Parameters:
tooltip- the tooltip- Since:
- 1.7
-
setUseUnderline
public void setUseUnderline(boolean useUnderline) Sets whether an embedded underline in the label indicates a mnemonic.See
Toggle:label.- Parameters:
useUnderline- whether an underline in the label indicates a mnemonic- Since:
- 1.7
-
builder
AToggle.Builderobject constructs aTogglewith the specified properties. Use the variousset...()methods to set properties, and finish construction withToggle.Builder.build().- Returns:
- the builder object
-