net.infonode.properties.util
Class ValueHandlerProperty

java.lang.Object
  extended by net.infonode.properties.util.AbstractProperty
      extended by net.infonode.properties.util.ValueHandlerProperty
All Implemented Interfaces:
Property
Direct Known Subclasses:
BooleanProperty, BorderProperty, ButtonFactoryProperty, ColorProperty, ComponentPainterProperty, DimensionProviderProperty, DockingWindowActionProperty, DockingWindowTitleProviderProperty, DropFilterProperty, EnumProperty, FloatProperty, FontProperty, HoverListenerProperty, IconProperty, InsetsProperty, NumberProperty, PropertyGroupProperty, StringProperty

public class ValueHandlerProperty
extends AbstractProperty

Base class for properties that use a PropertyValueHandler.

Version:
$Revision: 1.6 $
Author:
$Author: jesper $

Field Summary
private  PropertyValueHandler valueHandler
           
 
Constructor Summary
ValueHandlerProperty(PropertyGroup group, java.lang.String name, java.lang.Class type, java.lang.String description, PropertyValueHandler valueHandler)
          Constructor.
 
Method Summary
 java.lang.Object getValue(java.lang.Object object)
          Returns the value of this property in a value container.
 void removeValue(java.lang.Object object)
          Removes the value of this property from an valueContainer.
 void setValue(java.lang.Object object, java.lang.Object value)
          Sets the value of this property in an object.
 boolean valueIsRemovable(java.lang.Object object)
          Returns true if the value of this property can be removed from the valueContainer.
 boolean valueIsSet(java.lang.Object object)
          Returns true if this property has a value in the valueContainer.
 
Methods inherited from class net.infonode.properties.util.AbstractProperty
canBeAssiged, getDescription, getGroup, getName, getType, isMutable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

valueHandler

private PropertyValueHandler valueHandler
Constructor Detail

ValueHandlerProperty

public ValueHandlerProperty(PropertyGroup group,
                            java.lang.String name,
                            java.lang.Class type,
                            java.lang.String description,
                            PropertyValueHandler valueHandler)
Constructor.

Parameters:
group - the property group
name - the property name
type - the property type
description - the property description
valueHandler - handles values for this property
Method Detail

setValue

public void setValue(java.lang.Object object,
                     java.lang.Object value)
Description copied from interface: Property
Sets the value of this property in an object.

Specified by:
setValue in interface Property
Overrides:
setValue in class AbstractProperty
Parameters:
object - the object to set the property value in
value - the value of the property

getValue

public java.lang.Object getValue(java.lang.Object object)
Description copied from interface: Property
Returns the value of this property in a value container.

Parameters:
object - the object containing the value
Returns:
the value of this property in an valueContainer, null if the container doesn't contain the value

valueIsRemovable

public boolean valueIsRemovable(java.lang.Object object)
Description copied from interface: Property
Returns true if the value of this property can be removed from the valueContainer.

Parameters:
object - the object from which to remove the value
Returns:
true if the value of this property can be removed from the valueContainer

removeValue

public void removeValue(java.lang.Object object)
Description copied from interface: Property
Removes the value of this property from an valueContainer.

Parameters:
object - the object in which to remove the value

valueIsSet

public boolean valueIsSet(java.lang.Object object)
Description copied from interface: Property
Returns true if this property has a value in the valueContainer.

Parameters:
object - the object that might contain the value
Returns:
true if this property has a value in the valueContainer