org.viewaframework.binding.swing
Class SwingBinding

java.lang.Object
  extended by org.viewaframework.binding.swing.SwingBinding
All Implemented Interfaces:
Binding<Object>

public class SwingBinding
extends Object
implements Binding<Object>

Author:
Mario Garcia This class acts as a binding group. The user can chain as many bindings as he want before binding them all at once. This way a chain of bindings can be created this way:

Constructor Summary
SwingBinding()
           
 
Method Summary
 void bind()
          Binds source and target objects
<SS,SP,TS,TP>
SwingBinding
createBeanAdapterBinding(BeanAdapter<SS> source, Property<SP> sourceProperty, BeanAdapter<TS> target, Property<TP> targetProperty)
           
<SS,SP,TS,TP>
SwingBinding
createBeanAdapterBinding(SS source, Property<SP> sourceProperty, TS target, Property<TP> targetProperty)
           
<SP,TS,TP> SwingBinding
createButtonBinding(JButton source, Property<SP> sourceProperty, BeanAdapter<TS> target, Property<TP> targetProperty)
           
<TS> SwingBinding
createComboBoxListBinding(JComboBox source, EventList<TS> list)
           
<TS> SwingBinding
createComboBoxSelectionBinding(JComboBox source, BeanAdapter<TS> target)
           
<SP,TS,TP> SwingBinding
createLabelBinding(JLabel source, Property<SP> sourceProperty, BeanAdapter<TS> target, Property<TP> targetProperty)
           
<TS> SwingBinding
createListBinding(JList source, EventList<TS> list)
           
<TS> SwingBinding
createListSelectionBinding(JList source, BeanAdapter<TS> target)
           
<TS> SwingBinding
createTableListBinding(JTable source, EventList<TS> list, List<ColumnInfo> tableColumns)
           
<TS> SwingBinding
createTableSelectionBinding(JTable source, BeanAdapter<TS> target)
           
<SP,TS,TP> SwingBinding
createTextFieldBinding(JTextField source, Property<SP> sourceProperty, BeanAdapter<TS> target, Property<TP> targetProperty)
           
 void unbind()
          Unbinds source and target objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingBinding

public SwingBinding()
Method Detail

bind

public void bind()
Description copied from interface: Binding
Binds source and target objects

Specified by:
bind in interface Binding<Object>

createBeanAdapterBinding

public <SS,SP,TS,TP> SwingBinding createBeanAdapterBinding(BeanAdapter<SS> source,
                                                           Property<SP> sourceProperty,
                                                           BeanAdapter<TS> target,
                                                           Property<TP> targetProperty)
Type Parameters:
SS -
SP -
TS -
TP -
Parameters:
source -
sourceProperty -
target -
targetProperty -
Returns:

createBeanAdapterBinding

public <SS,SP,TS,TP> SwingBinding createBeanAdapterBinding(SS source,
                                                           Property<SP> sourceProperty,
                                                           TS target,
                                                           Property<TP> targetProperty)
Type Parameters:
SS -
SP -
TS -
TP -
Parameters:
source -
sourceProperty -
target -
targetProperty -
Returns:

createButtonBinding

public <SP,TS,TP> SwingBinding createButtonBinding(JButton source,
                                                   Property<SP> sourceProperty,
                                                   BeanAdapter<TS> target,
                                                   Property<TP> targetProperty)
Type Parameters:
SP -
TS -
TP -
Parameters:
source -
sourceProperty -
target -
targetProperty -
Returns:

createComboBoxListBinding

public <TS> SwingBinding createComboBoxListBinding(JComboBox source,
                                                   EventList<TS> list)
Type Parameters:
TS -
Parameters:
source -
list -
Returns:

createComboBoxSelectionBinding

public <TS> SwingBinding createComboBoxSelectionBinding(JComboBox source,
                                                        BeanAdapter<TS> target)
Type Parameters:
TS -
Parameters:
source -
target -
Returns:

createLabelBinding

public <SP,TS,TP> SwingBinding createLabelBinding(JLabel source,
                                                  Property<SP> sourceProperty,
                                                  BeanAdapter<TS> target,
                                                  Property<TP> targetProperty)
Type Parameters:
SP -
TS -
TP -
Parameters:
source -
sourceProperty -
target -
targetProperty -
Returns:

createListBinding

public <TS> SwingBinding createListBinding(JList source,
                                           EventList<TS> list)
Type Parameters:
TS -
Parameters:
source -
list -
Returns:

createListSelectionBinding

public <TS> SwingBinding createListSelectionBinding(JList source,
                                                    BeanAdapter<TS> target)
Type Parameters:
TS -
Parameters:
source -
target -
Returns:

createTableListBinding

public <TS> SwingBinding createTableListBinding(JTable source,
                                                EventList<TS> list,
                                                List<ColumnInfo> tableColumns)
Type Parameters:
TS -
Parameters:
source -
list -
tableColumns -
Returns:

createTableSelectionBinding

public <TS> SwingBinding createTableSelectionBinding(JTable source,
                                                     BeanAdapter<TS> target)
Type Parameters:
TS -
Parameters:
source -
target -
Returns:

createTextFieldBinding

public <SP,TS,TP> SwingBinding createTextFieldBinding(JTextField source,
                                                      Property<SP> sourceProperty,
                                                      BeanAdapter<TS> target,
                                                      Property<TP> targetProperty)
Type Parameters:
SP -
TS -
TP -
Parameters:
source -
sourceProperty -
target -
targetProperty -
Returns:

unbind

public void unbind()
Description copied from interface: Binding
Unbinds source and target objects

Specified by:
unbind in interface Binding<Object>


Copyright © 2010. All Rights Reserved.