public abstract class BeanInfoSupport extends 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 String |
DEFAULT
Default value, must be provided if
NOT_UNDEFINED is TRUE |
static String |
DEFAULT_NOT_SAVED
Default value is not saved; only non-defaults are saved
|
static String |
MULTILINE
If specified, create a multi-line editor
|
static String |
NOT_EXPRESSION
Whether the field disallows JMeter expressions; Boolean, default FALSE
|
static String |
NOT_OTHER
Whether the field disallows constant values different from the provided tags; Boolean, default FALSE
|
static String |
NOT_UNDEFINED
Whether the field must be defined (i.e.
|
static String |
RESOURCE_BUNDLE
Pointer to the resource bundle, if any (will generally be null)
|
static String |
TAGS |
static String |
TEXT_LANGUAGE
TextEditor property
|
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
Modifier | Constructor and Description |
---|---|
protected |
BeanInfoSupport(Class<? extends TestBean> beanClass)
Construct a BeanInfo for the given class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createPropertyGroup(String group,
String[] names)
Utility method to group and order properties.
|
BeanInfo[] |
getAdditionalBeanInfo() |
BeanDescriptor |
getBeanDescriptor() |
int |
getDefaultEventIndex() |
int |
getDefaultPropertyIndex() |
EventSetDescriptor[] |
getEventSetDescriptors() |
Image |
getIcon(int iconKind) |
MethodDescriptor[] |
getMethodDescriptors() |
PropertyDescriptor[] |
getPropertyDescriptors() |
protected PropertyDescriptor |
property(String name)
Get the property descriptor for the property of the given name.
|
protected PropertyDescriptor |
property(String name,
Class<? extends Enum<?>> enumClass)
Get the property descriptor for the property of the given name.
|
protected PropertyDescriptor |
property(String name,
TypeEditor editor)
Get the property descriptor for the property of the given name.
|
protected void |
setIcon(String resourceName)
Set the bean's 16x16 colour icon.
|
loadImage
public static final String TAGS
public static final String NOT_UNDEFINED
public static final String NOT_EXPRESSION
public static final String NOT_OTHER
public static final String MULTILINE
public static final String DEFAULT
NOT_UNDEFINED
is TRUEpublic static final String DEFAULT_NOT_SAVED
public static final String RESOURCE_BUNDLE
public static final String TEXT_LANGUAGE
protected PropertyDescriptor property(String name)
name
- property nameprotected PropertyDescriptor property(String name, TypeEditor editor)
name
- property nameeditor
- the TypeEditor enum that describes the property editorprotected PropertyDescriptor property(String name, Class<? extends Enum<?>> enumClass)
name
- property nameenumClass
- the enum class that is to be used by the editorprotected void setIcon(String resourceName)
resourceName
- A pathname relative to the directory holding the class file of
the current class.protected void createPropertyGroup(String group, 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 BeanInfo[] getAdditionalBeanInfo()
getAdditionalBeanInfo
in interface BeanInfo
getAdditionalBeanInfo
in class SimpleBeanInfo
public BeanDescriptor getBeanDescriptor()
getBeanDescriptor
in interface BeanInfo
getBeanDescriptor
in class SimpleBeanInfo
public int getDefaultEventIndex()
getDefaultEventIndex
in interface BeanInfo
getDefaultEventIndex
in class SimpleBeanInfo
public int getDefaultPropertyIndex()
getDefaultPropertyIndex
in interface BeanInfo
getDefaultPropertyIndex
in class SimpleBeanInfo
public EventSetDescriptor[] getEventSetDescriptors()
getEventSetDescriptors
in interface BeanInfo
getEventSetDescriptors
in class SimpleBeanInfo
public Image getIcon(int iconKind)
getIcon
in interface BeanInfo
getIcon
in class SimpleBeanInfo
public MethodDescriptor[] getMethodDescriptors()
getMethodDescriptors
in interface BeanInfo
getMethodDescriptors
in class SimpleBeanInfo
public PropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors
in interface BeanInfo
getPropertyDescriptors
in class SimpleBeanInfo
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.