java.lang.Object
org.tentackle.bind.AbstractBinder
org.tentackle.fx.bind.DefaultFxComponentBinder
- All Implemented Interfaces:
Comparable<Binder>,Binder,FxComponentBinder
Binding Workhorse.
- Author:
- harald
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String[]Suffixes of component names to provide binding path alternatives.
Applications may change this list. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultFxComponentBinder(FxController controller) Creates a binder for a controller. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBinding(Binding binding) protected voidaddChangeableBinding(Binding changeableBinding) Adds a changeable binding.protected voidaddMandatoryBinding(Binding mandatoryBinding) Adds a mandatory binding.voidintbind()intintBinds including inherited bindables.intBinds including inherited components.protected intdoBind(BindingMember[] parents, String parentMemberPath, Class<?> parentClass, boolean declaredOnly) voidfireToModel(Binding binding, Object parent, Object viewValue) voidfireToView(Binding binding, Object parent, Object modelValue) getBinding(String bindingPath) getBinding(FxComponent component) Gets a binding by component.Gets the list of all bound components of this form.Gets the dynamically changeable bindings.Gets the controller bound by this binder.Gets the dynamically mandatory bindings.Gets the list of all unbound components of this form.booleanChecks whether some components are still unbound.removeBinding(String bindingPath) removeBinding(FxComponent component) Programmatically removes a binding from this view.voidRequest to update the changeable attribute of all dynamically mandatory components.voidRequest to update the mandatory attribute of all dynamically mandatory components.voidunbind()Methods inherited from class org.tentackle.bind.AbstractBinder
addToModelListener, addToViewListener, addValidationListener, compareTo, equals, fireValidated, getBindingProperty, getBindingProperty, getInstanceNumber, getToModelListeners, getToViewListeners, getValidationListeners, getValidationScope, hashCode, putBindingProperty, removeToModelListener, removeToViewListener, removeValidationListener, setValidationScopeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.bind.Binder
addToModelListener, addToViewListener, addValidationListener, fireValidated, getBindingProperty, getBindingProperty, getInstanceNumber, getToModelListeners, getToViewListeners, getValidationListeners, getValidationScope, putBindingProperty, removeToModelListener, removeToViewListener, removeValidationListener, setValidationScopeMethods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
bindingPathSuffixes
Suffixes of component names to provide binding path alternatives.
Applications may change this list.
-
-
Constructor Details
-
DefaultFxComponentBinder
Creates a binder for a controller.- Parameters:
controller- the controller to bind
-
-
Method Details
-
getController
Description copied from interface:FxComponentBinderGets the controller bound by this binder.- Specified by:
getControllerin interfaceFxComponentBinder- Returns:
- the controller
-
fireToView
public void fireToView(Binding binding, Object parent, Object modelValue) throws BindingVetoException - Specified by:
fireToViewin interfaceBinder- Overrides:
fireToViewin classAbstractBinder- Throws:
BindingVetoException
-
fireToModel
public void fireToModel(Binding binding, Object parent, Object viewValue) throws BindingVetoException - Specified by:
fireToModelin interfaceBinder- Overrides:
fireToModelin classAbstractBinder- Throws:
BindingVetoException
-
requestMandatoryUpdate
public void requestMandatoryUpdate()Description copied from interface:FxComponentBinderRequest to update the mandatory attribute of all dynamically mandatory components.- Specified by:
requestMandatoryUpdatein interfaceFxComponentBinder
-
getMandatoryBindings
Description copied from interface:FxComponentBinderGets the dynamically mandatory bindings.- Specified by:
getMandatoryBindingsin interfaceFxComponentBinder- Returns:
- the mandatory bindings
-
requestChangeableUpdate
public void requestChangeableUpdate()Description copied from interface:FxComponentBinderRequest to update the changeable attribute of all dynamically mandatory components.- Specified by:
requestChangeableUpdatein interfaceFxComponentBinder
-
getChangeableBindings
Description copied from interface:FxComponentBinderGets the dynamically changeable bindings.- Specified by:
getChangeableBindingsin interfaceFxComponentBinder- Returns:
- the changeable bindings
-
bindAllInherited
public int bindAllInherited()- Specified by:
bindAllInheritedin interfaceBinder
-
bindWithInheritedBindables
public int bindWithInheritedBindables()Description copied from interface:FxComponentBinderBinds including inherited bindables.The controller will be scanned for members or sub members annotated with the
Bindable-annotation. Inherited members of the controller's parent classes will be included as well.CAUTION: expensive operation!
- Specified by:
bindWithInheritedBindablesin interfaceFxComponentBinder- Returns:
- number of members bound
-
bindWithInheritedComponents
public int bindWithInheritedComponents()Description copied from interface:FxComponentBinderBinds including inherited components.The controller will be scanned for members or sub members annotated with the
Bindable-annotation. Inherited components declared in parent controllers are included.CAUTION: expensive operation!
- Specified by:
bindWithInheritedComponentsin interfaceFxComponentBinder- Returns:
- number of members bound
-
bind
public int bind() -
unbind
public void unbind() -
getBindings
- Specified by:
getBindingsin interfaceBinder
-
getBoundComponents
Description copied from interface:FxComponentBinderGets the list of all bound components of this form.- Specified by:
getBoundComponentsin interfaceFxComponentBinder- Returns:
- the list of bound components, never null
-
getUnboundComponents
Description copied from interface:FxComponentBinderGets the list of all unbound components of this form.- Specified by:
getUnboundComponentsin interfaceFxComponentBinder- Returns:
- the list of unbound components, never null
-
isUnboundPending
public boolean isUnboundPending()Checks whether some components are still unbound.- Returns:
- true if unbound pending, false if all bound
-
assertAllBound
public void assertAllBound()- Specified by:
assertAllBoundin interfaceBinder
-
addBinding
- Specified by:
addBindingin interfaceBinder
-
getBinding
Description copied from interface:FxComponentBinderGets a binding by component.- Specified by:
getBindingin interfaceFxComponentBinder- Parameters:
component- the component assigned to the binding- Returns:
- the binding, null if component not bound
-
getBinding
Description copied from interface:FxComponentBinderOverridden to cast.
- Specified by:
getBindingin interfaceBinder- Specified by:
getBindingin interfaceFxComponentBinder
-
removeBinding
Description copied from interface:FxComponentBinderProgrammatically removes a binding from this view.- Specified by:
removeBindingin interfaceFxComponentBinder- Parameters:
component- the component assigned to the binding- Returns:
- the removed binding, null if no such binding found
-
removeBinding
Description copied from interface:FxComponentBinderOverridden to cast.
- Specified by:
removeBindingin interfaceBinder- Specified by:
removeBindingin interfaceFxComponentBinder
-
addMandatoryBinding
Adds a mandatory binding.- Parameters:
mandatoryBinding- the binding to add
-
addChangeableBinding
Adds a changeable binding.- Parameters:
changeableBinding- the binding to add
-
doBind
protected int doBind(BindingMember[] parents, String parentMemberPath, Class<?> parentClass, boolean declaredOnly) - Specified by:
doBindin classAbstractBinder
-