Class ToggleButton.Builder<B extends ToggleButton.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:
ToggleButton

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

      public B setActive(boolean active)
      If the toggle button should be pressed in.
      Parameters:
      active - the value for the active property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGroup

      public B setGroup(ToggleButton group)
      The toggle 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
    • onToggled

      public B onToggled(ToggleButton.ToggledCallback handler)
      Emitted whenever the GtkToggleButton's state is changed.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: