Class NavigationPage
- All Implemented Interfaces:
Proxy
,Accessible
,Buildable
,ConstraintTarget
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
NavigationPage.Builder<B extends NavigationPage.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theHiddenCallback
callback.static interface
Functional interface declaration of theHidingCallback
callback.static class
static interface
Functional interface declaration of theShowingCallback
callback.static interface
Functional interface declaration of theShownCallback
callback.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
-
Constructor Summary
ConstructorDescriptionNavigationPage
(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 NavigationPage
asParent()
Returns this instance as if it were its parent type.static NavigationPage.Builder
<? extends NavigationPage.Builder> builder()
ANavigationPage.Builder
object constructs aNavigationPage
with the specified properties.void
Emits the "hidden" signal.void
Emits the "hiding" signal.void
Emits the "showing" signal.void
Emits the "shown" signal.boolean
Gets whether this NavigationPage can be popped from navigation stack.getChild()
Gets the child widget of this NavigationPage.static MemoryLayout
The memory layout of the native struct.getTag()
Gets the tag of this NavigationPage.getTitle()
Gets the title of this NavigationPage.static Type
getType()
Get the GType of the NavigationPage classprotected void
hidden()
Called when the navigation view transition has been completed and the page is fully hidden.protected void
hiding()
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.void
setCanPop
(boolean canPop) Sets whether this NavigationPage can be popped from navigation stack.void
Sets the child widget of this NavigationPage.void
Sets the tag for this NavigationPage.void
Sets the title of this NavigationPage.protected void
showing()
Called when the page shows at the beginning of the navigation view transition.protected void
shown()
Called when the navigation view transition has been completed and the page is fully shown.static NavigationPage
Creates a newAdwNavigationPage
with 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, 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
-
Constructor Details
-
NavigationPage
Create a NavigationPage proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
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 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. -
withTag
Creates a newAdwNavigationPage
with provided tag.- Parameters:
child
- the child widgettitle
- the page titletag
- the page tag- Returns:
- the new created
AdwNavigationPage
-
getCanPop
public boolean getCanPop()Gets whether this NavigationPage can be popped from navigation stack.- Returns:
- whether the page can be popped from navigation stack
-
getChild
Gets the child widget of this NavigationPage.- Returns:
- the child widget of this NavigationPage
-
getTag
-
getTitle
Gets the title of this NavigationPage.- Returns:
- the title of this NavigationPage
-
setCanPop
public void setCanPop(boolean canPop) Sets whether this NavigationPage can be popped from navigation stack.Set it to
FALSE
to disable shortcuts and gestures, as well as remove the back button fromHeaderBar
.Manually calling
NavigationView.pop()
or using thenavigation.pop
action will still work.See
HeaderBar:show-back-button
for removing only the back button, but not shortcuts.- Parameters:
canPop
- whether the page can be popped from navigation stack
-
setChild
Sets the child widget of this NavigationPage.- Parameters:
child
- the child widget
-
setTag
Sets the tag for this NavigationPage.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.push
action.- Parameters:
tag
- the page tag
-
setTitle
-
hiding
protected void hiding()Called when the page starts hiding at the beginning of the navigation view transition. -
showing
protected void showing()Called when the page shows at the beginning of the navigation view transition. -
shown
protected void shown()Called when the navigation view transition has been completed and the page is fully shown. -
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.Builder
object constructs aNavigationPage
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withNavigationPage.Builder.build()
.
-