public interface BeanInfo
BeanInfo
接口创建一个
BeanInfo
类提供的方法,明确信息的属性,事件,和你的豆等特点。
当你发展你的豆,你可以实现你的应用任务省略豆功能的BeanInfo
其他功能要求。他们将获得通过自动分析,通过使用低级别的反射的豆的方法和应用标准的设计模式。您有机会通过不同的描述符类提供额外的豆信息。
看到SimpleBeanInfo
类,是BeanInfo
类方便的基本类。你可以重写的SimpleBeanInfo
类的方法和属性来定义特定的信息。
参见学习更多关于豆的行为Introspector
类。
Modifier and Type | Field and Description |
---|---|
static int |
ICON_COLOR_16x16
常量来表示一个16 x 16色图标。
|
static int |
ICON_COLOR_32x32
常量来表示一个32 x 32色图标。
|
static int |
ICON_MONO_16x16
常量来表示一个16×16单色图标。
|
static int |
ICON_MONO_32x32
常量来表示一个32×32单色图标。
|
Modifier and Type | Method and Description |
---|---|
BeanInfo[] |
getAdditionalBeanInfo()
此方法使电流
BeanInfo 对象返回的其他
BeanInfo 对象提供有关当前豆附加信息的任意集合。
|
BeanDescriptor |
getBeanDescriptor()
返回bean描述符提供关于豆的整体信息,如它的显示名称或其定制。
|
int |
getDefaultEventIndex()
一个豆可能有一个默认的事件通常应用当这个豆被使用。
|
int |
getDefaultPropertyIndex()
一个豆可能有一个默认属性通常更新时,这个豆是定制的。
|
EventSetDescriptor[] |
getEventSetDescriptors()
返回定义由此豆激发的事件类型的事件的事件描述符。
|
Image |
getIcon(int iconKind)
返回一个图像可以用来表示在工具箱或工具栏的豆。
|
MethodDescriptor[] |
getMethodDescriptors()
返回定义由此豆支持的外部可见方法的定义的方法描述符。
|
PropertyDescriptor[] |
getPropertyDescriptors()
返回用于所有属性的描述符的描述符。
|
static final int ICON_COLOR_16x16
static final int ICON_COLOR_32x32
static final int ICON_MONO_16x16
static final int ICON_MONO_32x32
BeanDescriptor getBeanDescriptor()
BeanDescriptor
对象,或
null
如果信息是通过自动分析得到
EventSetDescriptor[] getEventSetDescriptors()
EventSetDescriptor
对象的数组,或
null
如果信息是通过自动分析得到
int getDefaultEventIndex()
getEventSetDescriptors
方法返回的数组索引
EventSetDescriptor
违约事件,或1如果没有违约事件
PropertyDescriptor[] getPropertyDescriptors()
如果一个属性是索引,那么其结果数组中的PropertyDescriptor
属于类的IndexedPropertyDescriptor
类条目。getPropertyDescriptors
方法的客户端可以使用instanceof
操作员检查是否一个给定的PropertyDescriptor
是IndexedPropertyDescriptor
。
PropertyDescriptor
对象的数组,或
null
如果信息是通过自动分析得到
int getDefaultPropertyIndex()
getPropertyDescriptors
方法返回的
PropertyDescriptor
数组的默认属性指标,或1如果没有默认属性
MethodDescriptor[] getMethodDescriptors()
MethodDescriptor
对象的数组,或
null
如果信息是通过自动分析得到
BeanInfo[] getAdditionalBeanInfo()
BeanInfo
对象返回的其他
BeanInfo
对象提供有关当前豆附加信息的任意集合。
如果有不同的BeanInfo
对象提供的信息之间的冲突或重叠,目前BeanInfo
对象优先的附加BeanInfo
对象。具有较高的指数的数组元素优先于较低的指标的元素。
BeanInfo
对象的数组,或
null
如果没有额外的
BeanInfo
对象
Image getIcon(int iconKind)
有四种可能的类型的图标:16×16的颜色,32×32的颜色,16×16单,和32×32单。如果你实现了一个豆,使它支持一个单一的图标,建议使用16×16的颜色。另一个建议是为图标设置一个透明的背景。
iconKind
-图标的要求
null
如果没有合适的图标是可用的
ICON_COLOR_16x16
,
ICON_COLOR_32x32
,
ICON_MONO_16x16
,
ICON_MONO_32x32
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.