public abstract class BeanInfoSupport
extends java.beans.SimpleBeanInfo
To use, subclass it, create a subclass with a parameter-less constructor that:
Even before any such modifications, a resource bundle named xxxResources (where xxx is the fully qualified bean class name) will be obtained if available and used to localize the following:
The resource bundle will be stored as the bean descriptor's "resourceBundle" attribute, so that it can be used for further localization. TestBeanGUI, for example, uses it to obtain the group's display names from properties groupName.displayName.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT
Default value, must be provided if
NOT_UNDEFINED is TRUE |
static java.lang.String |
DEFAULT_NOT_SAVED
Default value is not saved; only non-defaults are saved
|
static java.lang.String |
MULTILINE
If specified, create a multi-line editor
|
static java.lang.String |
NOT_EXPRESSION
Whether the field disallows JMeter expressions; Boolean, default FALSE
|
static java.lang.String |
NOT_OTHER
Whether the field disallows constant values different from the provided tags; Boolean, default FALSE
|
static java.lang.String |
NOT_UNDEFINED
Whether the field must be defined (i.e. is required); Boolean, defaults to FALSE
|
static java.lang.String |
RESOURCE_BUNDLE
Pointer to the resource bundle, if any (will generally be null)
|
static java.lang.String |
TAGS |
static java.lang.String |
TEXT_LANGUAGE
TextEditor property
|
| Modifier | Constructor and Description |
|---|---|
protected |
BeanInfoSupport(java.lang.Class<? extends TestBean> beanClass)
Construct a BeanInfo for the given class.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createPropertyGroup(java.lang.String group,
java.lang.String[] names)
Utility method to group and order properties.
|
java.beans.BeanInfo[] |
getAdditionalBeanInfo() |
java.beans.BeanDescriptor |
getBeanDescriptor() |
int |
getDefaultEventIndex() |
int |
getDefaultPropertyIndex() |
java.beans.EventSetDescriptor[] |
getEventSetDescriptors() |
java.awt.Image |
getIcon(int iconKind) |
java.beans.MethodDescriptor[] |
getMethodDescriptors() |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors() |
protected java.beans.PropertyDescriptor |
property(java.lang.String name)
Get the property descriptor for the property of the given name.
|
protected java.beans.PropertyDescriptor |
property(java.lang.String name,
java.lang.Class<? extends java.lang.Enum<?>> enumClass)
Get the property descriptor for the property of the given name.
|
protected java.beans.PropertyDescriptor |
property(java.lang.String name,
TypeEditor editor)
Get the property descriptor for the property of the given name.
|
protected void |
setIcon(java.lang.String resourceName)
Set the bean's 16x16 colour icon.
|
public static final java.lang.String TAGS
public static final java.lang.String NOT_UNDEFINED
public static final java.lang.String NOT_EXPRESSION
public static final java.lang.String NOT_OTHER
public static final java.lang.String MULTILINE
public static final java.lang.String DEFAULT
NOT_UNDEFINED is TRUEpublic static final java.lang.String DEFAULT_NOT_SAVED
public static final java.lang.String RESOURCE_BUNDLE
public static final java.lang.String TEXT_LANGUAGE
protected BeanInfoSupport(java.lang.Class<? extends TestBean> beanClass)
beanClass - class for which to construct a BeanInfoprotected java.beans.PropertyDescriptor property(java.lang.String name)
name - property nameprotected java.beans.PropertyDescriptor property(java.lang.String name,
TypeEditor editor)
name - property nameeditor - the TypeEditor enum that describes the property editorprotected java.beans.PropertyDescriptor property(java.lang.String name,
java.lang.Class<? extends java.lang.Enum<?>> enumClass)
name - property nameenumClass - the enum class that is to be used by the editorprotected void setIcon(java.lang.String resourceName)
resourceName - A pathname relative to the directory holding the class file of
the current class.protected void createPropertyGroup(java.lang.String group,
java.lang.String[] names)
It will assign the given group name to each of the named properties, and set their order attribute so that they are shown in the given order.
The created groups will get order 1, 2, 3,... in the order in which they are created.
group - name of the groupnames - property names in the desired orderpublic java.beans.BeanInfo[] getAdditionalBeanInfo()
getAdditionalBeanInfo in interface java.beans.BeanInfogetAdditionalBeanInfo in class java.beans.SimpleBeanInfopublic java.beans.BeanDescriptor getBeanDescriptor()
getBeanDescriptor in interface java.beans.BeanInfogetBeanDescriptor in class java.beans.SimpleBeanInfopublic int getDefaultEventIndex()
getDefaultEventIndex in interface java.beans.BeanInfogetDefaultEventIndex in class java.beans.SimpleBeanInfopublic int getDefaultPropertyIndex()
getDefaultPropertyIndex in interface java.beans.BeanInfogetDefaultPropertyIndex in class java.beans.SimpleBeanInfopublic java.beans.EventSetDescriptor[] getEventSetDescriptors()
getEventSetDescriptors in interface java.beans.BeanInfogetEventSetDescriptors in class java.beans.SimpleBeanInfopublic java.awt.Image getIcon(int iconKind)
getIcon in interface java.beans.BeanInfogetIcon in class java.beans.SimpleBeanInfopublic java.beans.MethodDescriptor[] getMethodDescriptors()
getMethodDescriptors in interface java.beans.BeanInfogetMethodDescriptors in class java.beans.SimpleBeanInfopublic java.beans.PropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors in interface java.beans.BeanInfogetPropertyDescriptors in class java.beans.SimpleBeanInfoCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.