Eclipse Platform
Release 3.3

org.eclipse.core.databinding.beans
Class BeansObservables

java.lang.Object
  extended byorg.eclipse.core.databinding.beans.BeansObservables

public final class BeansObservables
extends Object

A factory for creating observable objects of Java objects that conform to the JavaBean specification for bound properties.

Since:
1.1

Field Summary
static boolean DEBUG
           
 
Constructor Summary
BeansObservables()
           
 
Method Summary
static IObservableFactory listFactory(Realm realm, String propertyName, Class elementType)
          Returns a factory for creating obervable lists tracking the given property of a particular bean object
static IObservableList observeDetailList(Realm realm, IObservableValue master, String propertyName, Class propertyType)
          Helper method for MasterDetailObservables.detailList(master, listFactory(realm, propertyName, propertyType), propertyType)
static IObservableSet observeDetailSet(Realm realm, IObservableValue master, String propertyName, Class propertyType)
          Helper method for MasterDetailObservables.detailSet(master, setFactory(realm, propertyName), propertyType)
static IObservableValue observeDetailValue(Realm realm, IObservableValue master, String propertyName, Class propertyType)
          Helper method for MasterDetailObservables.detailValue(master, valueFactory(realm, propertyName), propertyType)
static IObservableList observeList(Realm realm, Object bean, String propertyName)
          Returns an observable list in the given realm tracking the collection-typed named property of the given bean object.
static IObservableList observeList(Realm realm, Object bean, String propertyName, Class elementType)
          Returns an observable list in the given realm tracking the collection-typed named property of the given bean object.
static IObservableMap observeMap(IObservableSet domain, Class beanClass, String propertyName)
          Returns an observable map in the default realm tracking the current values of the named property for the beans in the given set.
static IObservableMap[] observeMaps(IObservableSet domain, Class beanClass, String[] propertyNames)
          Returns an array of observable maps in the default realm tracking the current values of the named propertys for the beans in the given set.
static IObservableSet observeSet(Realm realm, Object bean, String propertyName)
          Returns an observable set in the given realm tracking the collection-typed named property of the given bean object
static IObservableSet observeSet(Realm realm, Object bean, String propertyName, Class elementType)
           
static IObservableValue observeValue(Object bean, String propertyName)
          Returns an observable value in the default realm tracking the current value of the named property of the given bean.
static IObservableValue observeValue(Realm realm, Object bean, String propertyName)
          Returns an observable value in the given realm tracking the current value of the named property of the given bean.
static IObservableFactory setFactory(Realm realm, String propertyName)
          Returns a factory for creating obervable sets tracking the given property of a particular bean object
static IObservableFactory setFactory(Realm realm, String propertyName, Class elementType)
           
static IObservableFactory valueFactory(Realm realm, String propertyName)
          Returns a factory for creating obervable values tracking the given property of a particular bean object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

BeansObservables

public BeansObservables()
Method Detail

observeValue

public static IObservableValue observeValue(Object bean,
                                            String propertyName)
Returns an observable value in the default realm tracking the current value of the named property of the given bean.

Parameters:
bean - the object
propertyName - the name of the property
Returns:
an observable value tracking the current value of the named property of the given bean

observeValue

public static IObservableValue observeValue(Realm realm,
                                            Object bean,
                                            String propertyName)
Returns an observable value in the given realm tracking the current value of the named property of the given bean.

Parameters:
realm - the realm
bean - the object
propertyName - the name of the property
Returns:
an observable value tracking the current value of the named property of the given bean

observeMap

public static IObservableMap observeMap(IObservableSet domain,
                                        Class beanClass,
                                        String propertyName)
Returns an observable map in the default realm tracking the current values of the named property for the beans in the given set.

Parameters:
domain - the set of bean objects
beanClass - the common base type of bean objects that may be in the set
propertyName - the name of the property
Returns:
an observable map tracking the current values of the named property for the beans in the given domain set

observeMaps

public static IObservableMap[] observeMaps(IObservableSet domain,
                                           Class beanClass,
                                           String[] propertyNames)
Returns an array of observable maps in the default realm tracking the current values of the named propertys for the beans in the given set.

