org.skunk.dav.client.gui
Class StateMonitor

java.lang.Object
  |
  +--org.skunk.dav.client.gui.StateMonitor

public class StateMonitor
extends java.lang.Object

a property can be registered with the state monitor so that when the a given application property changes state, so will the registered property, according to a mapping of property values. If the mapping is null, the application property value is used directly to set the target property value.


Inner Class Summary
static interface StateMonitor.DomainMatcher
           
static interface StateMonitor.Mapper
          maps values of the application property to values of the target property
 
Method Summary
static StateMonitor.Mapper getMapper(java.util.Map m)
           
static void registerProperty(java.lang.Object target, java.lang.String targetProperty, java.lang.String applicationProperty, StateMonitor.Mapper valueMapper, StateMonitor.DomainMatcher domainMatcher)
          set a target object's property value to vary according to changes in the value of the application property, which is maintained statically by the StateMonitor class.
static void setProperty(java.lang.String applicationProperty, java.lang.Object value, java.lang.Object domainKey)
           
static void unregisterProperty(java.lang.Object target, java.lang.String targetProperty, java.lang.String applicationProperty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerProperty

public static void registerProperty(java.lang.Object target,
                                    java.lang.String targetProperty,
                                    java.lang.String applicationProperty,
                                    StateMonitor.Mapper valueMapper,
                                    StateMonitor.DomainMatcher domainMatcher)
set a target object's property value to vary according to changes in the value of the application property, which is maintained statically by the StateMonitor class. The target property's value is set to whatever the valueMapper returns, or, if the valueMapper is null, to the value of the application property.
Parameters:
target - the Object whose property will be set
targetProperty - the property of the Object that will be set
applicationProperty - the application property according to which the target property will vary
valueMapper - the Mapper that maps application values to target values, or null
domainMatcher - the DomainMatcher that tests domainKeys, or null

unregisterProperty

public static void unregisterProperty(java.lang.Object target,
                                      java.lang.String targetProperty,
                                      java.lang.String applicationProperty)

setProperty

public static final void setProperty(java.lang.String applicationProperty,
                                     java.lang.Object value,
                                     java.lang.Object domainKey)

getMapper

public static StateMonitor.Mapper getMapper(java.util.Map m)
Returns:
a Mapper object that simply wraps a Map object