Class BindingGroup
- All Implemented Interfaces:
Proxy
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(org.gnome.gobject.GObject)
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
BindingGroup.Builder<B extends BindingGroup.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGBindingGroup
.BindingGroup
(MemorySegment address) Create a BindingGroup proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected BindingGroup
asParent()
Returns this instance as if it were its parent type.void
Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
.void
bind
(String sourceProperty, GObject target, String targetProperty, BindingFlags... flags) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
.void
bindFull
(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable BindingTransformFunc transformTo, @Nullable BindingTransformFunc transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding.void
bindFull
(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable BindingTransformFunc transformTo, @Nullable BindingTransformFunc transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding.void
bindWithClosures
(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable Closure transformTo, @Nullable Closure transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding.void
bindWithClosures
(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable Closure transformTo, @Nullable Closure transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding.static BindingGroup.Builder
<? extends BindingGroup.Builder> builder()
ABindingGroup.Builder
object constructs aBindingGroup
with the specified properties.Gets the source object used for binding properties.static Type
getType()
Get the GType of the BindingGroup classvoid
Setssource
as the source object used for creating property bindings.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
BindingGroup
Create a BindingGroup proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
BindingGroup
public BindingGroup()Creates a newGBindingGroup
.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
bind
public void bind(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
. Whenever thesourceProperty
is changed thetargetProperty
is updated using the same value. The binding flagBindingFlags.SYNC_CREATE
is automatically specified.See g_object_bind_property() for more information.
- Parameters:
sourceProperty
- the property on the source to bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
-
bind
public void bind(String sourceProperty, GObject target, String targetProperty, BindingFlags... flags) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
. Whenever thesourceProperty
is changed thetargetProperty
is updated using the same value. The binding flagBindingFlags.SYNC_CREATE
is automatically specified.See g_object_bind_property() for more information.
- Parameters:
sourceProperty
- the property on the source to bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
-
bindFull
public void bindFull(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable @Nullable BindingTransformFunc transformTo, @Nullable @Nullable BindingTransformFunc transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding. The binding flagBindingFlags.SYNC_CREATE
is automatically specified.See g_object_bind_property_full() for more information.
- Parameters:
sourceProperty
- the property on the source to bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
transformTo
- the transformation function from the source object to thetarget
, ornull
to use the defaulttransformFrom
- the transformation function from thetarget
to the source object, ornull
to use the default
-
bindFull
public void bindFull(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable @Nullable BindingTransformFunc transformTo, @Nullable @Nullable BindingTransformFunc transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding. The binding flagBindingFlags.SYNC_CREATE
is automatically specified.See g_object_bind_property_full() for more information.
- Parameters:
sourceProperty
- the property on the source to bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
transformTo
- the transformation function from the source object to thetarget
, ornull
to use the defaulttransformFrom
- the transformation function from thetarget
to the source object, ornull
to use the default
-
bindWithClosures
public void bindWithClosures(String sourceProperty, GObject target, String targetProperty, Set<BindingFlags> flags, @Nullable @Nullable Closure transformTo, @Nullable @Nullable Closure transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding. The binding flagBindingFlags.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 bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
transformTo
- aGClosure
wrapping the transformation function from the source object to thetarget
, ornull
to use the defaulttransformFrom
- aGClosure
wrapping the transformation function from thetarget
to the source object, ornull
to use the default
-
bindWithClosures
public void bindWithClosures(String sourceProperty, GObject target, String targetProperty, BindingFlags flags, @Nullable @Nullable Closure transformTo, @Nullable @Nullable Closure transformFrom) Creates a binding betweensourceProperty
on the source object andtargetProperty
ontarget
, allowing you to set the transformation functions to be used by the binding. The binding flagBindingFlags.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 bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bindflags
- the flags used to create theGBinding
transformTo
- aGClosure
wrapping the transformation function from the source object to thetarget
, ornull
to use the defaulttransformFrom
- aGClosure
wrapping the transformation function from thetarget
to the source object, ornull
to use the default
-
dupSource
Gets the source object used for binding properties.- Returns:
- a
GObject
ornull
.
-
setSource
Setssource
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 sourceGObject
, ornull
to clear it
-
builder
ABindingGroup.Builder
object constructs aBindingGroup
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withBindingGroup.Builder.build()
.
-