Class ShortcutsShortcut.Builder<B extends ShortcutsShortcut.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Enclosing class:
ShortcutsShortcut
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theShortcutsShortcut
object.setAccelerator
(String accelerator) The accelerator(s) represented by this object.setAccelSizeGroup
(SizeGroup accelSizeGroup) The size group for the accelerator portion of this shortcut.setActionName
(String actionName) A detailed action name.setDirection
(TextDirection direction) The text direction for which this shortcut is active.An icon to represent the shortcut or gesture.setIconSet
(boolean iconSet) true
if an icon has been set.setShortcutType
(ShortcutType shortcutType) The type of shortcut that is represented.setSubtitle
(String subtitle) The subtitle for the shortcut or gesture.setSubtitleSet
(boolean subtitleSet) true
if a subtitle has been set.The textual description for the shortcut or gesture represented by this object.setTitleSizeGroup
(SizeGroup titleSizeGroup) The size group for the textual portion of this shortcut.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 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 theShortcutsShortcut
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 toShortcutsShortcut
.- Overrides:
build
in classWidget.Builder<B extends ShortcutsShortcut.Builder<B>>
- Returns:
- a new instance of
ShortcutsShortcut
with the properties that were set in the Builder object.
-
setAccelSizeGroup
The size group for the accelerator portion of this shortcut.This is used internally by GTK, and must not be modified by applications.
- Parameters:
accelSizeGroup
- the value for theaccel-size-group
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setAccelerator
The accelerator(s) represented by this object.This property is used if
Gtk.ShortcutsShortcut:shortcut-type
is set toShortcutType.ACCELERATOR
.The syntax of this property is (an extension of) the syntax understood by
Gtk.acceleratorParse(java.lang.String, io.github.jwharm.javagi.base.Out<java.lang.Integer>, io.github.jwharm.javagi.base.Out<java.util.Set<org.gnome.gdk.ModifierType>>)
. Multiple accelerators can be specified by separating them with a space, but keep in mind that the available width is limited.It is also possible to specify ranges of shortcuts, using
...
between the keys. Sequences of keys can be specified using a+
or&
between the keys.Examples:
- A single shortcut:
<ctl><alt>delete
- Two alternative shortcuts:
<shift>a Home
- A range of shortcuts:
<alt>1...<alt>9
- Several keys pressed together:
Control_L&Control_R
- A sequence of shortcuts or keys:
<ctl>c+<ctl>x
Use "+" instead of "&" when the keys may (or have to be) pressed sequentially (e.g use "t+t" for 'press the t key twice').
Note that
<
,>
and&
need to be escaped as<
,>
; and&
; when used in .ui files.- Parameters:
accelerator
- the value for theaccelerator
property- Returns:
- the
Builder
instance is returned, to allow method chaining
- A single shortcut:
-
setActionName
A detailed action name.If this is set for a shortcut of type
ShortcutType.ACCELERATOR
, then GTK will use the accelerators that are associated with the action viaApplication.setAccelsForAction(java.lang.String, java.lang.String[])
, and settingGtk.ShortcutsShortcut:accelerator
is not necessary.- Parameters:
actionName
- the value for theaction-name
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setDirection
The text direction for which this shortcut is active.If the shortcut is used regardless of the text direction, set this property to
TextDirection.NONE
.- Parameters:
direction
- the value for thedirection
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setIcon
An icon to represent the shortcut or gesture.This property is used if
Gtk.ShortcutsShortcut:shortcut-type
is set toShortcutType.GESTURE
.For the other predefined gesture types, GTK provides an icon on its own.
- Parameters:
icon
- the value for theicon
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setIconSet
true
if an icon has been set.- Parameters:
iconSet
- the value for theicon-set
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setShortcutType
The type of shortcut that is represented.- Parameters:
shortcutType
- the value for theshortcut-type
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSubtitle
The subtitle for the shortcut or gesture.This is typically used for gestures and should be a short, one-line text that describes the gesture itself. For the predefined gesture types, GTK provides a subtitle on its own.
- Parameters:
subtitle
- the value for thesubtitle
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSubtitleSet
true
if a subtitle has been set.- Parameters:
subtitleSet
- the value for thesubtitle-set
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTitle
-
setTitleSizeGroup
The size group for the textual portion of this shortcut.This is used internally by GTK, and must not be modified by applications.
- Parameters:
titleSizeGroup
- the value for thetitle-size-group
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-