Classes | Public Member Functions | Protected Member Functions

cern.gp.beans.impl.IntrospectionBasedNodeUpdater Class Reference

Inheritance diagram for cern.gp.beans.impl.IntrospectionBasedNodeUpdater:
cern.gp.beans.impl.NodeUpdater cern.gp.beans.GPBean

List of all members.

Classes

class  InternalPropertyDescriptor
class  PropertyChangeListenerImpl

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

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 [protected]

Creates a new GuiUpdaterIntrospector

cern.gp.beans.impl.IntrospectionBasedNodeUpdater.IntrospectionBasedNodeUpdater ( Object  bean,
BeanInfo  beanInfo 
) throws IntrospectionException [protected]

Creates a new GuiUpdaterIntrospector

cern.gp.beans.impl.IntrospectionBasedNodeUpdater.IntrospectionBasedNodeUpdater ( Object  bean,
BeanInfo  beanInfo,
Class  targetClass 
) throws IntrospectionException [protected]

Creates a new GuiUpdaterIntrospector


Member Function Documentation

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

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

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

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

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

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

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.

PropertyInfo [] cern.gp.beans.impl.IntrospectionBasedNodeUpdater.getPropertyInfo (  ) 

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

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 boolean cern.gp.beans.impl.IntrospectionBasedNodeUpdater.hasRegisteredListener (  )  [protected]
boolean cern.gp.beans.impl.IntrospectionBasedNodeUpdater.isPropertyHidden ( PropertyDescriptor  propertyDescriptor  ) 

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 (  )  [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties