com.miginfocom.util
Interface PropertyConsumer

All Superinterfaces:
PropertyProvider
All Known Subinterfaces:
Activity, AdjustingPropertyConsumer
All Known Implementing Classes:
AbstractActivity, Category, DefaultActivity, DemoDataBean, PropertyConsumerMap

public interface PropertyConsumer
extends PropertyProvider

Interface to implement if an object can have properties.


Method Summary
 java.lang.Object removeProperty(PropertyKey property, java.lang.Boolean fireChangeEvent)
          Removes the property.
 java.lang.Object removePropertySilent(PropertyKey property, java.lang.Boolean fireChangeEvent)
          Convenience method for removeProperty(com.miginfocom.util.PropertyKey, Boolean) that catches the PropertyVetoException.
 java.lang.Object setProperty(PropertyKey property, java.lang.Object prop, java.lang.Boolean fireChangeEvent)
          Sets a property for this object.
 java.lang.Object setPropertySilent(PropertyKey property, java.lang.Object prop, java.lang.Boolean fireChangeEvent)
          Convenience method for setProperty(com.miginfocom.util.PropertyKey, Object, Boolean) that catches the PropertyVetoException.
 
Methods inherited from interface com.miginfocom.util.PropertyProvider
containsProperty, getProperty
 

Method Detail

setProperty

java.lang.Object setProperty(PropertyKey property,
                             java.lang.Object prop,
                             java.lang.Boolean fireChangeEvent)
                             throws java.beans.PropertyVetoException
Sets a property for this object.

Note that if the PropertyKey defines a value class type it should be checked in this setter and an ClassCastException is thrown if prop the wrong class type.

Parameters:
property - The property key that denotes the property. Not null.
prop - The property to set for this object.
fireChangeEvent - If Boolean.TRUE fires a change event. If Boolean.FALSE don't fire and if null the old and new object is checked for equality (with .equals()) and fires a change if they differ.
Returns:
The old object, may be null.
Throws:
java.beans.PropertyVetoException - If the property couldn't be set on this for some reason.

setPropertySilent

java.lang.Object setPropertySilent(PropertyKey property,
                                   java.lang.Object prop,
                                   java.lang.Boolean fireChangeEvent)
Convenience method for setProperty(com.miginfocom.util.PropertyKey, Object, Boolean) that catches the PropertyVetoException.

It is required that this method is implemented in the setProperty(com.miginfocom.util.PropertyKey, Object, Boolean).

Note that if the PropertyKey defines a value class type it should be checked in this setter and an ClassCastException is thrown if prop the wrong class type.

Parameters:
property - The property key that denotes the property. Not null.
prop - The property to set for this object.
fireChangeEvent - If Boolean.TRUE fires a change event. If Boolean.FALSE don't fire and if null the old and new object is checked for equality (with .equals()) and fires a change if they differ.
Returns:
The old object, may be null.

removeProperty

java.lang.Object removeProperty(PropertyKey property,
                                java.lang.Boolean fireChangeEvent)
                                throws java.beans.PropertyVetoException
Removes the property.

Parameters:
property - The property key that denotes the property. Not null.
fireChangeEvent - If Boolean.TRUE fires a change event. If Boolean.FALSE don't fire and if null fires a change if the key existed before this call.
Returns:
The Old object. null both is null was stored or if the key did not exist in the provider.
Throws:
java.beans.PropertyVetoException - If the property couldn't be set on this for some reason.

removePropertySilent

java.lang.Object removePropertySilent(PropertyKey property,
                                      java.lang.Boolean fireChangeEvent)
Convenience method for removeProperty(com.miginfocom.util.PropertyKey, Boolean) that catches the PropertyVetoException.

It is required that this method is implemented in the setProperty(com.miginfocom.util.PropertyKey, Object, Boolean).

Parameters:
property - The property key that denotes the property. Not null.
fireChangeEvent - If Boolean.TRUE fires a change event. If Boolean.FALSE don't fire and if null fires a change if the key existed before this call.
Returns:
The Old object. null both is null was stored or if the key did not exist in the provider.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.