Package org.javagi.gobject
Class BindingBuilder<S,T>
java.lang.Object
org.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
ConstructorsConstructorDescriptionCreate 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 totruewill result in the other being set tofalseand vice versa.Set the sourceGObjectsourceProperty(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 targetGObjecttargetProperty(String targetProperty) the property ontargetto bindtransformFrom(@Nullable Function<T, S> transformFrom) Set the transformation function from thetargetto this GObject, ornullto use the defaulttransformTo(@Nullable Function<S, T> transformTo) Set the transformation function from this GObject to thetarget, ornullto 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 sourceGObjectsourceProperty- the property on the source object to bindtarget- the targetGObjecttargetProperty- the property ontargetto 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 ontargetto 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 totruewill result in the other being set tofalseand 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.
-