Package org.nuiton.jaxx.runtime.binding
Class DefaultJAXXBinding
- java.lang.Object
-
- org.nuiton.jaxx.runtime.binding.DefaultJAXXBinding
-
- All Implemented Interfaces:
PropertyChangeListener,EventListener,JAXXBinding
- Direct Known Subclasses:
SimpleJAXXObjectBinding
public abstract class DefaultJAXXBinding extends Object implements JAXXBinding
APropertyChangeListenerwhich processes a data binding when it receives aPropertyChangeEvent.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandefaultBindingflag to knowtrue: if the binding was init from a generated jaxx object,falseotherwise.protected booleanreloadAfterFireInternal state to reapply the binding after each fires :this is sometimes necessary when binding is complex.protected JAXXObjectsourceThe source of the binding.
-
Constructor Summary
Constructors Constructor Description DefaultJAXXBinding(JAXXObject source, String id, boolean defaultBinding)Creates a new Data binding which will run the given data binding when it receives aPropertyChangeEvent.DefaultJAXXBinding(JAXXObject source, String id, boolean defaultBinding, boolean reloadAfterFire)Creates a new Data binding which will run the given data binding when it receives aPropertyChangeEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()JAXXObjectgetSource()booleanisDefaultBinding()voidpropertyChange(PropertyChangeEvent e)Processes the data binding in response to aPropertyChangeEvent.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuiton.jaxx.runtime.JAXXBinding
applyDataBinding, processDataBinding, removeDataBinding
-
-
-
-
Field Detail
-
source
protected final JAXXObject source
The source of the binding.
-
defaultBinding
protected final boolean defaultBinding
flag to knowtrue: if the binding was init from a generated jaxx object,falseotherwise.
-
reloadAfterFire
protected final boolean reloadAfterFire
Internal state to reapply the binding after each fires :this is sometimes necessary when binding is complex. For example with this bindingui.getModel().getProperty()
We need to listen two things : first listen onuithe modification ofmodel, then onmodeltheproperty.- Since:
- 2.4.2
-
-
Constructor Detail
-
DefaultJAXXBinding
public DefaultJAXXBinding(JAXXObject source, String id, boolean defaultBinding)
Creates a new Data binding which will run the given data binding when it receives aPropertyChangeEvent.- Parameters:
source- theJAXXObjectsource of the bindingid- the name of the data binding to rundefaultBinding- flag to knwon if binding is coming from a generated jaxx object (true).
-
DefaultJAXXBinding
public DefaultJAXXBinding(JAXXObject source, String id, boolean defaultBinding, boolean reloadAfterFire)
Creates a new Data binding which will run the given data binding when it receives aPropertyChangeEvent.- Parameters:
source- theJAXXObjectsource of the bindingid- the name of the data binding to rundefaultBinding- flag to know if binding is coming from a generated jaxx object (true).reloadAfterFire- flag to know if the binding need to be reload after each fires
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceJAXXBinding
-
getSource
public JAXXObject getSource()
- Specified by:
getSourcein interfaceJAXXBinding
-
isDefaultBinding
public boolean isDefaultBinding()
- Specified by:
isDefaultBindingin interfaceJAXXBinding
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
Processes the data binding in response to aPropertyChangeEvent. When the binding is wake up, delegate the process to the source object which can manage re-entrant code (can not process a re-entrant event).- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
e- the event which triggered the binding
-
-