Class ToggleGroup.Builder<B extends ToggleGroup.Builder<B>>

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

public static class ToggleGroup.Builder<B extends ToggleGroup.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Orientable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
1.7
  • Constructor Details

    • Builder

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

    • build

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

      public B setActive(int active)

      The index of the active toggle.

      Setting the index to a larger value than the number of toggles in the group unsets the current active toggle.

      If no toggle is active, the property will be set to Gtk.INVALID_LIST_POSITION.

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

      public B setActiveName(String activeName)

      The name of the active toggle.

      The name can be set via Toggle:name. If the currently active toggle doesn't have a name, the property will be set to NULL.

      Set it to NULL to unset the current active toggle.

      Parameters:
      activeName - the value for the active-name property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setCanShrink

      public B setCanShrink(boolean canShrink)

      Whether the toggles can be smaller than the natural size of their contents.

      If set to TRUE, the toggle labels will ellipsize.

      See Gtk.Button:can-shrink.

      Parameters:
      canShrink - the value for the can-shrink property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setHomogeneous

      public B setHomogeneous(boolean homogeneous)
      Whether all toggles take the same size.
      Parameters:
      homogeneous - the value for the homogeneous property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7