java.lang.Object
org.tentackle.bind.AbstractBinding
org.tentackle.fx.bind.DefaultFxComponentBinding
- All Implemented Interfaces:
Binding,FxComponentBinding
Implementation of a binding for FX components.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFxComponentBinding(FxComponentBinder binder, BindingMember[] parents, BindingMember member, FxComponent component, String componentOptions) Creates a binding. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidApplies the model's type to the component.protected voidvoidfireToView(Object parent, Object modelValue) protected ObjectGets the component which is bound to the member.protected Class<?>Determines the component's type.
This is an estimation derived from the getter and setter methods, usually setViewValue and getViewValue.booleanbooleanprotected booleanvoidsetChangeable(boolean changeable) voidsetMandatory(boolean mandatory) protected voidupdateView(Object value) protected StringMethods inherited from class org.tentackle.bind.AbstractBinding
addToModelListener, addToViewListener, addValidationListener, addValidator, createBindingEvent, createValidationEvent, fireToModel, fireValidated, getMember, getModelValue, getModelValue, getParentObject, getParentObject, getParents, getToModelListeners, getToViewListeners, getValidationListeners, getValidators, removeToModelListener, removeToViewListener, removeValidationListener, removeValidator, setModelValue, setModelValue, setViewValue, toString, updateView, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.bind.Binding
addToModelListener, addToViewListener, addValidationListener, addValidator, createBindingEvent, createValidationEvent, fireToModel, fireValidated, getMember, getModelValue, getParentObject, getParents, getToModelListeners, getToViewListeners, getValidationListeners, getValidators, removeToModelListener, removeToViewListener, removeValidationListener, removeValidator, setModelValue, setViewValue, validate
-
Constructor Details
-
DefaultFxComponentBinding
public DefaultFxComponentBinding(FxComponentBinder binder, BindingMember[] parents, BindingMember member, FxComponent component, String componentOptions) Creates a binding.- Parameters:
binder- the binder managing this bindingcomponent- the GUI-component to bindcomponentOptions- options to configure the component.
Defined are:- UC: convert to uppercase
- LC: convert to lowercase
- COLS=n: width in columns
- MAXCOLS=n: limit input to max. columns
- LINES=n: number of lines in text areas
- [-]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 Details
-
getBinder
- Specified by:
getBinderin interfaceBinding- Specified by:
getBinderin interfaceFxComponentBinding- Overrides:
getBinderin classAbstractBinding
-
getComponent
Description copied from interface:FxComponentBindingGets the component which is bound to the member.- Specified by:
getComponentin interfaceFxComponentBinding- Returns:
- the component
-
getViewValue
- Specified by:
getViewValuein interfaceBinding
-
fireToView
- Specified by:
fireToViewin interfaceBinding- Overrides:
fireToViewin classAbstractBinding- Throws:
BindingVetoException
-
determineValidators
protected void determineValidators()- Overrides:
determineValidatorsin classAbstractBinding
-
getViewType
Determines the component's type.
This is an estimation derived from the getter and setter methods, usually setViewValue and getViewValue.- Specified by:
getViewTypein classAbstractBinding- Returns:
- the component's type
-
applyType
protected void applyType()Applies the model's type to the component.- Throws:
BindingException- if component does not accept type
-
setMandatory
public void setMandatory(boolean mandatory) - Specified by:
setMandatoryin interfaceBinding
-
isMandatory
public boolean isMandatory()- Specified by:
isMandatoryin interfaceBinding
-
setChangeable
public void setChangeable(boolean changeable) - Specified by:
setChangeablein interfaceBinding
-
isChangeable
public boolean isChangeable()- Specified by:
isChangeablein interfaceBinding
-
getBoundRootObject
- Specified by:
getBoundRootObjectin classAbstractBinding
-
isValidationRequired
protected boolean isValidationRequired()- Specified by:
isValidationRequiredin classAbstractBinding
-
viewComponentToString
- Specified by:
viewComponentToStringin classAbstractBinding
-
updateView
- Specified by:
updateViewin classAbstractBinding
-