Class Assistant
- All Implemented Interfaces:
Accessible,Buildable,ConstraintTarget,Native,Root,ShortcutManager,Proxy
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 GtkAssistants 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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.static classAssistant.Builder<B extends Assistant.Builder<B>>Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interfaceDeprecated.static interfaceDeprecated.static interfaceDeprecated.static interfaceDeprecated.Nested classes/interfaces inherited from class org.gnome.gtk.Window
Window.ActivateDefaultCallback, Window.ActivateFocusCallback, Window.CloseRequestCallback, Window.EnableDebuggingCallback, Window.KeysChangedCallback, Window.WindowClassNested 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.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Native
Native.Native$Impl, Native.NativeInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Root
Root.Root$Impl, Root.RootInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.ShortcutManager
ShortcutManager.ShortcutManager$Impl, ShortcutManager.ShortcutManagerInterface -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a new Assistant.Assistant(MemorySegment address) Deprecated.Create a Assistant proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionWidget(Widget child) Deprecated.This widget will be removed in GTK 5intappendPage(Widget page) Deprecated.This widget will be removed in GTK 5protected AssistantasParent()Deprecated.Returns this instance as if it were its parent type.static Assistant.Builder<? extends Assistant.Builder> builder()Deprecated.AAssistant.Builderobject constructs aAssistantwith the specified properties.voidcommit()Deprecated.This widget will be removed in GTK 5voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidemitPrepare(@Nullable Widget page) Deprecated.intDeprecated.This widget will be removed in GTK 5intDeprecated.This widget will be removed in GTK 5@Nullable WidgetgetNthPage(int pageNum) Deprecated.This widget will be removed in GTK 5Deprecated.This widget will be removed in GTK 5booleangetPageComplete(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 @Nullable TypegetType()Deprecated.Get the GType of the Assistant classintinsertPage(Widget page, int position) Deprecated.This widget will be removed in GTK 5voidnextPage()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 5intprependPage(Widget page) Deprecated.This widget will be removed in GTK 5voidDeprecated.This widget will be removed in GTK 5voidremoveActionWidget(Widget child) Deprecated.This widget will be removed in GTK 5voidremovePage(int pageNum) Deprecated.This widget will be removed in GTK 5voidsetCurrentPage(int pageNum) Deprecated.This widget will be removed in GTK 5voidsetForwardPageFunc(@Nullable AssistantPageFunc pageFunc) Deprecated.This widget will be removed in GTK 5voidsetPageComplete(Widget page, boolean complete) Deprecated.This widget will be removed in GTK 5voidsetPageTitle(Widget page, String title) Deprecated.This widget will be removed in GTK 5voidsetPageType(Widget page, AssistantPageType type) Deprecated.This widget will be removed in GTK 5voidDeprecated.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, getGravity, 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, setGravity, setHandleMenubarAccel, setHideOnClose, setIconName, setInteractiveDebugging, setMnemonicsVisible, setModal, setResizable, setStartupId, setTitle, setTitlebar, setTransientFor, unfullscreen, unmaximize, unminimizeMethods 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, getLimitEvents, 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, setLimitEvents, 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, unsetStateFlagsMethods 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, 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, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods inherited from interface org.gnome.gtk.Native
getRenderer, getSurface, getSurfaceTransform, realize, unrealizeMethods 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
public Assistant()Deprecated.Creates a new Assistant.
-
-
Method Details
-
getType
Deprecated.Get the GType of the Assistant class- Returns:
- the GType
-
asParent
Deprecated.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. -
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 theassistant.- 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
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 theassistant,or -1 to get the last page- Returns:
- the child widget, or
nullifpageNumis out of bounds
-
getPage
Deprecated.This widget will be removed in GTK 5Returns theGtkAssistantPageobject forchild.- Parameters:
child- a child of this Assistant- Returns:
- the
GtkAssistantPageforchild
-
getPageComplete
Deprecated.This widget will be removed in GTK 5Gets whetherpageis complete.- Parameters:
page- a page of this Assistant- Returns:
trueifpageis 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- aGtkWidgetposition- 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.CUSTOMtype. -
prependPage
Deprecated.This widget will be removed in GTK 5Prepends a page to theassistant.- 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.CUSTOMtype. -
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’spage fromassistant.- Parameters:
pageNum- the index of a page in theassistant,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 theassistant,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
pageFunctonullwill make the assistant to use the default forward function, which just goes to the next visible page.- Parameters:
pageFunc- theGtkAssistantPageFunc, ornullto use the default one
-
setPageComplete
Deprecated.This widget will be removed in GTK 5Sets whetherpagecontents 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
pageis 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
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
GtkAssistantis 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.PROGRESSafter the confirmation page and handle this operation within theGtk.Assistant::preparesignal 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.Builderobject constructs aAssistantwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAssistant.Builder.build().- Returns:
- the builder object
-