Class Toast.Builder<B extends Toast.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Toast
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theToastobject.Emitted after the button has been clicked.onDismissed(Toast.DismissedCallback handler) Emitted when the toast has been dismissed.setActionName(String actionName) The name of the associated action.setActionTarget(Variant actionTarget) The parameter for action invocations.setButtonLabel(String buttonLabel) The label to show on the button.setCustomTitle(Widget customTitle) The custom title widget.setPriority(ToastPriority priority) The priority of the toast.setTimeout(int timeout) The timeout of the toast, in seconds.The title of the toast.setUseMarkup(boolean useMarkup) Whether to use Pango markup for the toast title.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theToastobject. 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 toToast.- Overrides:
buildin classGObject.Builder<B extends Toast.Builder<B>>- Returns:
- a new instance of
Toastwith the properties that were set in the Builder object.
-
setActionName
-
setActionTarget
-
setButtonLabel
The label to show on the button.Underlines in the button text can be used to indicate a mnemonic.
If set to
NULL, the button won't be shown.See
Toast:action-name.- Parameters:
buttonLabel- the value for thebutton-labelproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setCustomTitle
The custom title widget.It will be displayed instead of the title if set. In this case,
Toast:titleis ignored.Setting a custom title will unset
Toast:title.- Parameters:
customTitle- the value for thecustom-titleproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.2
-
setPriority
The priority of the toast.Priority controls how the toast behaves when another toast is already being displayed.
If the priority is
ADW_TOAST_PRIORITY_NORMAL, the toast will be queued.If the priority is
ADW_TOAST_PRIORITY_HIGH, the toast will be displayed immediately, pushing the previous toast into the queue instead.- Parameters:
priority- the value for thepriorityproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setTimeout
The timeout of the toast, in seconds.If timeout is 0, the toast is displayed indefinitely until manually dismissed.
Toasts cannot disappear while being hovered, pressed (on touchscreen), or have keyboard focus inside them.
- Parameters:
timeout- the value for thetimeoutproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setTitle
The title of the toast.The title can be marked up with the Pango text markup language.
Setting a title will unset
Toast:custom-title.If
Toast:custom-titleis set, it will be used instead.- Parameters:
title- the value for thetitleproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setUseMarkup
Whether to use Pango markup for the toast title.- Parameters:
useMarkup- the value for theuse-markupproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.4
-
onButtonClicked
Emitted after the button has been clicked.It can be used as an alternative to setting an action.
- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.2
- See Also:
-
onDismissed
Emitted when the toast has been dismissed.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-