public class DefaultBeanInfo
extends java.beans.SimpleBeanInfo
CommonBeanInfo
.Modifier and Type | Field and Description |
---|---|
protected java.lang.Class |
beanClass |
static int |
BOUND_MASK
This flag marks a property as "Bound".
|
static java.lang.String |
CATEGORY_KEY
This key is used on a PropertyDescriptor to give it a category.
|
static int |
CONSTRAINED_MASK
Not used.
|
static java.lang.String |
DISPLAY_ORDER_KEY
This key is used on a PropertyDescriptor to give an explicit order to properties.
|
static int |
EXPERT_MASK
Use this flag to mark a property as expert so that it shows up under the "Expert" and "All" filters.
|
static int |
HIDDEN_MASK
Use this flag to mark a property that won't be available in the Designer, but will be serialized.
|
protected LoggerEx |
log |
static int |
NO_MASK |
static java.lang.String |
NOT_BINDABLE_KEY |
static int |
NOT_BINDABLE_MASK
Use this flag to mark a property that shouldn't ever be the target of a binding.
|
static java.lang.String |
NOT_TRANSLATABLE_KEY |
static int |
NOT_TRANSLATABLE_MASK
This marks a property as not compatible with the automatic translation system.
|
static int |
PREFERRED_MASK
Use this flag to mark the property as a preferred property - these are the properties that show up under the
"Basic" filter.
|
static int |
PREFFERED_MASK
Deprecated.
Misspelled. Use
PREFERRED_MASK |
static java.lang.String |
TRANSIENT_KEY |
static int |
TRANSIENT_MASK
Use this flag to mark a property as transient (so it will not be serialized).
|
Constructor and Description |
---|
DefaultBeanInfo(java.lang.Class c,
CustomizerDescriptor... customizerDescriptor)
Create a new BeanInfo for teh given class that will use the provided customizers (if any).
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBoundProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category)
Adds a property that has the
BOUND_MASK flag. |
protected void |
addBoundProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags)
Adds a property that has the
BOUND_MASK flag, and potentially other flags. |
protected void |
addEnumProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
java.lang.Class<? extends java.lang.Enum> enumClass)
Adds an property based upon enum constants.
|
protected void |
addEnumProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
java.lang.Class<? extends java.lang.Enum> enumClass,
int flags) |
protected void |
addEnumProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int[] values,
java.lang.String[] names)
Adds an "enum property".
|
protected void |
addEnumProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int[] values,
java.lang.String[] names,
int flags) |
protected void |
addEventSet(java.lang.Class sourceClass,
java.lang.String eventSetName,
java.lang.Class listenerType,
java.lang.Class eventObjectType,
java.lang.String[] listenerMethodNames)
This overload of
addEventSet(Class, String, Class, String[]) is for when the event object type cannot be
derived from the event set name. |
protected void |
addEventSet(java.lang.Class sourceClass,
java.lang.String eventSetName,
java.lang.Class listenerType,
java.lang.Class eventObjectType,
java.lang.String[] listenerMethodNames,
java.lang.String addListenerMethodName,
java.lang.String removeListenerMethodName,
java.lang.String getListenerMethodName)
Overload of
addEventSet(Class, String, Class, String[]) that has explicit arguments for the event object
type and listener names. |
protected void |
addEventSet(java.lang.Class sourceClass,
java.lang.String eventSetName,
java.lang.Class listenerType,
java.lang.String listenerMethodName)
This overload of
addEventSet(Class, String, Class, String[]) is used for events that have a single
listener method. |
protected void |
addEventSet(java.lang.Class sourceClass,
java.lang.String eventSetName,
java.lang.Class listenerType,
java.lang.String[] listenerMethodNames)
Adds an "event set" that this bean supports.
|
protected void |
addMethod(java.beans.MethodDescriptor method)
(Bean methods are not used in Ignition)
|
protected void |
addMethod(java.lang.String name,
java.lang.Class[] args,
java.lang.String displayName)
(Bean methods are not used in Ignition)
|
protected void |
addMethod(java.lang.String name,
java.lang.Class arg,
java.lang.String displayName)
(Bean methods are not used in Ignition)
|
protected void |
addProp(java.beans.PropertyDescriptor prop) |
protected void |
addProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
int flags)
Adds a property to the bean.
|
protected void |
addProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category)
Adds a property to the bean.
|
protected void |
addProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags)
Adds a property to the bean.
|
protected void |
addProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags,
java.lang.Class<? extends SwingEditorSupport> customEditor)
Adds a property that has a custom editor.
|
protected void |
addTransientProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
int flags) |
protected void |
addTransientProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags) |
protected java.beans.PropertyDescriptor |
createProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category)
Creates an instance of PropertyDescriptor.
|
protected java.beans.PropertyDescriptor |
createProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags)
Creates an instance of PropertyDescriptor with flags.
|
protected java.beans.PropertyDescriptor |
createProp(java.lang.String name,
java.lang.String display,
java.lang.String desc,
java.lang.String category,
int flags,
java.lang.Class<? extends SwingEditorSupport> customEditor)
Creates an instanceof a PropertyDescriptor with a custom editor class.
|
protected java.beans.PropertyDescriptor |
findProperty(java.lang.String name)
Looks up a property by name.
|
VisionBeanDescriptor |
getBeanDescriptor() |
java.beans.EventSetDescriptor[] |
getEventSetDescriptors() |
java.awt.Image |
getIcon(int kind) |
protected java.lang.String |
getIconPath() |
protected java.lang.String |
getIconPrefix() |
protected java.lang.String |
getIconResource(int kind) |
java.beans.MethodDescriptor[] |
getMethodDescriptors() |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors() |
protected void |
initDesc()
Implement this function to initialize the BeanDescriptor.
|
protected void |
initEventSets()
This is called by the constructor, meant to be overridden by subclasses.
|
protected void |
initMethods()
This is called by the constructor, meant to be overridden by subclasses.
|
protected void |
initProperties()
This is called by the constructor, meant to be overridden by subclasses.
|
protected void |
removeProp(java.lang.String name)
Removes the property with the given name from this bean info.
|
protected void |
setBackgroundProperty(java.beans.PropertyDescriptor prop)
Sets the background property (see
setBackgroundProperty(String) |
protected void |
setBackgroundProperty(java.lang.String propName)
Sets the background property, used by the eyedropper tool to know what property to set to alter the background.
|
protected void |
setFlags(java.beans.PropertyDescriptor prop,
int flags)
Apply the given flags to the property descriptor.
|
protected void |
setFlags(java.lang.String propName,
int flags) |
protected void |
setForegroundProperty(java.beans.PropertyDescriptor prop)
Sets the foreground property, see
setForegroundProperty(String) |
protected void |
setForegroundProperty(java.lang.String propName)
Sets the foreground property, used by the eyedropper tool to know what property to set to alter the foreground.
|
java.lang.String |
toString() |
public static final java.lang.String TRANSIENT_KEY
public static final java.lang.String NOT_BINDABLE_KEY
public static final java.lang.String NOT_TRANSLATABLE_KEY
public static final java.lang.String DISPLAY_ORDER_KEY
addProp(PropertyDescriptor)
method automatically adds a display order to the property.public static final java.lang.String CATEGORY_KEY
public static final int NO_MASK
public static final int BOUND_MASK
public static final int CONSTRAINED_MASK
public static final int EXPERT_MASK
public static final int HIDDEN_MASK
public static final int PREFERRED_MASK
@Deprecated public static final int PREFFERED_MASK
PREFERRED_MASK
public static final int NOT_TRANSLATABLE_MASK
public static final int TRANSIENT_MASK
Transient
attribute on the getter and/or setter.public static final int NOT_BINDABLE_MASK
protected java.lang.Class beanClass
protected LoggerEx log
public DefaultBeanInfo(java.lang.Class c, CustomizerDescriptor... customizerDescriptor)
protected void addMethod(java.lang.String name, java.lang.Class arg, java.lang.String displayName) throws java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.NoSuchMethodException
protected void addMethod(java.lang.String name, java.lang.Class[] args, java.lang.String displayName) throws java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.NoSuchMethodException
protected void addMethod(java.beans.MethodDescriptor method)
protected java.beans.PropertyDescriptor createProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category) throws java.beans.IntrospectionException
name
- The name of the property. Must match the getter/setter in the bean class.display
- The display name of the Property.desc
- A description of the property.category
- The category for the property.java.beans.IntrospectionException
protected java.beans.PropertyDescriptor createProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected java.beans.PropertyDescriptor createProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags, java.lang.Class<? extends SwingEditorSupport> customEditor) throws java.beans.IntrospectionException
name
- display
- desc
- category
- flags
- customEditor
- The class for the editor for this property.java.beans.IntrospectionException
protected void setFlags(java.lang.String propName, int flags)
protected void setFlags(java.beans.PropertyDescriptor prop, int flags)
prop
- flags
- protected void addBoundProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category) throws java.beans.IntrospectionException
BOUND_MASK
flag.java.beans.IntrospectionException
protected void addBoundProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags) throws java.beans.IntrospectionException
BOUND_MASK
flag, and potentially other flags.java.beans.IntrospectionException
protected void addProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags, java.lang.Class<? extends SwingEditorSupport> customEditor) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addProp(java.lang.String name, java.lang.String display, java.lang.String desc, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addTransientProp(java.lang.String name, java.lang.String display, java.lang.String desc, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addTransientProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addProp(java.beans.PropertyDescriptor prop)
protected void removeProp(java.lang.String name)
protected java.beans.PropertyDescriptor findProperty(java.lang.String name)
protected void setForegroundProperty(java.lang.String propName)
protected void setForegroundProperty(java.beans.PropertyDescriptor prop)
setForegroundProperty(String)
protected void setBackgroundProperty(java.lang.String propName)
protected void setBackgroundProperty(java.beans.PropertyDescriptor prop)
setBackgroundProperty(String)
protected void addEnumProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int[] values, java.lang.String[] names) throws java.beans.IntrospectionException
name
- display
- desc
- category
- values
- The list of acceptable values for this property.names
- The names of the acceptable values, must match-up with the values in valuesjava.beans.IntrospectionException
protected void addEnumProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, int[] values, java.lang.String[] names, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addEnumProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, java.lang.Class<? extends java.lang.Enum> enumClass) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addEnumProp(java.lang.String name, java.lang.String display, java.lang.String desc, java.lang.String category, java.lang.Class<? extends java.lang.Enum> enumClass, int flags) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void addEventSet(java.lang.Class sourceClass, java.lang.String eventSetName, java.lang.Class listenerType, java.lang.String listenerMethodName) throws java.beans.IntrospectionException
addEventSet(Class, String, Class, String[])
is used for events that have a single
listener method.java.beans.IntrospectionException
protected void addEventSet(java.lang.Class sourceClass, java.lang.String eventSetName, java.lang.Class listenerType, java.lang.String[] listenerMethodNames) throws java.beans.IntrospectionException
Adds an "event set" that this bean supports. An event set is a set of events that will be fired and the corresponding add/remove listener methods that must be present on the bean. By adding event sets, users will be able to respond to those events using scripting.
For example, if a component wanted to advertise that it throws focus events, it would do this in it's BeanInfo's
implementation of initEventSets()
:
addEventSet(Component.class, "focus", FocusListener.class, new String[] { "focusGained", "focusLost" });
sourceClass
- The class where the add/remove listener functions are declared. Not necessarily your class, maybe
Component or some other superclass.eventSetName
- The name of the event, such that the add/remove listener names can be derived as
"addEventSetNameListener" and
"removeEventSetNameListener". (the first letter will be capitalized for you).listenerType
- The type of the listener for this event (e.g. FocusListener
)listenerMethodName
- The names of the methods called on the a listener (e.g. {"focusGained", "focusList"})java.beans.IntrospectionException
protected void addEventSet(java.lang.Class sourceClass, java.lang.String eventSetName, java.lang.Class listenerType, java.lang.Class eventObjectType, java.lang.String[] listenerMethodNames) throws java.beans.IntrospectionException
addEventSet(Class, String, Class, String[])
is for when the event object type cannot be
derived from the event set name.java.beans.IntrospectionException
protected void addEventSet(java.lang.Class sourceClass, java.lang.String eventSetName, java.lang.Class listenerType, java.lang.Class eventObjectType, java.lang.String[] listenerMethodNames, java.lang.String addListenerMethodName, java.lang.String removeListenerMethodName, java.lang.String getListenerMethodName) throws java.beans.IntrospectionException
addEventSet(Class, String, Class, String[])
that has explicit arguments for the event object
type and listener names.java.beans.IntrospectionException
protected void initProperties() throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void initMethods() throws java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.NoSuchMethodException
protected void initEventSets() throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected void initDesc()
getBeanDescriptor()
to find the bean
descriptor and set it's meta props to be appropriate values for this bean.public final VisionBeanDescriptor getBeanDescriptor()
getBeanDescriptor
in interface java.beans.BeanInfo
getBeanDescriptor
in class java.beans.SimpleBeanInfo
public final java.beans.MethodDescriptor[] getMethodDescriptors()
getMethodDescriptors
in interface java.beans.BeanInfo
getMethodDescriptors
in class java.beans.SimpleBeanInfo
public final java.beans.PropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors
in interface java.beans.BeanInfo
getPropertyDescriptors
in class java.beans.SimpleBeanInfo
public java.beans.EventSetDescriptor[] getEventSetDescriptors()
getEventSetDescriptors
in interface java.beans.BeanInfo
getEventSetDescriptors
in class java.beans.SimpleBeanInfo
public java.awt.Image getIcon(int kind)
getIcon
in interface java.beans.BeanInfo
getIcon
in class java.beans.SimpleBeanInfo
protected java.lang.String getIconResource(int kind)
protected java.lang.String getIconPath()
protected java.lang.String getIconPrefix()
public java.lang.String toString()
toString
in class java.lang.Object