站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.0

DefaultPropertyModel (NetBeans Explorer API) - NetBeans API Javadoc 5.5.0

org.openide.explorer 6.5.22 1

org.openide.explorer.propertysheet
Class DefaultPropertyModel

java.lang.Object
  extended by org.openide.explorer.propertysheet.DefaultPropertyModel
All Implemented Interfaces:
PropertyChangeListener, EventListener, ExPropertyModel, PropertyModel

Deprecated. Use org.openide.nodes.PropertySupport.Reflection instead

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).


Field Summary
 
Fields inherited from interface org.openide.explorer.propertysheet.PropertyModel
PROP_VALUE
 
Constructor Summary
DefaultPropertyModel(Object bean, PropertyDescriptor descr)
          Deprecated. Creates new DefaultPropertyModel with provided specific PropertyDescriptor.
DefaultPropertyModel(Object bean, String propertyName)
          Deprecated. Creates new DefaultPropertyModel.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Deprecated. Adds listener to change of the value.
 Object[] getBeans()
          Deprecated. Returns an array of beans/nodes that this property belongs to.
 FeatureDescriptor getFeatureDescriptor()
          Deprecated. Returns descriptor describing the property.
 Class getPropertyEditorClass()
          Deprecated. The class of the property editor or null if default property editor should be used.
 Class getPropertyType()
          Deprecated. The class of the property.
 Object getValue()
          Deprecated. Getter for current value of a property.
 void propertyChange(PropertyChangeEvent evt)
          Deprecated. Implementation of PropertyChangeListener method
 void removePropertyChangeListener(PropertyChangeListener l)
          Deprecated. Removes listener to change of the value.
 void setValue(Object v)
          Deprecated. 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
Deprecated. 
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,...)

DefaultPropertyModel

public DefaultPropertyModel(Object bean,
                            PropertyDescriptor descr)
Deprecated. 
Creates new DefaultPropertyModel with provided specific PropertyDescriptor. This can be useful if one needs to set to provide specific attributes to the property editor.
 PropertyDescriptor pd = new PropertyDescriptor ("myProperty", bean.getClass ());
 pd.setPropertyEditorClass (PropertyEditorManager.findEditor (Object.class));

 // special attributes to the property editor
 pb.setValue ("superClass", MyProperty.class);


 model = new DefaultPropertyModel (bean, pd);
 panel = new PropertyPanel (model);
 
This constructor replaces the default use of BeanInfo and that is why simplifies the use of ExPropertyEditors.

Parameters:
bean - the java bean to be introspected
descr - the property descriptor of the property to use
Since:
2.4
Method Detail

getPropertyType

public Class getPropertyType()
Deprecated. 
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
Deprecated. 
Getter for current value of a property.

Specified by:
getValue in interface PropertyModel
Returns:
the value
Throws:
InvocationTargetException - if, for example, the getter method cannot be accessed

setValue

public void setValue(Object v)
              throws InvocationTargetException
Deprecated. 
Setter for a value of a property.

Specified by:
setValue in interface PropertyModel
Parameters:
v - the value
Throws:
InvocationTargetException

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Deprecated. 
Adds listener to change of the value.

Specified by:
addPropertyChangeListener in interface PropertyModel

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Deprecated. 
Removes listener to change of the value.

Specified by:
removePropertyChangeListener in interface PropertyModel

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Deprecated. 
Implementation of PropertyChangeListener method

Specified by:
propertyChange in interface PropertyChangeListener

getPropertyEditorClass

public Class getPropertyEditorClass()
Deprecated. 
The class of the property editor or null if default property editor should be used.

Specified by:
getPropertyEditorClass in interface PropertyModel
Returns:
the class of PropertyEditor that should be used to edit this PropertyModel

getBeans

public Object[] getBeans()
Deprecated. 
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()
Deprecated. 
Returns descriptor describing the property. Implements the method from ExPropertyModel interface.

Specified by:
getFeatureDescriptor in interface ExPropertyModel

org.openide.explorer 6.5.22 1

Built on May 28 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.