Class ActionRow

All Implemented Interfaces:
Accessible, Actionable, Buildable, ConstraintTarget, Proxy
Direct Known Subclasses:
ComboRow, SpinRow, SwitchRow

@Generated("org.javagi.JavaGI") public class ActionRow extends PreferencesRow implements Accessible, Actionable, Buildable, ConstraintTarget

A ListBoxRow used to present actions.

action-row

The AdwActionRow widget can have a title, a subtitle and an icon. The row can receive additional widgets at its end, or prefix widgets at its start.

It is convenient to present a preference and its related actions.

AdwActionRow is unactivatable by default, giving it an activatable widget will automatically make it activatable, but unsetting it won't change the row's activatability.

AdwActionRow as GtkBuildable

The AdwActionRow implementation of the Buildable interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a element.

CSS nodes

AdwActionRow has a main CSS node with name row.

It contains the subnode box.header for its main horizontal box, and box.title for the vertical box containing the title and subtitle labels.

It contains subnodes label.title and label.subtitle representing respectively the title label and subtitle label.

Style classes

AdwActionRow can use the .property style class to emphasize the row subtitle instead of the row title, which is useful for displaying read-only properties.

property-row

When used together with the .monospace style class, only the subtitle becomes monospace, not the title or any extra widgets.

  • Constructor Details

    • ActionRow

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

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

    • getType

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

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

      protected ActionRow 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 PreferencesRow
      Returns:
      the instance as if it were its parent type
    • activate

      public void activate()
      Activates self.
      Overrides:
      activate in class ListBoxRow
    • addPrefix

      public void addPrefix(Widget widget)
      Adds a prefix widget to self.
      Parameters:
      widget - a widget
    • addSuffix

      public void addSuffix(Widget widget)
      Adds a suffix widget to self.
      Parameters:
      widget - a widget
    • getActivatableWidget

      public @Nullable Widget getActivatableWidget()
      Gets the widget activated when this ActionRow is activated.
      Returns:
      the activatable widget for this ActionRow
    • getIconName

      @Deprecated public @Nullable String getIconName()
      Deprecated.
      Use addPrefix(Widget) to add an icon.
      Gets the icon name for self.
      Returns:
      the icon name for this ActionRow
    • getSubtitle

      public @Nullable String getSubtitle()
      Gets the subtitle for self.
      Returns:
      the subtitle for this ActionRow
    • getSubtitleLines

      public int getSubtitleLines()
      Gets the number of lines at the end of which the subtitle label will be ellipsized.
      Returns:
      the number of lines at the end of which the subtitle label will be ellipsized
    • getSubtitleSelectable

      public boolean getSubtitleSelectable()
      Gets whether the user can copy the subtitle from the label
      Returns:
      whether the user can copy the subtitle from the label
      Since:
      1.3
    • getTitleLines

      public int getTitleLines()
      Gets the number of lines at the end of which the title label will be ellipsized.
      Returns:
      the number of lines at the end of which the title label will be ellipsized
    • remove

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

      public void setActivatableWidget(@Nullable Widget widget)

      Sets the widget to activate when this ActionRow is activated.

      The row can be activated either by clicking on it, calling activate(), or via mnemonics in the title. See the PreferencesRow:use-underline property to enable mnemonics.

      The target widget will be activated by emitting the Gtk.Widget::mnemonic-activate signal on it.

      Parameters:
      widget - the target widget
    • setIconName

      @Deprecated public void setIconName(@Nullable String iconName)
      Deprecated.
      Use addPrefix(Widget) to add an icon.
      Sets the icon name for self.
      Parameters:
      iconName - the icon name
    • setSubtitle

      public void setSubtitle(String subtitle)

      Sets the subtitle for self.

      The subtitle is interpreted as Pango markup unless PreferencesRow:use-markup is set to FALSE.

      Parameters:
      subtitle - the subtitle
    • setSubtitleLines

      public void setSubtitleLines(int subtitleLines)

      Sets the number of lines at the end of which the subtitle label will be ellipsized.

      If the value is 0, the number of lines won't be limited.

      Parameters:
      subtitleLines - the number of lines at the end of which the subtitle label will be ellipsized
    • setSubtitleSelectable

      public void setSubtitleSelectable(boolean subtitleSelectable)

      Sets whether the user can copy the subtitle from the label

      See also Gtk.Label:selectable.

      Parameters:
      subtitleSelectable - TRUE if the user can copy the subtitle from the label
      Since:
      1.3
    • setTitleLines

      public void setTitleLines(int titleLines)

      Sets the number of lines at the end of which the title label will be ellipsized.

      If the value is 0, the number of lines won't be limited.

      Parameters:
      titleLines - the number of lines at the end of which the title label will be ellipsized
    • onActivated

      This signal is emitted after the row has been activated.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitActivated

      public void emitActivated()
      Emits the "activated" signal. See onActivated(ActionRow.ActivatedCallback).
    • builder

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