public class BeanInfoSupport
extends java.beans.SimpleBeanInfo
Should be subclassed in order to overwrite the protected methods.
| Modifier and Type | Field and Description |
|---|---|
protected static java.beans.EventSetDescriptor[] |
EMPTY_EVENT_SET
Empty array of event set descriptor that you can return in
getEventSetDescriptorsLazy
in order not to have any event set and to prevent the Introspector to introspect the
event set from the bean |
protected static java.beans.MethodDescriptor[] |
EMPTY_METHOD_SET
Empty array of method descriptors that you can return in
getMethodDescriptorsLazy
in order not to have any method descriptor and to prevent the Introspector to introspect the
methods from the bean |
protected static java.beans.PropertyDescriptor[] |
EMPTY_PROPERTY_SET
Empty array of property set that you can return in
getPropertyDescriptorsLazy
in order not to have any property and to prevent the Introspector to introspect the
properties from the bean |
| Constructor and Description |
|---|
BeanInfoSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected java.beans.EventSetDescriptor |
createPropertyChangeEventSet(java.lang.Class beanClass)
Returns a new
EventSetDescriptor for PropertyChangeEvent. |
java.beans.BeanInfo[] |
getAdditionalBeanInfo() |
java.beans.BeanDescriptor |
getBeanDescriptor()
Gets the bean's
BeanDescriptors. |
protected java.beans.BeanDescriptor |
getBeanDescriptorLazy()
Returns the bean descriptor for this bean info.
|
int |
getDefaultEventIndex()
A bean may have a "default" event that is the event that will
mostly commonly be used by human's when using the bean.
|
protected int |
getDefaultEventIndexLazy()
Returns the index of the event.
|
int |
getDefaultPropertyIndex()
A bean may have a "default" property that is the property that will
mostly commonly be initially chosen for update by human's who are
customizing the bean.
|
protected int |
getDefaultPropertyIndexLazy()
Returns the index of the default property.
|
java.beans.EventSetDescriptor[] |
getEventSetDescriptors()
Gets the bean's
EventSetDescriptors. |
protected java.beans.EventSetDescriptor[] |
getEventSetDescriptorsLazy()
Returns the event set descriptors for this bean info.
|
java.awt.Image |
getIcon(int iconKind)
This method returns an image object that can be used to
represent the bean in toolboxes, toolbars, etc.
|
protected java.lang.String |
getIconNameC16()
Returns the name of the icon C16.
|
protected java.lang.String |
getIconNameC32()
Returns the name of the icon C32.
|
protected java.lang.String |
getIconNameM16()
Returns the name of the icon M16.
|
protected java.lang.String |
getIconNameM32()
Returns the name of the icon M32.
|
java.beans.MethodDescriptor[] |
getMethodDescriptors()
Gets the bean's
MethodDescriptors. |
protected java.beans.MethodDescriptor[] |
getMethodDescriptorsLazy()
Returns the method descriptors for this bean info.
|
java.beans.PropertyDescriptor[] |
getPropertyDescriptors()
Gets the bean's
PropertyDescriptors. |
protected java.beans.PropertyDescriptor[] |
getPropertyDescriptorsLazy()
Returns the property descriptors for this bean info.
|
protected java.lang.Class |
getSuperclass()
Returns the superclass of the class this bean info is for.
|
protected static final java.beans.PropertyDescriptor[] EMPTY_PROPERTY_SET
getPropertyDescriptorsLazy
in order not to have any property and to prevent the Introspector to introspect the
properties from the beanprotected static final java.beans.MethodDescriptor[] EMPTY_METHOD_SET
getMethodDescriptorsLazy
in order not to have any method descriptor and to prevent the Introspector to introspect the
methods from the beanprotected static final java.beans.EventSetDescriptor[] EMPTY_EVENT_SET
getEventSetDescriptorsLazy
in order not to have any event set and to prevent the Introspector to introspect the
event set from the beanprotected java.beans.BeanDescriptor getBeanDescriptorLazy()
protected java.beans.PropertyDescriptor[] getPropertyDescriptorsLazy()
throws java.beans.IntrospectionException
java.beans.IntrospectionExceptionprotected java.beans.EventSetDescriptor[] getEventSetDescriptorsLazy()
throws java.beans.IntrospectionException
java.beans.IntrospectionExceptionprotected java.beans.MethodDescriptor[] getMethodDescriptorsLazy()
throws java.beans.IntrospectionException
java.beans.IntrospectionExceptionprotected java.lang.String getIconNameM16()
protected java.lang.String getIconNameM32()
protected java.lang.String getIconNameC16()
protected java.lang.String getIconNameC32()
protected int getDefaultPropertyIndexLazy()
protected int getDefaultEventIndexLazy()
protected java.lang.Class getSuperclass()
protected java.beans.EventSetDescriptor createPropertyChangeEventSet(java.lang.Class beanClass)
throws java.beans.IntrospectionException
EventSetDescriptor for PropertyChangeEvent.
Call this method inside the method getEventSetDescriptorsLazy
in order to include PropertyChangeEvent in the array of EventSetDescriptor
you return. You do that if the bean class has the methods addPropertyChangeListener
and removePropertyChangeListener.beanClass - the class of the bean this BeanInfo is forjava.beans.IntrospectionException - if the EventSetDescriptor cannot be built.public final java.beans.BeanInfo[] getAdditionalBeanInfo()
getAdditionalBeanInfo in interface java.beans.BeanInfogetAdditionalBeanInfo in class java.beans.SimpleBeanInfopublic final java.beans.BeanDescriptor getBeanDescriptor()
BeanDescriptors.getBeanDescriptor in interface java.beans.BeanInfogetBeanDescriptor in class java.beans.SimpleBeanInfopublic final java.beans.PropertyDescriptor[] getPropertyDescriptors()
PropertyDescriptors.getPropertyDescriptors in interface java.beans.BeanInfogetPropertyDescriptors in class java.beans.SimpleBeanInfoIf a property is indexed, then its entry in the result array will belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor. A client of getPropertyDescriptors can use "instanceof" to check if a given PropertyDescriptor is an IndexedPropertyDescriptor.
public final java.beans.EventSetDescriptor[] getEventSetDescriptors()
EventSetDescriptors.getEventSetDescriptors in interface java.beans.BeanInfogetEventSetDescriptors in class java.beans.SimpleBeanInfopublic final java.beans.MethodDescriptor[] getMethodDescriptors()
MethodDescriptors.getMethodDescriptors in interface java.beans.BeanInfogetMethodDescriptors in class java.beans.SimpleBeanInfopublic final int getDefaultPropertyIndex()
getDefaultPropertyIndex in interface java.beans.BeanInfogetDefaultPropertyIndex in class java.beans.SimpleBeanInfoReturns -1 if there is no default property.
public final int getDefaultEventIndex()
getDefaultEventIndex in interface java.beans.BeanInfogetDefaultEventIndex in class java.beans.SimpleBeanInfoReturns -1 if there is no default event.
public final java.awt.Image getIcon(int iconKind)
Beans aren't required to provide icons and may return null from this method.
There are four possible flavors of icons (16x16 color, 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only support a single icon we recommend supporting 16x16 color.
We recommend that icons have a "transparent" background so they can be rendered onto an existing background.
getIcon in interface java.beans.BeanInfogetIcon in class java.beans.SimpleBeanInfoiconKind - The kind of icon requested. This should be
one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32,
ICON_MONO_16x16, or ICON_MONO_32x32.