net.sourceforge.jfacefactories.binders
Class ListBinder

java.lang.Object
  extended by net.sourceforge.jfacefactories.binders.ListBinder

public final class ListBinder
extends java.lang.Object

Methods for databinding List controls.

Since:
0.1
Author:
MikeE

Method Summary
<T> void
bind(java.lang.Object bean, java.lang.String propertyName, java.util.Collection<T> values, org.eclipse.swt.widgets.List control)
          Binds the passed List control to the passed property on the passed bean, offering the passed values.
 void bind(java.lang.Object bean, java.lang.String propertyName, java.lang.Object inputBean, java.lang.String inputPropertyName, org.eclipse.swt.widgets.List control)
          Binds the passed List control to the passed property on the passed bean, offering values provided by a second 'input' bean's property.
protected  org.eclipse.core.databinding.DataBindingContext getContext()
          Accessor to context.
protected  IExceptionHandler getExceptionHandler()
          Accessor to exception handler.
protected  org.eclipse.core.databinding.observable.Realm getRealm()
          Accessor to validation realm.
protected  void runInRealm(java.lang.Runnable runnable)
          Runs the passed runnable in the current validation realm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bind

public <T> void bind(java.lang.Object bean,
                     java.lang.String propertyName,
                     java.util.Collection<T> values,
                     org.eclipse.swt.widgets.List control)
Binds the passed List control to the passed property on the passed bean, offering the passed values.
The List's style defines binding behaviour:

Parameters:
bean - - cannot be null
propertyName - - cannot be null
values - - the values to be displayed, cannot be null
control - - cannot be null

bind

public void bind(java.lang.Object bean,
                 java.lang.String propertyName,
                 java.lang.Object inputBean,
                 java.lang.String inputPropertyName,
                 org.eclipse.swt.widgets.List control)
Binds the passed List control to the passed property on the passed bean, offering values provided by a second 'input' bean's property.
The List's style defines binding behaviour: If the input Bean supports PropertyChangeListeners (i.e. has an addPropertyChangeListener(String, PropertyChangeListener) and equivalent remove methods) then the input value is observed and the List's content updated whenever the input value changes (the existing selection is maintained if possible).

Parameters:
bean - - cannot be null, the bean whose property is set
propertyName - - cannot be null, the property on this bean
inputBean - - cannot be null, the bean providing the List's values
inputPropertyName - - cannot be null, the property on the inputBean that supplies the values - must be an array or a java.util.Collection
control - - cannot be null, the List to be bound

getContext

protected org.eclipse.core.databinding.DataBindingContext getContext()
Accessor to context.

Returns:

getRealm

protected org.eclipse.core.databinding.observable.Realm getRealm()
Accessor to validation realm.

Returns:

runInRealm

protected void runInRealm(java.lang.Runnable runnable)
Runs the passed runnable in the current validation realm

Parameters:
runnable -

getExceptionHandler

protected IExceptionHandler getExceptionHandler()
Accessor to exception handler.

Returns: