Classes | Public Member Functions | Protected Member Functions | Static Package Functions

cern.gp.nodes.impl.BeanNode Class Reference

Inheritance diagram for cern.gp.nodes.impl.BeanNode:
cern.gp.nodes.cache.Cacheable cern.gp.nodes.impl.GPBeanNode

List of all members.

Classes

class  Descriptor
class  GuiUpdaterIntrospector

Public Member Functions

Action getPreferredAction ()
Object getBean ()
void destroy () throws java.io.IOException
java.awt.Image getIcon (int type)
java.awt.Image getOpenedIcon (int type)
boolean hasCustomizer ()
java.awt.Component getCustomizer ()
void resetCache ()

Protected Member Functions

 BeanNode (Object bean, Children children) throws IntrospectionException
void createProperties (Object bean, BeanInfo info, PropertyInfo[] propertyInfo)
SystemAction[] createActions ()

Static Package Functions

 [static initializer]

Detailed Description

<font size="-1" color="#FF0000">**For internal use only** </font> Represents one JavaBean in the nodes hierarchy. It provides all methods that are needed for communication between the NetBeans platform and the bean.

You may use this node type for an already-existing JavaBean in order for its JavaBean properties to be reflected as corresponding node properties. Thus, it serves as a compatibility wrapper.

This BeanNode is based on a NodeUpdater that provides it the information it needs. BeanNode builds a NodeUpdater based on the introspection of the bean. Then it tries to register itself as PropertyChangeListener provided that the bean implements the method addPropertyChangeListener. In such a case, the BeanNode will receive the PropertyChangeEvent and update itself when needed.

Whether or not the BeanNode can register itself as PropertyChangeListener or receives any PropertyChangeEvent, it will still try to use the getters available through introspection to initialize itself. When a given getter is not available for a property needed by the node, the node will try to find a default value in the BeanInfo.

To see the property this node is interested in, see the class cern.gp.beans.IntrospectionBasedNodeUpdater.

See also:
cern.gp.beans.impl.NodeUpdater
cern.gp.beans.impl.NodeUpdaterProvider
cern.gp.beans.impl.IntrospectionBasedNodeUpdater
Author:
Lionel Mestre

Constructor & Destructor Documentation

cern.gp.nodes.impl.BeanNode.BeanNode ( Object  bean,
Children  children 
) throws IntrospectionException [protected]

Constructs a node for a JavaBean with a defined child list. Intended for use by subclasses with different strategies for computing the children.

Parameters:
bean the bean this node will be based on
children the children of this node
Exceptions:
IntrospectionException if the bean cannot be analyzed

Member Function Documentation

cern.gp.nodes.impl.BeanNode.[static initializer] (  )  [static, package]
SystemAction [] cern.gp.nodes.impl.BeanNode.createActions (  )  [protected]

Returns the actions that shall be displayed in the pop-up menu for this node. This method is called by Netbeans Explorer to build the pop-up menu for this node. It uses the BeanInfo associated with the contained bean for finding the actions.

void cern.gp.nodes.impl.BeanNode.createProperties ( Object  bean,
BeanInfo  info,
PropertyInfo[]  propertyInfo 
) [protected]

Prepare node properties based on the bean, storing them into the current property sheet. Called when the bean info is ready. This implementation always creates a set for standard properties and may create a set for expert ones if there are any.

See also:
org.openide.nodes.BeanNode.computeProperties
Parameters:
bean bean to compute properties for
info information about the bean
propertyInfo extra information of some properties (possibly null)
void cern.gp.nodes.impl.BeanNode.destroy (  )  throws java.io.IOException

Detaches all listeners from the bean and destroys it.

Exceptions:
IOException if there was a problem
Object cern.gp.nodes.impl.BeanNode.getBean (  ) 
java.awt.Component cern.gp.nodes.impl.BeanNode.getCustomizer (  ) 

Returns the customizer component.

Returns:
the component or null if there is no customizer
java.awt.Image cern.gp.nodes.impl.BeanNode.getIcon ( int  type  ) 

Get an icon for this node in the closed state. Uses the Bean's icon if possible.

Parameters:
type constant from java.beans.BeanInfo
Returns:
icon to use

Referenced by cern.gp.nodes.impl.BeanNode.getOpenedIcon().

java.awt.Image cern.gp.nodes.impl.BeanNode.getOpenedIcon ( int  type  ) 

Get an icon for this node in the open state.

Parameters:
type type constants
Returns:
icon to use. The default implementation just uses getIcon(int).

References cern.gp.nodes.impl.BeanNode.getIcon().

Action cern.gp.nodes.impl.BeanNode.getPreferredAction (  ) 
boolean cern.gp.nodes.impl.BeanNode.hasCustomizer (  ) 

Test if there is a customizer for this node. If true the customizer can be obtained via getCustomizer method.

Returns:
true if there is a customizer.
void cern.gp.nodes.impl.BeanNode.resetCache (  ) 

reset the cache for this Node. As a result the node will reset the cache of all its properties.

Implements cern.gp.nodes.cache.Cacheable.


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