org.tbee.swing.binding
Class BindingUtils

java.lang.Object
  extended by org.tbee.swing.binding.BindingUtils

public class BindingUtils
extends java.lang.Object

TODO: can we use a fluent interface? like BindingUtils.bind(x).property("a").to(comp);

Author:
user

Nested Class Summary
static class BindingUtils.Binding
          Implements the fluent interface example: BindingUtils.bind(iBeanAdapter, Sellorder.PAYMENTAGREEMENT_PROPERTY_ID).to(lPaymentagreementJTextArea); TODO: this is just a first attempt, it works, but is not riped
static class BindingUtils.BindingInfo
          Binding info
static class BindingUtils.DummyEntity
          This is a class to serve as a wrapper to catch value changes
 
Field Summary
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
BindingUtils()
           
 
Method Summary
static BindingUtils.Binding bind(com.jgoodies.binding.beans.BeanAdapter ba, java.lang.String propertyName)
           
static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty, java.awt.Component component)
          also set the name of the component based on the linked bean property
static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty, java.awt.Component component, java.lang.String componentProperty)
          also set the name of the component based on the linked bean property
static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty, JButtonGroup buttonGroup)
           
static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty, JButtonGroup buttonGroup, java.lang.String property)
          also set the name of the component based on the linked bean property
static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty, java.beans.PropertyChangeListener pcl)
          have a PCL react to changes (when there is no property to bind to)
static void bind(java.awt.Component component1, java.lang.String property1, java.awt.Component component2, java.lang.String property2)
          Bind two properties and do not update any
static void bind(com.jgoodies.binding.value.ValueModel valueModel, java.awt.Component component)
          Bind a property of a component to a valueModel.
static void bind(com.jgoodies.binding.value.ValueModel valueModel, java.awt.Component component, java.lang.String property)
          Bind a property of a component to a valueModel.
static void bind(com.jgoodies.binding.value.ValueModel valueModel, JButtonGroup buttonGroup, java.lang.String property)
          Bind a property of a ButtonGroup to a valueModel.
static void bindAndUpdate1(java.awt.Component component1, java.lang.String property1, java.awt.Component component2, java.lang.String property2)
          Bind two properties and updated the first set
static void bindAndUpdate2(java.awt.Component component1, java.lang.String property1, java.awt.Component component2, java.lang.String property2)
          Bind two properties and updated the second set
static void bindComboboxToValueModel(javax.swing.JComboBox jcombobox, com.jgoodies.binding.value.ValueModel valueModel, boolean allowNull)
          Bind a combobox to a valueModel
static void bindJdbcComboboxToValueModel(javax.swing.JComboBox jcombobox, com.jgoodies.binding.value.ValueModel valueModel, boolean allowNull)
          Bind a combobox that uses the JdbcComboboxModel to a valueModel
static BindingUtils.BindingInfo getBindingInfo(java.awt.Component c)
           
static void storeBindingInfo(java.awt.Component component, com.jgoodies.binding.beans.BeanAdapter beanAdapter, java.lang.String beanProperty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

BindingUtils

public BindingUtils()
Method Detail

bind

public static void bind(com.jgoodies.binding.value.ValueModel valueModel,
                        java.awt.Component component)
Bind a property of a component to a valueModel. Catch and show IllegalArgumentExceptions.

Parameters:
valueModel -
component -

bind

public static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                        java.lang.String beanProperty,
                        java.awt.Component component)
also set the name of the component based on the linked bean property


bind

public static void bind(com.jgoodies.binding.value.ValueModel valueModel,
                        java.awt.Component component,
                        java.lang.String property)
Bind a property of a component to a valueModel.

Parameters:
valueModel -
component -
property - of component

bind

public static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                        java.lang.String beanProperty,
                        java.awt.Component component,
                        java.lang.String componentProperty)
also set the name of the component based on the linked bean property


bind

public static void bind(com.jgoodies.binding.value.ValueModel valueModel,
                        JButtonGroup buttonGroup,
                        java.lang.String property)
Bind a property of a ButtonGroup to a valueModel. Catch and show IllegalArgumentExceptions.

Parameters:
valueModel -
buttonGroup -

bind

public static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                        java.lang.String beanProperty,
                        JButtonGroup buttonGroup,
                        java.lang.String property)
also set the name of the component based on the linked bean property


bind

public static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                        java.lang.String beanProperty,
                        JButtonGroup buttonGroup)

bind

public static void bind(java.awt.Component component1,
                        java.lang.String property1,
                        java.awt.Component component2,
                        java.lang.String property2)
Bind two properties and do not update any


bindAndUpdate1

public static void bindAndUpdate1(java.awt.Component component1,
                                  java.lang.String property1,
                                  java.awt.Component component2,
                                  java.lang.String property2)
Bind two properties and updated the first set


bindAndUpdate2

public static void bindAndUpdate2(java.awt.Component component1,
                                  java.lang.String property1,
                                  java.awt.Component component2,
                                  java.lang.String property2)
Bind two properties and updated the second set


bind

public static void bind(com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                        java.lang.String beanProperty,
                        java.beans.PropertyChangeListener pcl)
have a PCL react to changes (when there is no property to bind to)


bindComboboxToValueModel

public static void bindComboboxToValueModel(javax.swing.JComboBox jcombobox,
                                            com.jgoodies.binding.value.ValueModel valueModel,
                                            boolean allowNull)
Bind a combobox to a valueModel

Parameters:
jcombobox -
valueModel -
allowNull - allow nulls to be set into the value model

bindJdbcComboboxToValueModel

public static void bindJdbcComboboxToValueModel(javax.swing.JComboBox jcombobox,
                                                com.jgoodies.binding.value.ValueModel valueModel,
                                                boolean allowNull)
Bind a combobox that uses the JdbcComboboxModel to a valueModel

Parameters:
jcombobox -
valueModel -
allowNull - allow nulls to be set into the value model

getBindingInfo

public static BindingUtils.BindingInfo getBindingInfo(java.awt.Component c)

storeBindingInfo

public static void storeBindingInfo(java.awt.Component component,
                                    com.jgoodies.binding.beans.BeanAdapter beanAdapter,
                                    java.lang.String beanProperty)
Parameters:
component -
beanAdapter -
beanProperty -

bind

public static BindingUtils.Binding bind(com.jgoodies.binding.beans.BeanAdapter ba,
                                        java.lang.String propertyName)


Copyright © 2010. All Rights Reserved.