Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

cern::gp::beans::impl::IntrospectionBasedNodeUpdater Class Reference

Inheritance diagram for cern::gp::beans::impl::IntrospectionBasedNodeUpdater:

Inheritance graph
[legend]
Collaboration diagram for cern::gp::beans::impl::IntrospectionBasedNodeUpdater:

Collaboration graph
[legend]
List of all members.

Public Member Functions

boolean isPropertyHidden (PropertyDescriptor propertyDescriptor)
String getName ()
String getDisplayName ()
String getShortDescription ()
java.awt.Image getNodeIcon ()
String getNodeDefaultAction ()
String[] getNodeActions ()
Boolean getNodePropertiesCacheable ()
PropertyInfo[] getPropertyInfo ()

Protected Member Functions

 IntrospectionBasedNodeUpdater (Object bean) throws IntrospectionException
 IntrospectionBasedNodeUpdater (Object bean, BeanInfo beanInfo) throws IntrospectionException
 IntrospectionBasedNodeUpdater (Object bean, BeanInfo beanInfo, Class targetClass) throws IntrospectionException
abstract void firePropertyChange (String propertyName, Object oldValue, Object newValue)
abstract void fireNameChange (String newName)
abstract void fireDisplayNameChange (String newDisplayName)
abstract void fireShortDescriptionChange (String newShortDescription)
abstract void fireNodeDefaultActionChange (String newDefaultAction)
abstract void fireNodeIconChange (java.awt.Image newIcon)
final void removePropertyChangeListener ()
final boolean hasRegisteredListener ()

Private Member Functions

final void initialize (Object bean, BeanInfo beanInfo, Class targetClass)
void findPropertyChangeListenerMethods ()
final String getStringFromGetterMethod (Method getterMethod)
final Object getObjectFromGetterMethod (Method getterMethod)

Static Private Member Functions

Method findGetterMethod (Class beanClass, InternalPropertyDescriptor propertyDesc)

Private Attributes

Method _nameGetter
Method _displayNameGetter
Method _shortDescriptionGetter
Method _nodeIconGetter
Method _nodeDefaultActionGetter
Method _nodeActionsGetter
Method _nodePropertiesCacheableGetter
Method _propertyInfoGetter
boolean _shouldHideName
boolean _shouldHideDisplayName
boolean _shouldHideShortDescription
Method _removePropertyChangeListenerMethod
PropertyChangeListener _propertyChangeListener
Object _bean
BeanInfo _beanInfo
boolean _hasRegisteredListener

Static Private Attributes

final InternalPropertyDescriptor NAME_DESC
final InternalPropertyDescriptor DISPLAYNAME_DESC
final InternalPropertyDescriptor SHORTDESCRIPTION_DESC
final InternalPropertyDescriptor NODE_ICON_DESC
final InternalPropertyDescriptor NODE_DEFAULT_ACTION_DESC
final InternalPropertyDescriptor NODE_ACTIONS_DESC
final InternalPropertyDescriptor NODE_PROPERTIES_CACHEABLE_DESC
final InternalPropertyDescriptor PROPERTY_INFO_DESC
final Class[] EMPTY_CLASS_ARRAY = new Class[0]

Detailed Description

<font size="-1" color="#FF0000">**For internal use only** </font> Provides support for implementing a NodeUpdater based on introspection.

For beans that do not implement any interface we use the JavaBeans specification for doing the introspection of the properties we are interested in. Those properties should have at least an associated getter. The list of properties we look for is defined by the GPBean interface.

This NodeUpdater also supports the BeanInfo tagging done through the BeanTagger class. Tagging a BeanInfo allows to add information that is not directly supported by the BeanInfo. Three tags are recognized by BeanNode :

Version:
Revision
1.3
Date
2006/09/25 08:52:36
Author:
Lionel Mestre


Constructor & Destructor Documentation

cern::gp::beans::impl::IntrospectionBasedNodeUpdater::IntrospectionBasedNodeUpdater Object  bean  )  throws IntrospectionException [inline, protected]
 

Creates a new GuiUpdaterIntrospector

cern::gp::beans::impl::IntrospectionBasedNodeUpdater::IntrospectionBasedNodeUpdater Object  bean,
BeanInfo  beanInfo
throws IntrospectionException [inline, protected]
 

Creates a new GuiUpdaterIntrospector

