Class PropertyAction.Builder<B extends PropertyAction.Builder<B>>

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

public static class PropertyAction.Builder<B extends PropertyAction.Builder<B>> extends GObject.Builder<B> implements Action.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
2.38
  • Constructor Details

    • Builder

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

    • build

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

      public B setInvertBoolean(boolean invertBoolean)
      If true, the state of the action will be the negation of the property value, provided the property is boolean.
      Parameters:
      invertBoolean - the value for the invert-boolean property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.46
    • setName

      public B setName(String name)
      The name of the action. This is mostly meaningful for identifying the action once it has been added to a GActionMap.
      Parameters:
      name - the value for the name property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.38
    • setObject

      public B setObject(GObject object)

      The object to wrap a property on.

      The object must be a non-null GObject with properties.

      Parameters:
      object - the value for the object property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.38
    • setPropertyName

      public B setPropertyName(String propertyName)

      The name of the property to wrap on the object.

      The property must exist on the passed-in object and it must be readable and writable (and not construct-only).

      Parameters:
      propertyName - the value for the property-name property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.38