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.

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]

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

static Node.Property createIndexedNodeProperty (Object bean, IndexedPropertyDescriptor p, CachingStrategy strategy)
static Node.Property createNodeProperty (Object bean, PropertyDescriptor p, CachingStrategy strategy)
static CachingStrategy createCachingStrategy (Boolean beanCacheable, Boolean propertyCacheable)
static Descriptor computeProperties (Object bean, BeanInfo info, boolean ignoreHiddenProperties, Boolean nodePropertiesCacheable, PropertyInfo[] propertyInfo)
static PropertyInfo findPropertyInfoByName (PropertyInfo[] propertyInfo, String propName)
static void exception (Throwable e)
static void warning (Throwable e)
static void initializeCookieSet (Object bean, CookieSet cookieSet)
static final Node.Cookie createInstanceCookie (final Object o)
static final java.awt.Dialog createDialog (Object o)
static 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

static final CachingStrategy DEFAULT_CACHING_STRATEGY = new NoCachingStrategy()
static final String ICON_BASE = "org/openide/resources/beans"
static 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

References _bean, and initialization().


Member Function Documentation

cern::gp::nodes::impl::BeanNode::[static initializer] (  )  [inline, static, package]
static 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

Referenced by getCustomizer().

static 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

References createCachingStrategy(), createIndexedNodeProperty(), createNodeProperty(), findPropertyInfoByName(), and cern::gp::beans::PropertyInfo::updatePropertyDescriptor().

Referenced by createProperties().

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.

References _bean, _guiUpdater, cern::gp::beans::impl::IntrospectionBasedNodeUpdater::getNodeActions(), and warning().

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

Referenced by computeProperties().

static 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

Referenced by getCustomizer().

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

Referenced by computeProperties().

static 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

Referenced by initialization().

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

Referenced by computeProperties().

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)

References _beanInfo, _nodePropertiesCacheable, computeProperties(), cern::gp::nodes::impl::BeanNode::Descriptor::expert, and cern::gp::nodes::impl::BeanNode::Descriptor::property.

Referenced by initialization().

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

References _guiUpdater, and cern::gp::nodes::impl::BeanNode::GuiUpdaterIntrospector::removeNodeUpdaterListener().

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

Referenced by getCustomizer().

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

References _bean.

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

Returns the customizer component.

Returns:
the component or null if there is no customizer

References _bean, _beanInfo, _guiUpdater, attachCustomizer(), createDialog(), exception(), and cern::gp::nodes::impl::BeanNode::GuiUpdaterIntrospector::hasRegisteredListenerInternal().

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

References _beanInfo, and _iconColor16.

Referenced by getOpenedIcon().

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

References getIcon().

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

References _defaultAction.

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.

References _beanInfo.

void cern::gp::nodes::impl::BeanNode::hideUnwantedPropertyDescriptors (  )  [inline, private]
void cern::gp::nodes::impl::BeanNode::initialization (  )  throws IntrospectionException [inline, private]
static 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

References cern::gp::capabilities::CapabilityProvider::getCapabilities().

Referenced by initialization().

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]

References resetCache().

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.

Implements cern::gp::nodes::cache::Cacheable.

Referenced by cern::gp::nodes::impl::BeanNode::GuiUpdaterIntrospector::firePropertyChange(), and resetCache().

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

Member Data Documentation

Referenced by createProperties(), and initialization().

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

Referenced by initialization().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2