org.openide.explorer.propertysheet
Class DefaultPropertyModel

java.lang.Object
  |
  +--org.openide.explorer.propertysheet.DefaultPropertyModel
All Implemented Interfaces:
EventListener, ExPropertyModel, PropertyChangeListener, PropertyModel

public class DefaultPropertyModel
extends Object
implements ExPropertyModel, PropertyChangeListener

The default implementation of PropertyModel interface. It takes the bean instance and the property name which should be accessed through PropertyModel methods. We now implement the new ExPropertyModel interface (which extends PropertyModel).


Fields inherited from interface org.openide.explorer.propertysheet.PropertyModel
PROP_VALUE
 
Constructor Summary
DefaultPropertyModel(Object bean, String propertyName)
          Creates new DefaultPropertyModel.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds listener to change of the value.
 Object[] getBeans()
          Returns an array of beans/nodes that this property belongs to.
 FeatureDescriptor getFeatureDescriptor()
          Returns descriptor describing the property.
 Class getPropertyEditorClass()
          The class of the property editor or null if default property editor should be used.
 Class getPropertyType()
          The class of the property.
 Object getValue()
          Getter for current value of a property.
 void propertyChange(PropertyChangeEvent evt)
          Implementation of PropertyChangeListener method
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes listener to change of the value.
 void setValue(Object v)
          Setter for a value of a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPropertyModel

public DefaultPropertyModel(Object bean,
                            String propertyName)
                     throws IllegalArgumentException
Creates new DefaultPropertyModel.
Parameters:
bean - the java bean to be introspected
propertyName - name of the property
Throws:
IllegalArgumentException - if there is any problem with the parameters (introspection of bean,...)
Method Detail

getPropertyType

public Class getPropertyType()
Description copied from interface: PropertyModel
The class of the property.
Specified by:
getPropertyType in interface PropertyModel
Returns:
the class of the property.

getValue

public Object getValue()
                throws InvocationTargetException
Getter for current value of a property.
Specified by:
getValue in interface PropertyModel

setValue

public void setValue(Object v)
              throws InvocationTargetException
Setter for a value of a property.
Specified by:
setValue in interface PropertyModel
Parameters:
v - the value

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Adds listener to change of the value.
Specified by:
addPropertyChangeListener in interface PropertyModel

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes listener to change of the value.
Specified by:
removePropertyChangeListener in interface PropertyModel

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Implementation of PropertyChangeListener method
Specified by:
propertyChange in interface PropertyChangeListener

getPropertyEditorClass

public Class getPropertyEditorClass()
The class of the property editor or null if default property editor should be used.
Specified by:
getPropertyEditorClass in interface PropertyModel

getBeans

public Object[] getBeans()
Returns an array of beans/nodes that this property belongs to. Implements the method from ExPropertyModel interface.
Specified by:
getBeans in interface ExPropertyModel

getFeatureDescriptor

public FeatureDescriptor getFeatureDescriptor()
Returns descriptor describing the property. Implements the method from ExPropertyModel interface.
Specified by:
getFeatureDescriptor in interface ExPropertyModel


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.