Class TabButton

All Implemented Interfaces:
Accessible, Actionable, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public final class TabButton extends Widget implements Accessible, Actionable, Buildable, ConstraintTarget

A button that displays the number of TabView pages.

tab-button

AdwTabButton is a button that displays the number of pages in a given AdwTabView, as well as whether one of the inactive pages needs attention.

It's intended to be used as a visible indicator when there's no visible tab bar, typically opening an TabOverview on click, e.g. via the overview.open action name:

<object class="AdwTabButton">
  <property name="view">view</property>
  <property name="action-name">overview.open</property>
</object>

CSS nodes

AdwTabButton has a main CSS node with name tabbutton.

Accessibility

AdwTabButton uses the Gtk.AccessibleRole.button role.

Since:
1.3
  • Constructor Details

    • TabButton

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

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

    • getType

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

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

      protected TabButton 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 Widget
      Returns:
      the instance as if it were its parent type
    • getView

      public @Nullable TabView getView()
      Gets the tab view this TabButton displays.
      Returns:
      the tab view
      Since:
      1.3
    • setView

      public void setView(@Nullable TabView view)
      Sets the tab view to display.
      Parameters:
      view - a tab view
      Since:
      1.3
    • onActivate

      Emitted to animate press then release.

      This is an action signal. Applications should never connect to this signal, but use the TabButton::clicked signal.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      1.3
      See Also:
    • emitActivate

      public void emitActivate()
      Emits the "activate" signal. See onActivate(TabButton.ActivateCallback).
    • onClicked

      Emitted when the button has been activated (pressed and released).
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      1.3
      See Also:
    • emitClicked

      public void emitClicked()
      Emits the "clicked" signal. See onClicked(TabButton.ClickedCallback).
    • builder

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