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

cern::gp::nodes::impl::BeanNode Class Reference

Inheritance diagram for cern::gp::nodes::impl::BeanNode:

Inheritance graph
[legend]
Collaboration diagram for cern::gp::nodes::impl::BeanNode:

Collaboration graph
[legend]
List of all members.

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]

Private Member Functions

void resetCache (String propertyName)
void resetCache (Sheet.Set sheetSet)
void resetCache (Sheet.Set sheetSet, String propertyName)
void hideUnwantedPropertyDescriptors ()
void initialization () throws IntrospectionException
SystemAction getDefaultActionInstance (String defaultAction)

Static Private Member Functions

Node.Property createIndexedNodeProperty (Object bean, IndexedPropertyDescriptor p, CachingStrategy strategy)
Node.Property createNodeProperty (Object bean, PropertyDescriptor p, CachingStrategy strategy)
CachingStrategy createCachingStrategy (Boolean beanCacheable, Boolean propertyCacheable)
Descriptor computeProperties (Object bean, BeanInfo info, boolean ignoreHiddenProperties, Boolean nodePropertiesCacheable, PropertyInfo[] propertyInfo)
PropertyInfo findPropertyInfoByName (PropertyInfo[] propertyInfo, String propName)
void exception (Throwable e)
void warning (Throwable e)
void initializeCookieSet (Object bean, CookieSet cookieSet)
final Node.Cookie createInstanceCookie (final Object o)
final java.awt.Dialog createDialog (Object o)
void attachCustomizer (Node node, java.beans.Customizer cust)

Private Attributes

java.awt.Image _iconColor16
Object _bean
BeanInfo _beanInfo
GuiUpdaterIntrospector _guiUpdater
Boolean _nodePropertiesCacheable
SystemAction _defaultAction

Static Private Attributes

final CachingStrategy DEFAULT_CACHING_STRATEGY = new NoCachingStrategy()
final String ICON_BASE = "org/openide/resources/beans"
final Node.Property[] EMPTY_NODE_PROPERTY_ARRAY = new Node.Property[0]

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 [inline, 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]  )  [inline, static, package]
 

void cern::gp::nodes::impl::BeanNode::attachCustomizer Node  node,
java.beans.Customizer  cust
[inline, static, private]
 

Attaches a customizer to given node.

Parameters:
node the bean node
cust customizer to attach

Descriptor cern::gp::nodes::impl::BeanNode::computeProperties Object  bean,
BeanInfo  info,
boolean  ignoreHiddenProperties,
Boolean  nodePropertiesCacheable,
PropertyInfo[]  propertyInfo
[inline, static, private]
 

Computes a descriptor for properties from a bean info.

Parameters:
bean bean to create properties for
info about the bean
ignoreHiddenProperties true if hidden property should be ignored completely
propertyInfo extra information of some properties (possibly null)
Returns:
three property lists

SystemAction [] cern::gp::nodes::impl::BeanNode::createActions  )  [inline, 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.

CachingStrategy cern::gp::nodes::impl::BeanNode::createCachingStrategy Boolean  beanCacheable,
Boolean  propertyCacheable
[inline, static, private]
 

final java.awt.Dialog cern::gp::nodes::impl::BeanNode::createDialog Object  o  )  [inline, static, private]
 

Checks whether an object is instance of DialogDescriptor and if so it used top manager to create its instance.

Parameters:
maybeDialogDescriptor an object
Returns:
a dialog or null

Node.Property cern::gp::nodes::impl::BeanNode::createIndexedNodeProperty Object  bean,
IndexedPropertyDescriptor  p,
CachingStrategy  strategy
[inline, static, private]
 

final Node.Cookie cern::gp::nodes::impl::BeanNode::createInstanceCookie final Object  o  )  [inline, static, private]
 

Creates InstanceCookie, if available.

Parameters:
bean the object to create cookie for
Returns:
Node.Cookie or null

Node.Property cern::gp::nodes::impl::BeanNode::createNodeProperty Object  bean,
PropertyDescriptor  p,
CachingStrategy  strategy
[inline, static, private]
 

void cern::gp::nodes::impl::BeanNode::createProperties Object  bean,
BeanInfo  info,
PropertyInfo[]  propertyInfo
[inline, 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 [inline]
 

Detaches all listeners from the bean and destroys it.

Exceptions:
IOException if there was a problem

void cern::gp::nodes::impl::BeanNode::exception Throwable  e  )  [inline, static, private]
 

PropertyInfo cern::gp::nodes::impl::BeanNode::findPropertyInfoByName PropertyInfo[]  propertyInfo,
String  propName
[inline, static, private]
 

Object cern::gp::nodes::impl::BeanNode::getBean  )  [inline]
 

java.awt.Component cern::gp::nodes::impl::BeanNode::getCustomizer  )  [inline]
 

Returns the customizer component.

Returns:
the component or null if there is no customizer

SystemAction cern::gp::nodes::impl::BeanNode::getDefaultActionInstance String  defaultAction  )  [inline, private]
 

java.awt.Image cern::gp::nodes::impl::BeanNode::getIcon int  type  )  [inline]
 

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

java.awt.Image cern::gp::nodes::impl::BeanNode::getOpenedIcon int  type  )  [inline]
 

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

Action cern::gp::nodes::impl::BeanNode::getPreferredAction  )  [inline]
 

boolean cern::gp::nodes::impl::BeanNode::hasCustomizer  )  [inline]
 

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::hideUnwantedPropertyDescriptors  )  [inline, private]
 

void cern::gp::nodes::impl::BeanNode::initialization  )  throws IntrospectionException [inline, private]
 

Performs initalization of the node

void cern::gp::nodes::impl::BeanNode::initializeCookieSet Object  bean,
CookieSet  cookieSet
[inline, static, private]
 

Initializes the CookieSet with the corresponding Capability available from the bean directly or through a CapabilityProvider

Parameters:
bean the bean from which to find the capabilities
cookieSet the cookie set to update

void cern::gp::nodes::impl::BeanNode::resetCache Sheet.Set  sheetSet,
String  propertyName
[inline, private]
 

void cern::gp::nodes::impl::BeanNode::resetCache Sheet.Set  sheetSet  )  [inline, private]
 

void cern::gp::nodes::impl::BeanNode::resetCache String  propertyName  )  [inline, private]
 

void cern::gp::nodes::impl::BeanNode::resetCache  )  [inline]
 

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

void cern::gp::nodes::impl::BeanNode::warning Throwable  e  )  [inline, static, private]
 


Member Data Documentation

Object cern::gp::nodes::impl::BeanNode::_bean [private]
 

bean

BeanInfo cern::gp::nodes::impl::BeanNode::_beanInfo [private]
 

bean info for the bean

SystemAction cern::gp::nodes::impl::BeanNode::_defaultAction [private]
 

GuiUpdaterIntrospector cern::gp::nodes::impl::BeanNode::_guiUpdater [private]
 

java.awt.Image cern::gp::nodes::impl::BeanNode::_iconColor16 [private]
 

cached value of the icon when changed

Boolean cern::gp::nodes::impl::BeanNode::_nodePropertiesCacheable [private]
 

final CachingStrategy cern::gp::nodes::impl::BeanNode::DEFAULT_CACHING_STRATEGY = new NoCachingStrategy() [static, private]
 

final Node.Property [] cern::gp::nodes::impl::BeanNode::EMPTY_NODE_PROPERTY_ARRAY = new Node.Property[0] [static, private]
 

final String cern::gp::nodes::impl::BeanNode::ICON_BASE = "org/openide/resources/beans" [static, private]
 

Icon base for bean nodes


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