- java.lang.Object
-
- java.beans.SimpleBeanInfo
-
- All Implemented Interfaces:
- BeanInfo
public class SimpleBeanInfo extends Object implements BeanInfo
This is a support class to make it easier for people to provide BeanInfo classes.It defaults to providing "noop" information, and can be selectively overriden to provide more explicit information on chosen topics. When the introspector sees the "noop" values, it will apply low level introspection and design patterns to automatically analyze the target bean.
-
-
Field Summary
-
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
-
-
Constructor Summary
Constructors Constructor and Description SimpleBeanInfo()
-
Method Summary
Methods Modifier and Type Method and Description BeanInfo[]
getAdditionalBeanInfo()
Claim there are no other relevant BeanInfo objects.BeanDescriptor
getBeanDescriptor()
Deny knowledge about the class and customizer of the bean.int
getDefaultEventIndex()
Deny knowledge of a default event.int
getDefaultPropertyIndex()
Deny knowledge of a default property.EventSetDescriptor[]
getEventSetDescriptors()
Deny knowledge of event sets.Image
getIcon(int iconKind)
Claim there are no icons available.MethodDescriptor[]
getMethodDescriptors()
Deny knowledge of methods.PropertyDescriptor[]
getPropertyDescriptors()
Deny knowledge of properties.Image
loadImage(String resourceName)
This is a utility method to help in loading icon images.
-
-
-
Method Detail
-
getBeanDescriptor
public BeanDescriptor getBeanDescriptor()
Deny knowledge about the class and customizer of the bean. You can override this if you wish to provide explicit info.- Specified by:
getBeanDescriptor
in interfaceBeanInfo
- Returns:
- A BeanDescriptor providing overall information about the bean, such as its displayName, its customizer, etc. May return null if the information should be obtained by automatic analysis.
-
getPropertyDescriptors
public PropertyDescriptor[] getPropertyDescriptors()
Deny knowledge of properties. You can override this if you wish to provide explicit property info.- Specified by:
getPropertyDescriptors
in interfaceBeanInfo
- Returns:
- an array of
PropertyDescriptor
s describing all properties supported by the bean ornull
-
getDefaultPropertyIndex
public int getDefaultPropertyIndex()
Deny knowledge of a default property. You can override this if you wish to define a default property for the bean.- Specified by:
getDefaultPropertyIndex
in interfaceBeanInfo
- Returns:
- Index of default property in the PropertyDescriptor array
returned by getPropertyDescriptors.
Returns -1 if there is no default property.
-
getEventSetDescriptors
public EventSetDescriptor[] getEventSetDescriptors()
Deny knowledge of event sets. You can override this if you wish to provide explicit event set info.- Specified by:
getEventSetDescriptors
in interfaceBeanInfo
- Returns:
- An array of EventSetDescriptors describing the kinds of events fired by this bean. May return null if the information should be obtained by automatic analysis.
-
getDefaultEventIndex
public int getDefaultEventIndex()
Deny knowledge of a default event. You can override this if you wish to define a default event for the bean.- Specified by:
getDefaultEventIndex
in interfaceBeanInfo
- Returns:
- Index of default event in the EventSetDescriptor array
returned by getEventSetDescriptors.
Returns -1 if there is no default event.
-
getMethodDescriptors
public MethodDescriptor[] getMethodDescriptors()
Deny knowledge of methods. You can override this if you wish to provide explicit method info.- Specified by:
getMethodDescriptors
in interfaceBeanInfo
- Returns:
- An array of MethodDescriptors describing the externally visible methods supported by this bean. May return null if the information should be obtained by automatic analysis.
-
getAdditionalBeanInfo
public BeanInfo[] getAdditionalBeanInfo()
Claim there are no other relevant BeanInfo objects. You may override this if you want to (for example) return a BeanInfo for a base class.- Specified by:
getAdditionalBeanInfo
in interfaceBeanInfo
- Returns:
- an array of BeanInfo objects. May return null.
-
getIcon
public Image getIcon(int iconKind)
Claim there are no icons available. You can override this if you want to provide icons for your bean.- Specified by:
getIcon
in interfaceBeanInfo
- Parameters:
iconKind
- 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.- Returns:
- An image object representing the requested icon. May return null if no suitable icon is available.
-
loadImage
public Image loadImage(String resourceName)
This is a utility method to help in loading icon images. It takes the name of a resource file associated with the current object's class file and loads an image object from that file. Typically images will be GIFs.- Parameters:
resourceName
- A pathname relative to the directory holding the class file of the current class. For example, "wombat.gif".- Returns:
- an image object. May be null if the load failed.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
05/11/2024 15:07:55 Cette version de la page est en cache (à la date du 05/11/2024 15:07:55) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/beans/SimpleBeanInfo.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.