Package io.github.jwharm.javagi.gobject
Class BindingBuilder<S,T>
java.lang.Object
io.github.jwharm.javagi.gobject.BindingBuilder<S,T>
- Type Parameters:
S
- type of the source propertyT
- type of the target property
Builder class to setup a GObject property binding.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a BindingBuilder to construct a GObject property binding.BindingBuilder
(GObject source, String sourceProperty, GObject target, String targetProperty) Create a BindingBuilder to construct a GObject property binding. -
Method Summary
Modifier and TypeMethodDescriptionBidirectional binding; if either the property of the source or the property of the target changes, the other is updated.build()
Create the property binding.If the two properties being bound are booleans, setting one totrue
will result in the other being set tofalse
and vice versa.Set the sourceGObject
sourceProperty
(String sourceProperty) Set the property on the source object to bindSynchronize the values of the source and target properties when creating the binding; the direction of the synchronization is always from the source to the target.Set the targetGObject
targetProperty
(String targetProperty) the property ontarget
to bindtransformFrom
(Function<T, S> transformFrom) Set the transformation function from thetarget
to this GObject, ornull
to use the defaulttransformTo
(Function<S, T> transformTo) Set the transformation function from this GObject to thetarget
, ornull
to use the default.
-
Constructor Details
-
BindingBuilder
public BindingBuilder()Create a BindingBuilder to construct a GObject property binding.- See Also:
-
BindingBuilder
Create a BindingBuilder to construct a GObject property binding.- Parameters:
source
- the sourceGObject
sourceProperty
- the property on the source object to bindtarget
- the targetGObject
targetProperty
- the property ontarget
to bind- See Also:
-
-
Method Details
-
source
Set the sourceGObject
-
sourceProperty
Set the property on the source object to bind -
target
Set the targetGObject
-
targetProperty
the property ontarget
to bind -
bidirectional
Bidirectional binding; if either the property of the source or the property of the target changes, the other is updated. -
syncCreate
Synchronize the values of the source and target properties when creating the binding; the direction of the synchronization is always from the source to the target. -
invertBoolean
If the two properties being bound are booleans, setting one totrue
will result in the other being set tofalse
and vice versa. This flag will only work for boolean properties, and cannot be used when passing custom transformation functions. -
transformTo
-
transformFrom
-
build
Create the property binding.
-