Class TabPage

All Implemented Interfaces:
Accessible, Proxy

@Generated("org.javagi.JavaGI") public final class TabPage extends GObject implements Accessible
An auxiliary class used by TabView.
  • Constructor Details

    • TabPage

      public TabPage(MemorySegment address)
      Create a TabPage instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TabPage

      public TabPage()
      Create a new TabPage.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TabPage class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TabPage asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getChild

      public Widget getChild()
      Gets the child of self.
      Returns:
      the child of this TabPage
    • getIcon

      public @Nullable Icon getIcon()
      Gets the icon of self.
      Returns:
      the icon of this TabPage
    • getIndicatorActivatable

      public boolean getIndicatorActivatable()
      Gets whether the indicator of this TabPage is activatable.
      Returns:
      whether the indicator is activatable
    • getIndicatorIcon

      public @Nullable Icon getIndicatorIcon()
      Gets the indicator icon of self.
      Returns:
      the indicator icon of this TabPage
    • getIndicatorTooltip

      public String getIndicatorTooltip()
      Gets the tooltip of the indicator icon of self.
      Returns:
      the indicator tooltip of this TabPage
      Since:
      1.2
    • getKeyword

      public @Nullable String getKeyword()
      Gets the search keyword of self.
      Returns:
      the search keyword of this TabPage
      Since:
      1.3
    • getLiveThumbnail

      public boolean getLiveThumbnail()
      Gets whether to live thumbnail is enabled self.
      Returns:
      whether live thumbnail is enabled
      Since:
      1.3
    • getLoading

      public boolean getLoading()
      Gets whether this TabPage is loading.
      Returns:
      whether this TabPage is loading
    • getNeedsAttention

      public boolean getNeedsAttention()
      Gets whether this TabPage needs attention.
      Returns:
      whether this TabPage needs attention
    • getParent

      public @Nullable TabPage getParent()

      Gets the parent page of self.

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

      Returns:
      the parent page
    • getPinned

      public boolean getPinned()

      Gets whether this TabPage is pinned.

      See TabView.setPagePinned(TabPage, boolean).

      Returns:
      whether this TabPage is pinned
    • getSelected

      public boolean getSelected()
      Gets whether this TabPage is selected.
      Returns:
      whether this TabPage is selected
    • getThumbnailXalign

      public float getThumbnailXalign()
      Gets the horizontal alignment of the thumbnail for self.
      Returns:
      the horizontal alignment
      Since:
      1.3
    • getThumbnailYalign

      public float getThumbnailYalign()
      Gets the vertical alignment of the thumbnail for self.
      Returns:
      the vertical alignment
      Since:
      1.3
    • getTitle

      public String getTitle()
      Gets the title of self.
      Returns:
      the title of this TabPage
    • getTooltip

      public @Nullable String getTooltip()
      Gets the tooltip of self.
      Returns:
      the tooltip of this TabPage
    • invalidateThumbnail

      public void invalidateThumbnail()

      Invalidates thumbnail for self.

      If an TabOverview is open, the thumbnail representing this TabPage will be immediately updated. Otherwise it will be update when opening the overview.

      Does nothing if TabPage:live-thumbnail is set to TRUE.

      See also TabView.invalidateThumbnails().

      Since:
      1.3
    • setIcon

      public void setIcon(@Nullable Icon icon)

      Sets the icon of self.

      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 icon of this TabPage
    • setIndicatorActivatable

      public void setIndicatorActivatable(boolean activatable)

      Sets whether the indicator of this TabPage 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:
      activatable - whether the indicator is activatable
    • setIndicatorIcon

      public void setIndicatorIcon(@Nullable Icon indicatorIcon)

      Sets the indicator icon of self.

      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 indicator icon of this TabPage
    • setIndicatorTooltip

      public void setIndicatorTooltip(String tooltip)

      Sets the tooltip of the indicator icon of self.

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

      See TabPage:indicator-icon.

      Parameters:
      tooltip - the indicator tooltip of this TabPage
      Since:
      1.2
    • setKeyword

      public void setKeyword(String keyword)

      Sets the search keyword for self.

      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 search keyword
      Since:
      1.3
    • setLiveThumbnail

      public void setLiveThumbnail(boolean liveThumbnail)

      Sets whether to enable live thumbnail for self.

      When set to TRUE, self's thumbnail in TabOverview will update immediately when this TabPage is redrawn or resized.

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

      Parameters:
      liveThumbnail - whether to enable live thumbnail
      Since:
      1.3
    • setLoading

      public void setLoading(boolean loading)

      Sets whether this TabPage 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 - whether this TabPage is loading
    • setNeedsAttention

      public void setNeedsAttention(boolean needsAttention)

      Sets whether this TabPage 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 TabPage:needs-attention set to TRUE.

      Parameters:
      needsAttention - whether this TabPage needs attention
    • setThumbnailXalign

      public void setThumbnailXalign(float xalign)

      Sets the horizontal alignment of the thumbnail for self.

      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:
      xalign - the new value
      Since:
      1.3
    • setThumbnailYalign

      public void setThumbnailYalign(float yalign)

      Sets the vertical alignment of the thumbnail for self.

      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:
      yalign - the new value
      Since:
      1.3
    • setTitle

      public void setTitle(String title)

      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.

      Sets the title of self.

      Parameters:
      title - the title of this TabPage
    • setTooltip

      public void setTooltip(String tooltip)

      Sets the tooltip of self.

      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 tooltip of this TabPage
    • builder

      public static TabPage.Builder<? extends TabPage.Builder> builder()
      A TabPage.Builder object constructs a TabPage with the specified properties. Use the various set...() methods to set properties, and finish construction with TabPage.Builder.build().
      Returns:
      the builder object