Class ShortcutsItem
- All Implemented Interfaces:
Proxy
ShortcutsSection.
A shortcut has a title, an optional subtitle, and an accelerator.
Accelerator must be specified in the format ShortcutLabel accepts.
Alternatively, the ShortcutsItem:action-name property can be used
to automatically get accelerator associated with the specified action, as set
via Application.setAccelsForAction(java.lang.String, java.lang.String[]).
If both are specified, the accelerator will be used if the action couldn't be found or doesn't have an accelerator associated for it.
If ShortcutsItem:direction is set, the shortcut will only be
displayed for the specified text direction. This allows to display different
shortcuts for different text directions.
- Since:
- 1.8
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classShortcutsItem.Builder<B extends ShortcutsItem.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
ConstructorsConstructorDescriptionCreates a new ShortcutsItem.ShortcutsItem(MemorySegment address) Create a ShortcutsItem proxy instance for the provided memory address.ShortcutsItem(String title, String accelerator) Creates a newAdwShortcutsItemwithtitleandaccelerator. -
Method Summary
Modifier and TypeMethodDescriptionprotected ShortcutsItemasParent()Returns this instance as if it were its parent type.static ShortcutsItem.Builder<? extends ShortcutsItem.Builder> builder()AShortcutsItem.Builderobject constructs aShortcutsItemwith the specified properties.static ShortcutsItemfromAction(String title, String actionName) Creates a newAdwShortcutsItemwithtitleandactionName.Gets the accelerator ofself.Gets the action name to get the accelerator from.Gets the direction ofself.Gets the subtitle ofself.getTitle()Gets the title ofself.static @Nullable TypegetType()Get the GType of the ShortcutsItem classvoidsetAccelerator(String accelerator) Sets the accelerator ofself.voidsetActionName(String actionName) Sets the action name to get the accelerator from.voidsetDirection(TextDirection direction) Sets the direction ofself.voidsetSubtitle(String subtitle) Sets the subtitle ofself.voidSets the title ofself.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
-
ShortcutsItem
Create a ShortcutsItem proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ShortcutsItem
-
ShortcutsItem
public ShortcutsItem()Creates a new ShortcutsItem.
-
-
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. -
fromAction
Creates a newAdwShortcutsItemwithtitleandactionName.- Parameters:
title- the shortcut titleactionName- the shortcut action name- Returns:
- the newly created
AdwShortcutsItem - Since:
- 1.8
-
getAccelerator
-
getActionName
Gets the action name to get the accelerator from.- Returns:
- the action name
- Since:
- 1.8
-
getDirection
Gets the direction ofself.- Returns:
- the shortcut direction
- Since:
- 1.8
-
getSubtitle
-
getTitle
-
setAccelerator
Sets the accelerator ofself.acceleratormust be in the formatShortcutLabelaccepts.- Parameters:
accelerator- the accelerator to use- Since:
- 1.8
-
setActionName
Sets the action name to get the accelerator from.- Parameters:
actionName- the action name to use- Since:
- 1.8
-
setDirection
Sets the direction ofself.If set to
Gtk.TextDirection.LTRorGtk.TextDirection.RTL, the shortcut will only be displayed for this direction.- Parameters:
direction- the shortcut direction- Since:
- 1.8
-
setSubtitle
Sets the subtitle ofself.- Parameters:
subtitle- the subtitle to use- Since:
- 1.8
-
setTitle
Sets the title ofself.- Parameters:
title- the title to use- Since:
- 1.8
-
builder
AShortcutsItem.Builderobject constructs aShortcutsItemwith the specified properties. Use the variousset...()methods to set properties, and finish construction withShortcutsItem.Builder.build().- Returns:
- the builder object
-