Class NavigationPage
- All Implemented Interfaces:
Accessible,Buildable,ConstraintTarget,Proxy
NavigationView or NavigationSplitView.
Each page has a child widget, a title and optionally a tag.
The NavigationPage::showing, NavigationPage::shown,
NavigationPage::hiding and NavigationPage::hidden signals
can be used to track the page's visibility within its AdwNavigationView.
Header Bar Integration
When placed inside AdwNavigationPage, HeaderBar will display the
page title instead of window title.
When used together with NavigationView, it will also display a back
button that can be used to go back to the previous page. Set
HeaderBar:show-back-button to FALSE to disable that behavior if
it's unwanted.
CSS Nodes
AdwNavigationPage has a single CSS node with name
navigation-view-page.
Accessibility
AdwNavigationPage uses the GTK_ACCESSIBLE_ROLE_GROUP role.
- Since:
- 1.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNavigationPage.Builder<B extends NavigationPage.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theHiddenCallbackcallback.static interfaceFunctional interface declaration of theHidingCallbackcallback.static classstatic interfaceFunctional interface declaration of theShowingCallbackcallback.static interfaceFunctional interface declaration of theShownCallbackcallback.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.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.ConstraintTargetInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NavigationPage.NavigationPage(MemorySegment address) Create a NavigationPage proxy instance for the provided memory address.NavigationPage(Widget child, String title) Creates a newAdwNavigationPage. -
Method Summary
Modifier and TypeMethodDescriptionprotected NavigationPageasParent()Returns this instance as if it were its parent type.static NavigationPage.Builder<? extends NavigationPage.Builder> builder()ANavigationPage.Builderobject constructs aNavigationPagewith the specified properties.voidEmits the "hidden" signal.voidEmits the "hiding" signal.voidEmits the "showing" signal.voidEmits the "shown" signal.booleanGets whether this NavigationPage can be popped from navigation stack.@Nullable WidgetgetChild()Gets the child widget ofself.static MemoryLayoutThe memory layout of the native struct.@Nullable StringgetTag()Gets the tag ofself.getTitle()Gets the title ofself.static @Nullable TypegetType()Get the GType of the NavigationPage classprotected voidhidden()Called when the navigation view transition has been completed and the page is fully hidden.protected voidhiding()Called when the page starts hiding at the beginning of the navigation view transition.onHidden(NavigationPage.HiddenCallback handler) Emitted when the navigation view transition has been completed and the page is fully hidden.onHiding(NavigationPage.HidingCallback handler) Emitted when the page starts hiding at the beginning of the navigation view transition.onShowing(NavigationPage.ShowingCallback handler) Emitted when the page shows at the beginning of the navigation view transition.onShown(NavigationPage.ShownCallback handler) Emitted when the navigation view transition has been completed and the page is fully shown.voidsetCanPop(boolean canPop) Sets whether this NavigationPage can be popped from navigation stack.voidSets the child widget ofself.voidSets the tag forself.voidSets the title ofself.protected voidshowing()Called when the page shows at the beginning of the navigation view transition.protected voidshown()Called when the navigation view transition has been completed and the page is fully shown.static NavigationPageCreates a newAdwNavigationPagewith provided tag.Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, 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
getBuildableId
-
Constructor Details
-
NavigationPage
Create a NavigationPage proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
NavigationPage
-
NavigationPage
public NavigationPage()Creates a new NavigationPage.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
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. -
withTag
Creates a newAdwNavigationPagewith provided tag.- Parameters:
child- the child widgettitle- the page titletag- the page tag- Returns:
- the new created
AdwNavigationPage - Since:
- 1.4
-
getCanPop
public boolean getCanPop()Gets whether this NavigationPage can be popped from navigation stack.- Returns:
- whether the page can be popped from navigation stack
- Since:
- 1.4
-
getChild
Gets the child widget ofself.- Returns:
- the child widget of this NavigationPage
- Since:
- 1.4
-
getTag
-
getTitle
Gets the title ofself.- Returns:
- the title of this NavigationPage
- Since:
- 1.4
-
setCanPop
public void setCanPop(boolean canPop) Sets whether this NavigationPage can be popped from navigation stack.Set it to
FALSEto disable shortcuts and gestures, as well as remove the back button fromHeaderBar.Manually calling
NavigationView.pop()or using thenavigation.popaction will still work.See
HeaderBar:show-back-buttonfor removing only the back button, but not shortcuts.- Parameters:
canPop- whether the page can be popped from navigation stack- Since:
- 1.4
-
setChild
Sets the child widget ofself.- Parameters:
child- the child widget- Since:
- 1.4
-
setTag
Sets the tag forself.The tag can be used to retrieve the page with
NavigationView.findPage(java.lang.String), as well as withNavigationView.pushByTag(java.lang.String),NavigationView.popToTag(java.lang.String)orNavigationView.replaceWithTags(java.lang.String[]).Tags must be unique within each
NavigationView.The tag also must be set to use the
navigation.pushaction.- Parameters:
tag- the page tag- Since:
- 1.4
-
setTitle
-
hiding
protected void hiding()Called when the page starts hiding at the beginning of the navigation view transition.- Since:
- 1.4
-
showing
protected void showing()Called when the page shows at the beginning of the navigation view transition.- Since:
- 1.4
-
shown
protected void shown()Called when the navigation view transition has been completed and the page is fully shown.- Since:
- 1.4
-
emitHidden
public void emitHidden()Emits the "hidden" signal. SeeonHidden(org.gnome.adw.NavigationPage.HiddenCallback). -
emitHiding
public void emitHiding()Emits the "hiding" signal. SeeonHiding(org.gnome.adw.NavigationPage.HidingCallback). -
emitShowing
public void emitShowing()Emits the "showing" signal. SeeonShowing(org.gnome.adw.NavigationPage.ShowingCallback). -
emitShown
public void emitShown()Emits the "shown" signal. SeeonShown(org.gnome.adw.NavigationPage.ShownCallback). -
builder
ANavigationPage.Builderobject constructs aNavigationPagewith the specified properties. Use the variousset...()methods to set properties, and finish construction withNavigationPage.Builder.build().- Returns:
- the builder object
-