com.silvermindsoftware.hitch
Class BinderImpl

java.lang.Object
  extended by com.silvermindsoftware.hitch.BinderImpl
All Implemented Interfaces:
Binder

public class BinderImpl
extends Object
implements Binder

This class is the default implementation of the binder.

Author:
Stefan Wismer (SWI), based on Hitch by Brandon Goodin
File-location:
BinderImpl
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Field Summary
protected  Set<org.jdesktop.beansbinding.BindingGroup> m_bindings
          The managed bindings.
 
Method Summary
 org.jdesktop.beansbinding.BindingGroup addAutoBinding(Container container, boolean performValidate, String... modelId)
          
 org.jdesktop.beansbinding.AutoBinding addAutoBinding(Container container, JComponent component, BindingCreator creator, boolean performValidate)
          Bind a component to a model using a specific binding creator.
 org.jdesktop.beansbinding.BindingGroup addAutoBinding(Container container, String... modelId)
          Add all bindings that can be derived from the binding annotations.
 org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy strategy, Object model, String property, JComponent component, boolean performValidate)
          Bind a component to a model using the standard binding creator.
 org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding binding)
          Bind a component to a model completely manually.
 org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding binding, boolean performValidate)
          Bind a component to a model completely manually.
 org.jdesktop.beansbinding.AutoBinding addManualBinding(Object model, String property, JComponent component, BindingCreator creator, boolean performValidate)
          Bind a component to a model using a specific binding creator.
 void addValidationResponder(org.jdesktop.beansbinding.AutoBinding binding, ValidationResponder responder)
          Add a custom validation responder to a binding.
 void addValidationResponder(org.jdesktop.beansbinding.BindingGroup group, ValidationResponder responder)
          Add a custom validation responder to a binding group.
 void bindAll()
          Bind all managed bindings.
 org.jdesktop.beansbinding.BindingGroup find(Object model, String property, JComponent component)
          Find a specific binding.
 void remove(org.jdesktop.beansbinding.AutoBinding binding)
          Remove a binding.
 void remove(org.jdesktop.beansbinding.BindingGroup binding)
          Remove a binding group.
 void removeAll()
          Remove all bindings.
protected  boolean skipModel(String modelId, String[] modelIdList)
          Check if update should occur for particular model objects.
 void unbindAll()
          Unbind all managed bindings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_bindings

protected Set<org.jdesktop.beansbinding.BindingGroup> m_bindings
The managed bindings.

Method Detail

addAutoBinding

public org.jdesktop.beansbinding.BindingGroup addAutoBinding(Container container,
                                                             String... modelId)
Add all bindings that can be derived from the binding annotations. The name of the annotated fields must match a property of the model (field prefix "m_" is removed if applicable).

Specified by:
addAutoBinding in interface Binder
Parameters:
container - the GUI component container to bind to
modelId - the optional model identifiers (to select models to bind)
Returns:
the added binding group

addAutoBinding

public org.jdesktop.beansbinding.BindingGroup addAutoBinding(Container container,
                                                             boolean performValidate,
                                                             String... modelId)

Specified by:
addAutoBinding in interface Binder
Parameters:
container - the GUI component container to bind to
performValidate - validate user input
modelId - the optional model identifiers (to select models to bind)
Returns:
the added binding group

addAutoBinding

public org.jdesktop.beansbinding.AutoBinding addAutoBinding(Container container,
                                                            JComponent component,
                                                            BindingCreator creator,
                                                            boolean performValidate)
Bind a component to a model using a specific binding creator.

Specified by:
addAutoBinding in interface Binder
Parameters:
container - the GUI component container to bind to
component - the form component to bind to
creator - the specific binding creator
performValidate - determines if a validation should be performed
Returns:
the created binding

addManualBinding

public org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy strategy,
                                                              Object model,
                                                              String property,
                                                              JComponent component,
                                                              boolean performValidate)
Bind a component to a model using the standard binding creator.

Specified by:
addManualBinding in interface Binder
model - the model to bind
property - the property of the model to bind
component - the form component to bind
performValidate - determines if a validation should be performed
Returns:
the created binding

addManualBinding

public org.jdesktop.beansbinding.AutoBinding addManualBinding(Object model,
                                                              String property,
                                                              JComponent component,
                                                              BindingCreator creator,
                                                              boolean performValidate)
Bind a component to a model using a specific binding creator.

Specified by:
addManualBinding in interface Binder
Parameters:
model - the model to bind
property - the property of the model to bind
component - the form component to bind to
creator - the specific binding creator
performValidate - determines if a validation should be performed
Returns:
the created binding

addManualBinding

public org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding binding,
                                                              boolean performValidate)
Bind a component to a model completely manually.

Specified by:
addManualBinding in interface Binder
Parameters:
binding - the binding to add
performValidate - determines if a validation should be performed
Returns:
the added binding

addManualBinding

public org.jdesktop.beansbinding.AutoBinding addManualBinding(org.jdesktop.beansbinding.AutoBinding binding)
Bind a component to a model completely manually.

Specified by:
addManualBinding in interface Binder
Parameters:
binding - the binding to add
Returns:
the added binding

addValidationResponder

public void addValidationResponder(org.jdesktop.beansbinding.BindingGroup group,
                                   ValidationResponder responder)
Add a custom validation responder to a binding group.

Specified by:
addValidationResponder in interface Binder
Parameters:
group - the binding group
responder - the validation responder

addValidationResponder

public void addValidationResponder(org.jdesktop.beansbinding.AutoBinding binding,
                                   ValidationResponder responder)
Add a custom validation responder to a binding.

Specified by:
addValidationResponder in interface Binder
Parameters:
binding - the binding
responder - the validation responder

bindAll

public void bindAll()
Bind all managed bindings.

Specified by:
bindAll in interface Binder

unbindAll

public void unbindAll()
Unbind all managed bindings.

Specified by:
unbindAll in interface Binder

removeAll

public void removeAll()
Remove all bindings.

Specified by:
removeAll in interface Binder

find

public org.jdesktop.beansbinding.BindingGroup find(Object model,
                                                   String property,
                                                   JComponent component)
Find a specific binding. Parameters being null mean "don't care".

Specified by:
find in interface Binder
Parameters:
model - the model to bind
property - the property of the model to bind to
component - the form component to bind to
Returns:
the found bindings or null if none

remove

public void remove(org.jdesktop.beansbinding.BindingGroup binding)
Remove a binding group.

Specified by:
remove in interface Binder
Parameters:
binding - the binding group to remove

remove

public void remove(org.jdesktop.beansbinding.AutoBinding binding)
Remove a binding.

Specified by:
remove in interface Binder
Parameters:
binding - the binding to remove

skipModel

protected boolean skipModel(String modelId,
                            String[] modelIdList)
Check if update should occur for particular model objects.

Parameters:
modelId - the model id given by the annotation
modelIdList - list of available models
Returns:
true if model should be skipped


Copyright © 2005-2011 ELCA. All Rights Reserved.