Parameters:
domain - the set of objects
beanClass - the common base type of objects that may be in the set
propertyNames - the array of property names
Returns:
an array of observable maps tracking the current values of the named propertys for the beans in the given domain set

observeList

public static IObservableList observeList(Realm realm,
                                          Object bean,
                                          String propertyName)
Returns an observable list in the given realm tracking the collection-typed named property of the given bean object. The returned list is mutable.

Parameters:
realm - the realm
bean - the object
propertyName - the name of the collection-typed property
Returns:
an observable list tracking the collection-typed named property of the given bean object
See Also:
observeList(Realm, Object, String, Class)

observeList

public static IObservableList observeList(Realm realm,
                                          Object bean,
                                          String propertyName,
                                          Class elementType)
Returns an observable list in the given realm tracking the collection-typed named property of the given bean object. The returned list is mutable. When an item is added or removed the setter is invoked for the list on the parent bean to provide notification to other listeners via PropertyChangeEvents. This is done to provide the same behavior as is expected from arrays as specified in the bean spec in section 7.2.

Parameters:
realm - the realm
bean - the bean object
propertyName - the name of the property
elementType - type of the elements in the list. If null and the property is an array the type will be inferred. If null and the property type cannot be inferred element type will be null.
Returns:
an observable list tracking the collection-typed named property of the given bean object

observeSet

public static IObservableSet observeSet(Realm realm,
                                        Object bean,
                                        String propertyName)
Returns an observable set in the given realm tracking the collection-typed named property of the given bean object

Parameters:
realm - the realm
bean - the bean object
propertyName - the name of the property
Returns:
an observable set tracking the collection-typed named property of the given bean object

valueFactory

public static IObservableFactory valueFactory(Realm realm,
                                              String propertyName)
Returns a factory for creating obervable values tracking the given property of a particular bean object

Parameters:
realm - the realm to use
propertyName - the name of the property
Returns:
an observable value factory

listFactory

public static IObservableFactory listFactory(Realm realm,
                                             String propertyName,
                                             Class elementType)
Returns a factory for creating obervable lists tracking the given property of a particular bean object

Parameters:
realm - the realm to use
propertyName - the name of the property
elementType -
Returns:
an observable list factory

setFactory

public static IObservableFactory setFactory(Realm realm,
                                            String propertyName)
Returns a factory for creating obervable sets tracking the given property of a particular bean object

Parameters:
realm - the realm to use
propertyName - the name of the property
Returns:
an observable set factory

observeDetailValue

public static IObservableValue observeDetailValue(Realm realm,
                                                  IObservableValue master,
                                                  String propertyName,
                                                  Class propertyType)
Helper method for MasterDetailObservables.detailValue(master, valueFactory(realm, propertyName), propertyType)

Parameters:
realm -
master -
propertyName -
propertyType - can be null
Returns:
an observable value that tracks the current value of the named property for the current value of the master observable value
See Also:
MasterDetailObservables

observeDetailList

public static IObservableList observeDetailList(Realm realm,
                                                IObservableValue master,
                                                String propertyName,
                                                Class propertyType)
Helper method for MasterDetailObservables.detailList(master, listFactory(realm, propertyName, propertyType), propertyType)

Parameters:
realm -
master -
propertyName -
propertyType - can be null
Returns:
an observable list that tracks the named property for the current value of the master observable value
See Also:
MasterDetailObservables

observeDetailSet

public static IObservableSet observeDetailSet(Realm realm,
                                              IObservableValue master,
                                              String propertyName,
                                              Class propertyType)
Helper method for MasterDetailObservables.detailSet(master, setFactory(realm, propertyName), propertyType)

Parameters:
realm -
master -
propertyName -
propertyType - can be null
Returns:
an observable set that tracks the named property for the current value of the master observable value
See Also:
MasterDetailObservables

observeSet

public static IObservableSet observeSet(Realm realm,
                                        Object bean,
                                        String propertyName,
                                        Class elementType)
Parameters:
realm -
bean -
propertyName -
elementType - can be null
Returns:
an observable set that tracks the current value of the named property for given bean object

setFactory

public static IObservableFactory setFactory(Realm realm,
                                            String propertyName,
                                            Class elementType)
Parameters:
realm -
propertyName -
elementType - can be null
Returns:
an observable set factory for creating observable sets

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.