Class CheckButton.Builder<B extends CheckButton.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, Actionable.Builder<B>, BuilderInterface
Enclosing class:
CheckButton

public static class CheckButton.Builder<B extends CheckButton.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Actionable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public CheckButton build()
      Finish building the CheckButton object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to CheckButton.
      Overrides:
      build in class Widget.Builder<B extends CheckButton.Builder<B>>
      Returns:
      a new instance of CheckButton with the properties that were set in the Builder object.
    • setActive

      public B setActive(boolean active)

      If the check button is active.

      Setting active to true will add the :checked: state to both the check button and the indicator CSS node.

      Parameters:
      active - the value for the active property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setChild

      public B setChild(Widget child)
      The child widget.
      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.8
    • setGroup

      public B setGroup(CheckButton group)
      The check button whose group this widget belongs to.
      Parameters:
      group - the value for the group property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInconsistent

      public B setInconsistent(boolean inconsistent)

      If the check button is in an “in between” state.

      The inconsistent state only affects visual appearance, not the semantics of the button.

      Parameters:
      inconsistent - the value for the inconsistent property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLabel

      public B setLabel(String label)
      Text of the label inside the check button, if it contains a label widget.
      Parameters:
      label - the value for the label property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseUnderline

      public B setUseUnderline(boolean useUnderline)
      If set, an underline in the text indicates that the following character is to be used as mnemonic.
      Parameters:
      useUnderline - the value for the use-underline property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onActivate

      public B onActivate(CheckButton.ActivateCallback handler)

      Emitted to when the check button is activated.

      The ::activate signal on GtkCheckButton is an action signal and emitting it causes the button to animate press then release.

      Applications should never connect to this signal, but use the Gtk.CheckButton::toggled signal.

      The default bindings for this signal are all forms of the and Enter keys.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.2
      See Also:
    • onToggled

      public B onToggled(CheckButton.ToggledCallback handler)
      Emitted when the buttons's Gtk.CheckButton:active property changes.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: