Class ViewStackPage.Builder<B extends ViewStackPage.Builder<B>>

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

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

    • Builder

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

    • build

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

      public B setBadgeNumber(int badgeNumber)

      The badge number for this page.

      ViewSwitcher can display it as a badge next to the page icon. It is commonly used to display a number of unread items within the page.

      It can be used together with ViewStack{age}:needs-attention.

      Parameters:
      badgeNumber - the value for the badge-number property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setChild

      public B setChild(Widget child)
      The stack child to which the page belongs.
      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIconName

      public B setIconName(String iconName)
      The icon name of the child page.
      Parameters:
      iconName - the value for the icon-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setName

      public B setName(String name)
      The name of the child page.
      Parameters:
      name - the value for the name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setNeedsAttention

      public B setNeedsAttention(boolean needsAttention)

      Whether the page requires the user attention.

      ViewSwitcher will display it as a dot next to the page icon.

      Parameters:
      needsAttention - the value for the needs-attention property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSectionTitle

      public B setSectionTitle(String sectionTitle)

      Section title for this page.

      Does nothing unless ViewStackPage:starts-section is set.

      Parameters:
      sectionTitle - the value for the section-title property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setStartsSection

      public B setStartsSection(boolean startsSection)

      Whether this page starts a section.

      If set to TRUE, ViewStack:pages will have a section starting from this page.

      If ViewStackPage:section-title is set, it should be used as a title for the section.

      Parameters:
      startsSection - the value for the starts-section property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.9
    • setTitle

      public B setTitle(String title)
      The title of the child page.
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseUnderline

      public B setUseUnderline(boolean useUnderline)
      Whether an embedded underline in the title indicates a mnemonic.
      Parameters:
      useUnderline - the value for the use-underline property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVisible

      public B setVisible(boolean visible)

      Whether this page is visible.

      This is independent from the Gtk.Widget:visible property of ViewStackPage:child.

      Parameters:
      visible - the value for the visible property
      Returns:
      the Builder instance is returned, to allow method chaining