Class NavigationPage.Builder<B extends NavigationPage.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
NavigationPage

public static class NavigationPage.Builder<B extends NavigationPage.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
1.4
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public NavigationPage build()
      Finish building the NavigationPage object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to NavigationPage.
      Overrides:
      build in class Widget.Builder<B extends NavigationPage.Builder<B>>
      Returns:
      a new instance of NavigationPage with the properties that were set in the Builder object.
    • setCanPop

      public B setCanPop(boolean canPop)

      Whether the page can be popped from navigation stack.

      Set it to FALSE to disable shortcuts and gestures, as well as remove the back button from HeaderBar.

      Manually calling NavigationView.pop() or using the navigation.pop action will still work.

      See HeaderBar:show-back-button for removing only the back button, but not shortcuts.

      Parameters:
      canPop - the value for the can-pop property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setChild

      public B setChild(Widget child)
      The child widget.
      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setTag

      public B setTag(String tag)

      The page tag.

      The tag can be used to retrieve the page with NavigationView.findPage(String), as well as with NavigationView.pushByTag(String), NavigationView.popToTag(String) or NavigationView.replaceWithTags(String[]).

      Tags must be unique within each NavigationView.

      The tag also must be set to use the navigation.push action.

      Parameters:
      tag - the value for the tag property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setTitle

      public B setTitle(String title)

      The page title.

      It's displayed in HeaderBar instead of the window title, and used as the tooltip on the next page's back button, as well as by screen reader.

      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • onHidden

      public B onHidden(NavigationPage.HiddenCallback handler)

      Emitted when the navigation view transition has been completed and the page is fully hidden.

      It will always be preceded by NavigationPage::hiding or NavigationPage::showing.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also:
    • onHiding

      public B onHiding(NavigationPage.HidingCallback handler)

      Emitted when the page starts hiding at the beginning of the navigation view transition.

      It will always be followed by NavigationPage::hidden or NavigationPage::shown.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also:
    • onShowing

      public B onShowing(NavigationPage.ShowingCallback handler)

      Emitted when the page shows at the beginning of the navigation view transition.

      It will always be followed by NavigationPage::shown or NavigationPage::hidden.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also:
    • onShown

      public B onShown(NavigationPage.ShownCallback handler)

      Emitted when the navigation view transition has been completed and the page is fully shown.

      It will always be preceded by NavigationPage::showing or NavigationPage::hiding.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also: