Class NavigationSplitView.Builder<B extends NavigationSplitView.Builder<B>>

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

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

      public B setCollapsed(boolean collapsed)

      Whether the split view is collapsed.

      When collapsed, the children are put inside an NavigationView, otherwise they are displayed side by side.

      The NavigationSplitView:show-content controls which child is visible while collapsed.

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

      public B setContent(NavigationPage content)
      The content widget.
      Parameters:
      content - the value for the content property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setMaxSidebarWidth

      public B setMaxSidebarWidth(double maxSidebarWidth)

      The maximum sidebar width.

      Maximum width is affected by NavigationSplitView:sidebar-width-unit.

      The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

      Parameters:
      maxSidebarWidth - the value for the max-sidebar-width property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setMinSidebarWidth

      public B setMinSidebarWidth(double minSidebarWidth)

      The minimum sidebar width.

      Minimum width is affected by NavigationSplitView:sidebar-width-unit.

      The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

      Parameters:
      minSidebarWidth - the value for the min-sidebar-width property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setShowContent

      public B setShowContent(boolean showContent)

      Determines the visible page when collapsed.

      If set to TRUE, the content widget will be the visible page when NavigationSplitView:collapsed is TRUE; otherwise the sidebar widget will be visible.

      If the split view is already collapsed, the visible page changes immediately.

      Parameters:
      showContent - the value for the show-content property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebar

      public B setSidebar(NavigationPage sidebar)
      The sidebar widget.
      Parameters:
      sidebar - the value for the sidebar property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebarPosition

      public B setSidebarPosition(PackType sidebarPosition)

      The sidebar position.

      If set to Gtk.PackType.start, the sidebar is displayed before the content, and the sidebar will be the root page when collapsed.

      If set to Gtk.PackType.end, the sidebar is displayed after the content, and the content will be the root page.

      Parameters:
      sidebarPosition - the value for the sidebar-position property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setSidebarWidthFraction

      public B setSidebarWidthFraction(double sidebarWidthFraction)

      The preferred sidebar width as a fraction of the total width.

      The preferred width is additionally limited by NavigationSplitView:min-sidebar-width and NavigationSplitView:max-sidebar-width.

      The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

      Parameters:
      sidebarWidthFraction - the value for the sidebar-width-fraction property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebarWidthUnit

      public B setSidebarWidthUnit(LengthUnit sidebarWidthUnit)

      The length unit for minimum and maximum sidebar widths.

      See NavigationSplitView:min-sidebar-width and NavigationSplitView:max-sidebar-width.

      Parameters:
      sidebarWidthUnit - the value for the sidebar-width-unit property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4