Class SwitchRow

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

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

A ListBoxRow used to represent two states.

switch-row

The AdwSwitchRow widget contains a Switch that allows the user to select between two states: "on" or "off". When activated, the row will invert its active state.

The user can control the switch by activating the row or by dragging on the switch handle.

See Switch for details.

Example of an AdwSwitchRow UI definition:

<object class="AdwSwitchRow">
  <property name="title" translatable="yes">Switch Row</property>
  <signal name="notify::active" handler="switch_row_notify_active_cb"/>
</object>

The SwitchRow:active property should be connected to in order to monitor changes to the active state.

Accessibility

AdwSwitchRow uses the Gtk.AccessibleRole.switch role.

Since:
1.4
  • Constructor Details

    • SwitchRow

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

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

    • getType

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

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

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

      public boolean getActive()
      Gets whether this SwitchRow is in its "on" or "off" position.
      Returns:
      whether this SwitchRow is active or not
      Since:
      1.4
    • setActive

      public void setActive(boolean isActive)
      Sets whether this SwitchRow is in its "on" or "off" position
      Parameters:
      isActive - whether this SwitchRow should be active
      Since:
      1.4
    • builder

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