|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.bus.support.PropertyChangeSupport
public class PropertyChangeSupport
Utility class to support property changes based on the Bus.
PropertyChangeSubscriber,
PropertyChangeMessage| Method Summary | ||
|---|---|---|
static void |
change(Object bean,
String property,
Object oldValue,
Object newValue)
Notifies the Bus that a property has changed |
|
static void |
connectBothWays(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
Operates a two-ways connection between two beans and two properties. |
|
static void |
connectOneWay(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
Connects a source property to a target property, in one way only. |
|
static
|
connectOneWay(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
Connects a source property to a target property, in one way only, using an adapter between the two properties. |
|
static void |
connectOneWayAndUpdate(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
Connects a source property to a target property, in one way only, and updates the target immediately. |
|
static
|
connectOneWayAndUpdate(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
Connects a source property to a target property, in one way only, using an adapter between the two properties, and updates the target property immediately. |
|
static String |
getExecutionDescription(Object targetBean,
String targetPropertyPath)
|
|
static void |
subscribe(PropertyChangeSubscriber subscriber)
Utility method to subscribe a Subscriber to the Bus. |
|
static void |
subscribe(SubscriberValidator validator,
Object bean,
String propertyPath,
PropertyChangeListener listener)
|
|
static void |
subscribe(SubscriberValidator validator,
Object bean,
String propertyPath,
Runnable runnable)
Registers a property subscriber that runs a task whenever the given property is changed. |
|
static
|
update(Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
Updates a target property from a source property, using an optional adapter. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void change(Object bean,
String property,
Object oldValue,
Object newValue)
Bus that a property has changed
bean - Bean whose property has changedproperty - Path to the changed propertyoldValue - New value for the propertynewValue - New value for the property
public static void connectBothWays(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
validator - Subscription validatorsourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target propertyBothWayPropertyChangeSubscriber,
update(Object, String, Object, String, Adapter)
public static void connectOneWay(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
validator - Subscription validatorsourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target property
public static <S,T> void connectOneWay(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
S - Type of the source propertyT - Type of the target propertyvalidator - Subscription validatorsourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target propertyadapter - Adapter from the source property to the target property
public static void connectOneWayAndUpdate(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath)
validator - Subscription validatorsourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target propertyupdate(Object, String, Object, String, Adapter)
public static <S,T> void connectOneWayAndUpdate(SubscriberValidator validator,
Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
S - Type of the source propertyT - Type of the target propertyvalidator - Subscription validatorsourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target propertyadapter - Adapter from the source property to the target propertyupdate(Object, String, Object, String, Adapter)
public static String getExecutionDescription(Object targetBean,
String targetPropertyPath)
public static void subscribe(PropertyChangeSubscriber subscriber)
Subscriber to the Bus.
subscriber - Subscriber to subscribe
public static void subscribe(SubscriberValidator validator,
Object bean,
String propertyPath,
Runnable runnable)
validator - Subscription validatorbean - Bean whose property may be changedpropertyPath - Path to the propertyrunnable - Task to execute when the property changes
public static void subscribe(SubscriberValidator validator,
Object bean,
String propertyPath,
PropertyChangeListener listener)
public static <S,T> void update(Object sourceBean,
String sourcePropertyPath,
Object targetBean,
String targetPropertyPath,
Adapter<S,T> adapter)
S - Type of the source propertyT - Type of the target propertysourceBean - Source beansourcePropertyPath - Path to the source propertytargetBean - Target beantargetPropertyPath - Path to the target propertyadapter - Adapter between the source and the target property, or
null if no adaptation is needed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||