Class TabPage.Builder<B extends TabPage.Builder<B>>

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

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

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

      public B setIcon(Icon icon)

      The icon of the page.

      TabBar and TabOverview display the icon next to the title, unless TabPage:loading is set to TRUE.

      AdwTabBar also won't show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.

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

      public B setIndicatorActivatable(boolean indicatorActivatable)

      Whether the indicator icon is activatable.

      If set to TRUE, TabView::indicator-activated will be emitted when the indicator icon is clicked.

      If TabPage:indicator-icon is not set, does nothing.

      Parameters:
      indicatorActivatable - the value for the indicator-activatable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIndicatorIcon

      public B setIndicatorIcon(Icon indicatorIcon)

      An indicator icon for the page.

      A common use case is an audio or camera indicator in a web browser.

      TabBar will show it at the beginning of the tab, alongside icon representing TabPage:icon or loading spinner.

      If the page is pinned, the indicator will be shown instead of icon or spinner.

      TabOverview will show it at the at the top part of the thumbnail.

      TabPage:indicator-tooltip can be used to set the tooltip on the indicator icon.

      If TabPage:indicator-activatable is set to TRUE, the indicator icon can act as a button.

      Parameters:
      indicatorIcon - the value for the indicator-icon property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIndicatorTooltip

      public B setIndicatorTooltip(String indicatorTooltip)

      The tooltip of the indicator icon.

      The tooltip can be marked up with the Pango text markup language.

      See TabPage:indicator-icon.

      Parameters:
      indicatorTooltip - the value for the indicator-tooltip property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.2
    • setKeyword

      public B setKeyword(String keyword)

      The search keyboard of the page.

      TabOverview can search pages by their keywords in addition to their titles and tooltips.

      Keywords allow to include e.g. page URLs into tab search in a web browser.

      Parameters:
      keyword - the value for the keyword property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setLiveThumbnail

      public B setLiveThumbnail(boolean liveThumbnail)

      Whether to enable live thumbnail for this page.

      When set to TRUE, the page's thumbnail in TabOverview will update immediately when the page is redrawn or resized.

      If it's set to FALSE, the thumbnail will only be live when the page is selected, and otherwise it will be static and will only update when TabPage.invalidateThumbnail() or TabView.invalidateThumbnails() is called.

      Parameters:
      liveThumbnail - the value for the live-thumbnail property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setLoading

      public B setLoading(boolean loading)

      Whether the page is loading.

      If set to TRUE, TabBar and TabOverview will display a spinner in place of icon.

      If the page is pinned and TabPage:indicator-icon is set, loading status will not be visible with AdwTabBar.

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

      public B setNeedsAttention(boolean needsAttention)

      Whether the page needs attention.

      TabBar will display a line under the tab representing the page if set to TRUE. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.

      TabOverview will display a dot in the corner of the thumbnail if set to TRUE.

      TabButton will display a dot if any of the pages that aren't selected have this property set to TRUE.

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

      public B setParent(TabPage parent)

      The parent page of the page.

      See TabView.addPage(Widget, TabPage) and TabView.closePage(TabPage).

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

      public B setThumbnailXalign(float thumbnailXalign)

      The horizontal alignment of the page thumbnail.

      If the page is so wide that TabOverview can't display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.

      For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.

      The default horizontal alignment is 0.

      Parameters:
      thumbnailXalign - the value for the thumbnail-xalign property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setThumbnailYalign

      public B setThumbnailYalign(float thumbnailYalign)

      The vertical alignment of the page thumbnail.

      If the page is so tall that TabOverview can't display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.

      For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.

      The default vertical alignment is 0.

      Parameters:
      thumbnailYalign - the value for the thumbnail-yalign property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.3
    • setTitle

      public B setTitle(String title)

      The title of the page.

      TabBar will display it in the center of the tab unless it's pinned, and will use it as a tooltip unless TabPage:tooltip is set.

      TabOverview will display it below the thumbnail unless it's pinned, or inside the card otherwise, and will use it as a tooltip unless TabPage:tooltip is set.

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

      public B setTooltip(String tooltip)

      The tooltip of the page.

      The tooltip can be marked up with the Pango text markup language.

      If not set, TabBar and TabOverview will use TabPage:title as a tooltip instead.

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