Class ActionBar

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

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

Presents contextual actions.

An example GtkActionBar

GtkActionBar is expected to be displayed below the content and expand horizontally to fill the area.

It allows placing children at the start or the end. In addition, it contains an internal centered box which is centered with respect to the full width of the box, even if the children at either side take up different amounts of space.

GtkActionBar as GtkBuildable

The GtkActionBar implementation of the GtkBuildable interface supports adding children at the start or end sides by specifying “start” or “end” as the “type” attribute of a <child> element, or setting the center widget by specifying “center” value.

CSS nodes

actionbar
╰── revealer
    ╰── box
        ├── box.start
        │   ╰── [start children]
        ├── [center widget]
        ╰── box.end
            ╰── [end children]

A GtkActionBar's CSS node is called actionbar. It contains a revealer subnode, which contains a box subnode, which contains two box subnodes at the start and end of the action bar, with start and end style classes respectively, as well as a center node that represents the center child.

Each of the boxes contains children packed for that side.

  • Constructor Details

    • ActionBar

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

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

    • getType

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

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

      protected ActionBar 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
    • getCenterWidget

      public @Nullable Widget getCenterWidget()
      Retrieves the center bar widget of the bar.
      Returns:
      the center widget
    • getRevealed

      public boolean getRevealed()
      Gets whether the contents of the action bar are revealed.
      Returns:
      the current value of the Gtk.ActionBar:revealed property
    • packEnd

      public void packEnd(Widget child)
      Adds a child to the action bar, packed with reference to the end of the action bar.
      Parameters:
      child - the widget to be added
    • packStart

      public void packStart(Widget child)
      Adds a child to the action, packed with reference to the start of the action bar.
      Parameters:
      child - the widget to be added
    • remove

      public void remove(Widget child)
      Removes a child from the action bar.
      Parameters:
      child - the widget to be removed
    • setCenterWidget

      public void setCenterWidget(@Nullable Widget centerWidget)
      Sets the center widget for the action bar.
      Parameters:
      centerWidget - a widget to use for the center
    • setRevealed

      public void setRevealed(boolean revealed)

      Reveals or conceals the content of the action bar.

      Note: this does not show or hide the action bar in the Gtk.Widget:visible sense, so revealing has no effect if the action bar is hidden.

      Parameters:
      revealed - the new value for the property
    • builder

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