- java.lang.Object
-
- org.tentackle.bind.AbstractBinding
-
- org.tentackle.fx.bind.DefaultFxComponentBinding
-
- All Implemented Interfaces:
org.tentackle.bind.Binding,FxComponentBinding
public class DefaultFxComponentBinding extends org.tentackle.bind.AbstractBinding implements FxComponentBinding
Common implemenation of a binding.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description DefaultFxComponentBinding(FxComponentBinder binder, org.tentackle.bind.BindingMember[] parents, org.tentackle.bind.BindingMember member, FxComponent component, java.lang.String componentOptions)Creates a binding.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyType()Applies the model's type to the component.protected voiddetermineValidators()voidfireToView(java.lang.Object parent, java.lang.Object modelValue)FxComponentBindergetBinder()protected java.lang.ObjectgetBoundRootObject()FxComponentgetComponent()Gets the component which is bound to the member.protected java.lang.Class<?>getViewType()Determines the component's type.
This is an estimation derived from the getter and setter methods, usually setViewValue and getViewValue.java.lang.ObjectgetViewValue()booleanisChangeable()booleanisMandatory()protected booleanisValidationRequired()voidsetChangeable(boolean changeable)voidsetMandatory(boolean mandatory)protected voidupdateComponentName()Sets the component name to some meaningful value.
Required by some GUI testing tools.protected voidupdateView(java.lang.Object value)protected java.lang.StringviewComponentToString()-
Methods inherited from class org.tentackle.bind.AbstractBinding
addToModelListener, addToViewListener, addValidationListener, addValidator, createBindingEvent, createValidationContext, createValidationEvent, fireToModel, fireValidated, getMember, getModelValue, getModelValue, getParentObject, getParents, getToModelListeners, getToViewListeners, getValidationListeners, getValidators, removeToModelListener, removeToViewListener, removeValidationListener, removeValidator, setModelValue, setModelValue, setViewValue, toString, updateView, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tentackle.bind.Binding
addToModelListener, addToViewListener, addValidationListener, addValidator, createBindingEvent, createValidationContext, createValidationEvent, fireToModel, fireValidated, getMember, getModelValue, getParentObject, getParents, getToModelListeners, getToViewListeners, getValidationListeners, getValidators, removeToModelListener, removeToViewListener, removeValidationListener, removeValidator, setModelValue, setViewValue, validate
-
-
-
-
Constructor Detail
-
DefaultFxComponentBinding
public DefaultFxComponentBinding(FxComponentBinder binder, org.tentackle.bind.BindingMember[] parents, org.tentackle.bind.BindingMember member, FxComponent component, java.lang.String componentOptions)
Creates a binding.- Parameters:
binder- the binder managing this bindingcomponent- the GUI-component to bindcomponentOptions- options to configure the component.
Currently defined are:- UC: convert to uppercase
- LC: convert to lowercase
- COLS=n: width in columns
- MAXCOLS=n: limit input to max. columns
- LINESS=n: number of lines in textareas
- [-]AUTOSELECT: turn autoselect on/off
- UTC: utc timestamps
- SCALE=n: numeric scale
- UNSIGNED: unsigned numeric value.
parents- the members building the declaration chain to this member, null if this binding's member is in controllermember- the member field to bind- See Also:
Constants
-
-
Method Detail
-
getBinder
public FxComponentBinder getBinder()
- Specified by:
getBinderin interfaceorg.tentackle.bind.Binding- Specified by:
getBinderin interfaceFxComponentBinding- Overrides:
getBinderin classorg.tentackle.bind.AbstractBinding
-
getComponent
public FxComponent getComponent()
Description copied from interface:FxComponentBindingGets the component which is bound to the member.- Specified by:
getComponentin interfaceFxComponentBinding- Returns:
- the component
-
getViewValue
public java.lang.Object getViewValue()
- Specified by:
getViewValuein interfaceorg.tentackle.bind.Binding
-
fireToView
public void fireToView(java.lang.Object parent, java.lang.Object modelValue) throws org.tentackle.bind.BindingVetoException- Specified by:
fireToViewin interfaceorg.tentackle.bind.Binding- Overrides:
fireToViewin classorg.tentackle.bind.AbstractBinding- Throws:
org.tentackle.bind.BindingVetoException
-
determineValidators
protected void determineValidators()
- Overrides:
determineValidatorsin classorg.tentackle.bind.AbstractBinding
-
getViewType
protected java.lang.Class<?> getViewType()
Determines the component's type.
This is an estimation derived from the getter and setter methods, usually setViewValue and getViewValue.- Specified by:
getViewTypein classorg.tentackle.bind.AbstractBinding- Returns:
- the component's type
-
applyType
protected void applyType()
Applies the model's type to the component.- Throws:
org.tentackle.bind.BindingException- if component does not accept type
-
updateComponentName
protected void updateComponentName()
Sets the component name to some meaningful value.
Required by some GUI testing tools.The component name will be the
memberPathprepended with the names of the parent components, each separated by a slash.
Example:"Shipment/ShipmentFile/Booking/shipment.customer.addressNumber"
-
setMandatory
public void setMandatory(boolean mandatory)
- Specified by:
setMandatoryin interfaceorg.tentackle.bind.Binding
-
isMandatory
public boolean isMandatory()
- Specified by:
isMandatoryin interfaceorg.tentackle.bind.Binding
-
setChangeable
public void setChangeable(boolean changeable)
- Specified by:
setChangeablein interfaceorg.tentackle.bind.Binding
-
isChangeable
public boolean isChangeable()
- Specified by:
isChangeablein interfaceorg.tentackle.bind.Binding
-
getBoundRootObject
protected java.lang.Object getBoundRootObject()
- Specified by:
getBoundRootObjectin classorg.tentackle.bind.AbstractBinding
-
isValidationRequired
protected boolean isValidationRequired()
- Specified by:
isValidationRequiredin classorg.tentackle.bind.AbstractBinding
-
viewComponentToString
protected java.lang.String viewComponentToString()
- Specified by:
viewComponentToStringin classorg.tentackle.bind.AbstractBinding
-
updateView
protected void updateView(java.lang.Object value)
- Specified by:
updateViewin classorg.tentackle.bind.AbstractBinding
-
-