Class BindingGroup

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class BindingGroup extends GObject

GBindingGroup can be used to bind multiple properties from an object collectively.

Use the various methods to bind properties from a single source object to multiple destination objects. Properties can be bound bidirectionally and are connected when the source object is set with setSource(GObject).

Since:
2.72
  • Constructor Details

    • BindingGroup

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

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

    • getType

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

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

      protected BindingGroup 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 GObject
      Returns:
      the instance as if it were its parent type
    • bind

      public void bind(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags)

      Creates a binding between sourceProperty on the source object and targetProperty on target. Whenever the sourceProperty is changed the targetProperty is updated using the same value. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      See g_object_bind_property() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      Since:
      2.72
    • bind

      public void bind(String sourceProperty, GObject target, String targetProperty, BindingFlags... flags)

      Creates a binding between sourceProperty on the source object and targetProperty on target. Whenever the sourceProperty is changed the targetProperty is updated using the same value. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      See g_object_bind_property() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      Since:
      2.72
    • bindFull

      public void bindFull(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable BindingTransformFunc transformTo, @Nullable BindingTransformFunc transformFrom)

      Creates a binding between sourceProperty on the source object and targetProperty on target, allowing you to set the transformation functions to be used by the binding. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      See g_object_bind_property_full() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      transformTo - the transformation function from the source object to the target, or null to use the default
      transformFrom - the transformation function from the target to the source object, or null to use the default
      Since:
      2.72
    • bindFull

      public void bindFull(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable BindingTransformFunc transformTo, @Nullable BindingTransformFunc transformFrom)

      Creates a binding between sourceProperty on the source object and targetProperty on target, allowing you to set the transformation functions to be used by the binding. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      See g_object_bind_property_full() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      transformTo - the transformation function from the source object to the target, or null to use the default
      transformFrom - the transformation function from the target to the source object, or null to use the default
      Since:
      2.72
    • bindWithClosures

      public void bindWithClosures(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable Closure transformTo, @Nullable Closure transformFrom)

      Creates a binding between sourceProperty on the source object and targetProperty on target, allowing you to set the transformation functions to be used by the binding. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      This function is the language bindings friendly version of g_binding_group_bind_property_full(), using GClosures instead of function pointers.

      See g_object_bind_property_with_closures() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      transformTo - a GClosure wrapping the transformation function from the source object to the target, or null to use the default
      transformFrom - a GClosure wrapping the transformation function from the target to the source object, or null to use the default
      Since:
      2.72
    • bindWithClosures

      public void bindWithClosures(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable Closure transformTo, @Nullable Closure transformFrom)

      Creates a binding between sourceProperty on the source object and targetProperty on target, allowing you to set the transformation functions to be used by the binding. The binding flag BindingFlags.SYNC_CREATE is automatically specified.

      This function is the language bindings friendly version of g_binding_group_bind_property_full(), using GClosures instead of function pointers.

      See g_object_bind_property_with_closures() for more information.

      Parameters:
      sourceProperty - the property on the source to bind
      target - the target GObject
      targetProperty - the property on target to bind
      flags - the flags used to create the GBinding
      transformTo - a GClosure wrapping the transformation function from the source object to the target, or null to use the default
      transformFrom - a GClosure wrapping the transformation function from the target to the source object, or null to use the default
      Since:
      2.72
    • dupSource

      public @Nullable GObject dupSource()
      Gets the source object used for binding properties.
      Returns:
      a GObject or null.
      Since:
      2.72
    • setSource

      public void setSource(@Nullable GObject source)

      Sets source as the source object used for creating property bindings. If there is already a source object all bindings from it will be removed.

      Note that all properties that have been bound must exist on source.

      Parameters:
      source - the source GObject, or null to clear it
      Since:
      2.72
    • builder

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