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 () |
<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
:
BeanTagger.getActions()
to get the actions for this node. By default no action is added. BeanTagger.getDefaultAction()
to get the default action for this node. By default the Property action is used. BeanTagger.isCacheable()
to get whether the value of the properties of the bean can be cached or not. 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
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.
displayName
normal (visible in a property sheet)
if getName() is available it is used instead of getDisplayName(), else beanInfo.getBeanDescriptor().getDisplayName() is used
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.
name
normal (visible in a property sheet)
a unique name generated using BeanUtils. generateUniqueBeanName()
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.
nodeActions
hidden (not visible in a property sheet)
use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.getActions(beanInfo.getBeanDescriptor())
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.
nodeDefaultAction
hidden
use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.getDefaultAction(beanInfo.getBeanDescriptor())
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.
nodeIcon
hidden (not visible in a property sheet)
beanInfo.getIcon()
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()
.
nodePropertiesCacheable
hidden (not visible in a property sheet)
use the possible tagging of the BeanDescriptor of the BeanInfo : BeanTagger.isCacheable(beanInfo.getBeanDescriptor())
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
.
propertyInfo
hidden (not visible in a property sheet)
use PropertyDescriptors from BeanInfo
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.
shortDescription
normal (visible in a property sheet)
beanInfo.getBeanDescriptor(). getShortDescription()
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.
propertyName | the property name to check |
final void cern.gp.beans.impl.IntrospectionBasedNodeUpdater.removePropertyChangeListener | ( | ) | [protected] |