cern::gp::beans::impl::IntrospectionBasedNodeUpdater::IntrospectionBasedNodeUpdater Object  bean,
BeanInfo  beanInfo,
Class  targetClass
throws IntrospectionException [inline, protected]
 

Creates a new GuiUpdaterIntrospector


Member Function Documentation

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::findGetterMethod Class  beanClass,
InternalPropertyDescriptor  propertyDesc
[inline, static, private]
 

Finds getter methods for the given getter name. The return type of the getter must be of type String

void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::findPropertyChangeListenerMethods  )  [inline, private]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::fireDisplayNameChange String  newDisplayName  )  [protected, pure virtual]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::fireNameChange String  newName  )  [protected, pure virtual]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::fireNodeDefaultActionChange String  newDefaultAction  )  [protected, pure virtual]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::fireNodeIconChange java.awt.Image  newIcon  )  [protected, pure virtual]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::firePropertyChange String  propertyName,
Object  oldValue,
Object  newValue
[protected, pure virtual]
 

abstract void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::fireShortDescriptionChange String  newShortDescription  )  [protected, pure virtual]
 

String cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getDisplayName  )  [inline]
 

Returns the internal display name of the associated bean. If null is returned a default name will be used.

  • Property name : displayName
  • Visibility : normal (visible in a property sheet)
  • Default value (when null is returned from this method) : if getName() is available it is used instead of getDisplayName(), else beanInfo.getBeanDescriptor().getDisplayName() is used
Returns:
the internal display name of the associated bean or null

Implements cern::gp::beans::GPBean.

String cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getName  )  [inline]
 

Returns the internal name of the associated bean. If null is returned a default name will be used.

  • Property name : name
  • Visibility : normal (visible in a property sheet)
  • Default value (when null is returned from this method) : a unique name generated using BeanUtils. generateUniqueBeanName()
Returns:
the internal name of the associated bean or null.

Implements cern::gp::beans::GPBean.

String [] cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getNodeActions  )  [inline]
 

Returns an array of qualified name of actions for the node representing the associated bean. Null can be used in the array to represent a separator.

  • Property name : nodeActions
  • Visibility : hidden (not visible in a property sheet)
  • Default value (when null is returned from this method) : use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.getActions(beanInfo.getBeanDescriptor())
Returns:
an array of qualified name of actions for a node representing the bean.

Implements cern::gp::beans::GPBean.

String cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getNodeDefaultAction  )  [inline]
 

Returns the qualified name of the default action for the node representing the associated bean. The default action is the one triggered when the user double-clic on the node. If null is returned a default default action will be used.

  • Property name : nodeDefaultAction
  • Visibility : hidden
  • Default value (when null is returned from this method) : use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.getDefaultAction(beanInfo.getBeanDescriptor())
Returns:
the qualified name of the default action for the node or null representing the associated bean.

Implements cern::gp::beans::GPBean.

java.awt.Image cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getNodeIcon  )  [inline]
 

Returns the icon in 16x16 size used to display the node representing the associated bean. If null is returned a default icon will be used.

  • Property name : nodeIcon
  • Visibility : hidden (not visible in a property sheet)
  • Default value (when null is returned from this method) : beanInfo.getIcon()
Returns:
the icon in 16x16 size used to display the node representing the associated bean or null

Implements cern::gp::beans::GPBean.

Boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getNodePropertiesCacheable  )  [inline]
 

Returns true if the value of the properties can be cached in the node, false if they cannot or null if no behavior is specified. The default behavior is not to cache the value of the properties.

If the value of a property is not cached, the getter method will be invoked whenever the node need to get the value of the property.

If the value of the property is cached, the getter method for the property will only be invoked once to read the value. Then, whenever the node need the value of the property it will used the cached one until a PropertyChangeEvent for the property (or for all properties) is fired.

Caching values can improve performance greatly but it adds one more responsibility on the developer who has to fire PropertyChangeEvent whenever the property values change.

This property gives the caching strategy for all properties. It is possible to override the bean level caching strategy at the property level by using the property information getPropertyInformation().

  • Property name : nodePropertiesCacheable
  • Visibility : hidden (not visible in a property sheet)
  • Default value (when null is returned from this method) : use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.isCacheable(beanInfo.getBeanDescriptor())
Returns:
true is the value of the properties can be cached in the node, false else or null for default behavior

Implements cern::gp::beans::GPBean.

final Object cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getObjectFromGetterMethod Method  getterMethod  )  [inline, private]
 

PropertyInfo [] cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getPropertyInfo  )  [inline]
 

Returns an array of PropertyInfo specifying information on some properties.

Each PropertyInfo of this array defines information for one property of this bean. Defining a PropertyInfo for a given property is usefull when there is no explicit BeanInfo for the bean and when the property have non default characteristics such as, for instance, a specific PropertyEditor.

  • Property name : propertyInfo
  • Visibility : hidden (not visible in a property sheet)
  • Default value (when null is returned from this method) : use PropertyDescriptors from BeanInfo
Returns:
true is the value of the properties can be cached in the node, false else or null for default behavior

Implements cern::gp::beans::GPBean.

String cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getShortDescription  )  [inline]
 

Returns a short description of the associated bean (used in tooltip for instance). If null is returned a default description will be used.

  • Property name : shortDescription
  • Visibility : normal (visible in a property sheet)
  • Default value (when null is returned from this method) : beanInfo.getBeanDescriptor(). getShortDescription()
Returns:
a short description of the associated bean or null

Implements cern::gp::beans::GPBean.

final String cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getStringFromGetterMethod Method  getterMethod  )  [inline, private]
 

final boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::hasRegisteredListener  )  [inline, protected]
 

final void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::initialize Object  bean,
BeanInfo  beanInfo,
Class  targetClass
[inline, private]
 

boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::isPropertyHidden PropertyDescriptor  propertyDescriptor  )  [inline]
 

Returns whether or not the property having the given PropertyDescriptor is a property supported by this introspector that should automatically be hidden. In the case the property is supported and should not be hidden, the PropertyDescriptor will be updated with the display name of the property.

Parameters:
propertyName the property name to check
Returns:
true if the property is automatically hidden false else

final void cern::gp::beans::impl::IntrospectionBasedNodeUpdater::removePropertyChangeListener  )  [inline, protected]
 


Member Data Documentation

Object cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_bean [private]
 

bean

BeanInfo cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_beanInfo [private]
 

bean info

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_displayNameGetter [private]
 

boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_hasRegisteredListener [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_nameGetter [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_nodeActionsGetter [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_nodeDefaultActionGetter [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_nodeIconGetter [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_nodePropertiesCacheableGetter [private]
 

PropertyChangeListener cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_propertyChangeListener [private]
 

listener for properties

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_propertyInfoGetter [private]
 

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_removePropertyChangeListenerMethod [private]
 

remove PropertyChangeListener method

Method cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_shortDescriptionGetter [private]
 

boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_shouldHideDisplayName [private]
 

boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_shouldHideName [private]
 

boolean cern::gp::beans::impl::IntrospectionBasedNodeUpdater::_shouldHideShortDescription [private]
 

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::DISPLAYNAME_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.DISPLAYNAME_PROPERTY_NAME, "getDisplayName", String.class)

final Class [] cern::gp::beans::impl::IntrospectionBasedNodeUpdater::EMPTY_CLASS_ARRAY = new Class[0] [static, private]
 

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::NAME_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.NAME_PROPERTY_NAME, "getName", String.class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::NODE_ACTIONS_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.NODE_ACTIONS_PROPERTY_NAME, "getNodeActions", String[].class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::NODE_DEFAULT_ACTION_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.NODE_DEFAULT_ACTION_PROPERTY_NAME, "getNodeDefaultAction", String.class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::NODE_ICON_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.NODE_ICON_PROPERTY_NAME, "getNodeIcon", java.awt.Image.class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::NODE_PROPERTIES_CACHEABLE_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor( GPBean.NODE_PROPERTIES_CACHEABLE_PROPERTY_NAME, "getNodePropertiesCacheable", Boolean.class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::PROPERTY_INFO_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.PROPERTY_INFO_PROPERTY_NAME, "getPropertyInfo", PropertyInfo[].class)

final InternalPropertyDescriptor cern::gp::beans::impl::IntrospectionBasedNodeUpdater::SHORTDESCRIPTION_DESC [static, private]
 

Initial value:

new InternalPropertyDescriptor(GPBean.SHORTDESCRIPTION_PROPERTY_NAME, "getShortDescription", String.class)


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:08:18 2009 for ACS Java API by doxygen 1.3.8