Class Assistant
- All Implemented Interfaces:
Proxy
,Accessible
,Buildable
,ConstraintTarget
,Native
,Root
,ShortcutManager
GtkAssistant
is used to represent a complex as a series of steps.
Each step consists of one or more pages. GtkAssistant
guides the user
through the pages, and controls the page flow to collect the data needed
for the operation.
GtkAssistant
handles which buttons to show and to make sensitive based
on page sequence knowledge and the Gtk.AssistantPageType
of each
page in addition to state information like the completed and committed page statuses.
If you have a case that doesn’t quite fit in GtkAssistant
s way of
handling buttons, you can use the AssistantPageType.CUSTOM
page
type and handle buttons yourself.
GtkAssistant
maintains a GtkAssistantPage
object for each added
child, which holds additional per-child properties. You
obtain the GtkAssistantPage
for a child with getPage(org.gnome.gtk.Widget)
.
GtkAssistant as GtkBuildable
The GtkAssistant
implementation of the GtkBuildable
interface
exposes the actionArea
as internal children with the name
“action_area”.
To add pages to an assistant in GtkBuilder
, simply add it as a
child to the GtkAssistant
object. If you need to set per-object
properties, create a GtkAssistantPage
object explicitly, and
set the child widget as a property on it.
CSS nodes
GtkAssistant
has a single CSS node with the name window and style
class .assistant.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Deprecated.static class
Assistant.Builder<B extends Assistant.Builder<B>>
Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interface
Deprecated.static interface
Deprecated.static interface
Deprecated.static interface
Deprecated.Nested classes/interfaces inherited from class org.gnome.gtk.Window
Window.ActivateDefaultCallback, Window.ActivateFocusCallback, Window.CloseRequestCallback, Window.EnableDebuggingCallback, Window.KeysChangedCallback, Window.WindowClass
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Native
Native.NativeImpl, Native.NativeInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Root
Root.RootImpl, Root.RootInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.ShortcutManager
ShortcutManager.ShortcutManagerImpl, ShortcutManager.ShortcutManagerInterface
-
Constructor Summary
ConstructorDescriptionDeprecated.This widget will be removed in GTK 5Assistant
(MemorySegment address) Deprecated.Create a Assistant proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionWidget
(Widget child) Deprecated.This widget will be removed in GTK 5int
appendPage
(Widget page) Deprecated.This widget will be removed in GTK 5protected Assistant
asParent()
Deprecated.Returns this instance as if it were its parent type.static Assistant.Builder
<? extends Assistant.Builder> builder()
Deprecated.AAssistant.Builder
object constructs aAssistant
with the specified properties.void
commit()
Deprecated.This widget will be removed in GTK 5void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
emitPrepare
(Widget page) Deprecated.int
Deprecated.This widget will be removed in GTK 5int
Deprecated.This widget will be removed in GTK 5getNthPage
(int pageNum) Deprecated.This widget will be removed in GTK 5Deprecated.This widget will be removed in GTK 5boolean
getPageComplete
(Widget page) Deprecated.This widget will be removed in GTK 5getPages()
Deprecated.This widget will be removed in GTK 5getPageTitle
(Widget page) Deprecated.This widget will be removed in GTK 5getPageType
(Widget page) Deprecated.This widget will be removed in GTK 5static Type
getType()
Deprecated.Get the GType of the Assistant classint
insertPage
(Widget page, int position) Deprecated.This widget will be removed in GTK 5void
nextPage()
Deprecated.This widget will be removed in GTK 5onApply
(Assistant.ApplyCallback handler) Deprecated.This widget will be removed in GTK 5onCancel
(Assistant.CancelCallback handler) Deprecated.This widget will be removed in GTK 5onClose
(Assistant.CloseCallback handler) Deprecated.This widget will be removed in GTK 5onEscape
(Assistant.EscapeCallback handler) Deprecated.This widget will be removed in GTK 5onPrepare
(Assistant.PrepareCallback handler) Deprecated.This widget will be removed in GTK 5int
prependPage
(Widget page) Deprecated.This widget will be removed in GTK 5void
Deprecated.This widget will be removed in GTK 5void
removeActionWidget
(Widget child) Deprecated.This widget will be removed in GTK 5void
removePage
(int pageNum) Deprecated.This widget will be removed in GTK 5void
setCurrentPage
(int pageNum) Deprecated.This widget will be removed in GTK 5void
setForwardPageFunc
(@Nullable AssistantPageFunc pageFunc) Deprecated.This widget will be removed in GTK 5void
setPageComplete
(Widget page, boolean complete) Deprecated.This widget will be removed in GTK 5void
setPageTitle
(Widget page, String title) Deprecated.This widget will be removed in GTK 5void
setPageType
(Widget page, AssistantPageType type) Deprecated.This widget will be removed in GTK 5void
Deprecated.This widget will be removed in GTK 5Methods inherited from class org.gnome.gtk.Window
activateDefault, activateFocus, close, closeRequest, destroy, emitActivateDefault, emitActivateFocus, emitCloseRequest, emitEnableDebugging, emitKeysChanged, enableDebugging, fullscreen, fullscreenOnMonitor, getApplication, getChild, getDecorated, getDefaultIconName, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getFocus, getFocusVisible, getGroup, getHandleMenubarAccel, getHideOnClose, getIconName, getMemoryLayout, getMnemonicsVisible, getModal, getResizable, getTitle, getTitlebar, getToplevels, getTransientFor, hasGroup, isActive, isFullscreen, isMaximized, isSuspended, keysChanged, listToplevels, maximize, minimize, onActivateDefault, onActivateFocus, onCloseRequest, onEnableDebugging, onKeysChanged, present, presentWithTime, setApplication, setAutoStartupNotification, setChild, setDecorated, setDefaultIconName, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDisplay, setFocus, setFocusVisible, setHandleMenubarAccel, setHideOnClose, setIconName, setInteractiveDebugging, setMnemonicsVisible, setModal, setResizable, setStartupId, setTitle, setTitlebar, setTransientFor, unfullscreen, unmaximize, unminimize
Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
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, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Native
getRenderer, getSurface, getSurfaceTransform, realize, unrealize
Methods inherited from interface org.gnome.gtk.Root
getDisplay, getFocus, setFocus
-
Constructor Details
-
Assistant
Deprecated.Create a Assistant proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Assistant
Deprecated.This widget will be removed in GTK 5Creates a newGtkAssistant
.
-
-
Method Details
-
getType
-
asParent
Deprecated.Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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. -
addActionWidget
Deprecated.This widget will be removed in GTK 5Adds a widget to the action area of aGtkAssistant
.- Parameters:
child
- aGtkWidget
-
appendPage
Deprecated.This widget will be removed in GTK 5Appends a page to the this Assistant.- Parameters:
page
- aGtkWidget
- Returns:
- the index (starting at 0) of the inserted page
-
commit
Deprecated.This widget will be removed in GTK 5Erases the visited page history.GTK will then hide the back button on the current page, and removes the cancel button from subsequent pages.
Use this when the information provided up to the current page is hereafter deemed permanent and cannot be modified or undone. For example, showing a progress page to track a long-running, unreversible operation after the user has clicked apply on a confirmation page.
-
getCurrentPage
Deprecated.This widget will be removed in GTK 5Returns the page number of the current page.- Returns:
- The index (starting from 0) of the current page in the this Assistant, or -1 if the this Assistant has no pages, or no current page
-
getNPages
Deprecated.This widget will be removed in GTK 5Returns the number of pages in the this Assistant- Returns:
- the number of pages in the this Assistant
-
getNthPage
Deprecated.This widget will be removed in GTK 5Returns the child widget contained in page numberpageNum
.- Parameters:
pageNum
- the index of a page in the this Assistant, or -1 to get the last page- Returns:
- the child widget, or
null
ifpageNum
is out of bounds
-
getPage
Deprecated.This widget will be removed in GTK 5Returns theGtkAssistantPage
object forchild
.- Parameters:
child
- a child of this Assistant- Returns:
- the
GtkAssistantPage
forchild
-
getPageComplete
Deprecated.This widget will be removed in GTK 5Gets whetherpage
is complete.- Parameters:
page
- a page of this Assistant- Returns:
true
ifpage
is complete.
-
getPageTitle
Deprecated.This widget will be removed in GTK 5Gets the title forpage
.- Parameters:
page
- a page of this Assistant- Returns:
- the title for
page
-
getPageType
Deprecated.This widget will be removed in GTK 5Gets the page type ofpage
.- Parameters:
page
- a page of this Assistant- Returns:
- the page type of
page
-
getPages
Deprecated.This widget will be removed in GTK 5Gets a list model of the assistant pages.- Returns:
- A list model of the pages.
-
insertPage
Deprecated.This widget will be removed in GTK 5Inserts a page in the this Assistant at a given position.- Parameters:
page
- aGtkWidget
position
- the index (starting at 0) at which to insert the page, or -1 to append the page to the this Assistant- Returns:
- the index (starting from 0) of the inserted page
-
nextPage
Deprecated.This widget will be removed in GTK 5Navigate to the next page.It is a programming error to call this function when there is no next page.
This function is for use when creating pages of the
AssistantPageType.CUSTOM
type. -
prependPage
Deprecated.This widget will be removed in GTK 5Prepends a page to the this Assistant.- Parameters:
page
- aGtkWidget
- Returns:
- the index (starting at 0) of the inserted page
-
previousPage
Deprecated.This widget will be removed in GTK 5Navigate to the previous visited page.It is a programming error to call this function when no previous page is available.
This function is for use when creating pages of the
AssistantPageType.CUSTOM
type. -
removeActionWidget
Deprecated.This widget will be removed in GTK 5Removes a widget from the action area of aGtkAssistant
.- Parameters:
child
- aGtkWidget
-
removePage
Deprecated.This widget will be removed in GTK 5Removes thepageNum
’s page from this Assistant.- Parameters:
pageNum
- the index of a page in the this Assistant, or -1 to remove the last page
-
setCurrentPage
Deprecated.This widget will be removed in GTK 5Switches the page topageNum
.Note that this will only be necessary in custom buttons, as the this Assistant flow can be set with gtk_assistant_set_forward_page_func().
- Parameters:
pageNum
- index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the this Assistant, nothing will be done.
-
setForwardPageFunc
Deprecated.This widget will be removed in GTK 5Sets the page forwarding function to bepageFunc
.This function will be used to determine what will be the next page when the user presses the forward button. Setting
pageFunc
tonull
will make the assistant to use the default forward function, which just goes to the next visible page.- Parameters:
pageFunc
- theGtkAssistantPageFunc
, ornull
to use the default one
-
setPageComplete
Deprecated.This widget will be removed in GTK 5Sets whetherpage
contents are complete.This will make this Assistant update the buttons state to be able to continue the task.
- Parameters:
page
- a page of this Assistantcomplete
- the completeness status of the page
-
setPageTitle
Deprecated.This widget will be removed in GTK 5Sets a title forpage
.The title is displayed in the header area of the assistant when
page
is the current page.- Parameters:
page
- a page of this Assistanttitle
- the new title forpage
-
setPageType
Deprecated.This widget will be removed in GTK 5Sets the page type forpage
.The page type determines the page behavior in the this Assistant.
- Parameters:
page
- a page of this Assistanttype
- the new type forpage
-
updateButtonsState
Deprecated.This widget will be removed in GTK 5Forces this Assistant to recompute the buttons state.GTK automatically takes care of this in most situations, e.g. when the user goes to a different page, or when the visibility or completeness of a page changes.
One situation where it can be necessary to call this function is when changing a value on the current page affects the future page flow of the assistant.
-
onApply
@Deprecated public SignalConnection<Assistant.ApplyCallback> onApply(Assistant.ApplyCallback handler) Deprecated.This widget will be removed in GTK 5Emitted when the apply button is clicked.The default behavior of the
GtkAssistant
is to switch to the page after the current page, unless the current page is the last one.A handler for the ::apply signal should carry out the actions for which the wizard has collected data. If the action takes a long time to complete, you might consider putting a page of type
AssistantPageType.PROGRESS
after the confirmation page and handle this operation within theGtk.Assistant::prepare
signal of the progress page.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitApply
Deprecated.Emits the "apply" signal. SeeonApply(org.gnome.gtk.Assistant.ApplyCallback)
. -
onCancel
@Deprecated public SignalConnection<Assistant.CancelCallback> onCancel(Assistant.CancelCallback handler) Deprecated.This widget will be removed in GTK 5Emitted when then the cancel button is clicked.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitCancel
Deprecated.Emits the "cancel" signal. SeeonCancel(org.gnome.gtk.Assistant.CancelCallback)
. -
onClose
@Deprecated public SignalConnection<Assistant.CloseCallback> onClose(Assistant.CloseCallback handler) Deprecated.This widget will be removed in GTK 5Emitted either when the close button of a summary page is clicked, or when the apply button in the last page in the flow (of typeAssistantPageType.CONFIRM
) is clicked.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitClose
Deprecated.Emits the "close" signal. SeeonClose(org.gnome.gtk.Assistant.CloseCallback)
. -
onEscape
@Deprecated public SignalConnection<Assistant.EscapeCallback> onEscape(Assistant.EscapeCallback handler) Deprecated.This widget will be removed in GTK 5The action signal for the Escape binding.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitEscape
Deprecated.Emits the "escape" signal. SeeonEscape(org.gnome.gtk.Assistant.EscapeCallback)
. -
onPrepare
@Deprecated public SignalConnection<Assistant.PrepareCallback> onPrepare(Assistant.PrepareCallback handler) Deprecated.This widget will be removed in GTK 5Emitted when a new page is set as the assistant's current page, before making the new page visible.A handler for this signal can do any preparations which are necessary before showing
page
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitPrepare
Deprecated.Emits the "prepare" signal. SeeonPrepare(org.gnome.gtk.Assistant.PrepareCallback)
. -
builder
Deprecated.AAssistant.Builder
object constructs aAssistant
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAssistant.Builder.build()
.
-