0N/A/*
2362N/A * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.beans;
0N/A
0N/A/**
0N/A * A bean implementor who wishes to provide explicit information about
0N/A * their bean may provide a BeanInfo class that implements this BeanInfo
0N/A * interface and provides explicit information about the methods,
0N/A * properties, events, etc, of their bean.
0N/A * <p>
0N/A * A bean implementor doesn't need to provide a complete set of
0N/A * explicit information. You can pick and choose which information
0N/A * you want to provide and the rest will be obtained by automatic
0N/A * analysis using low-level reflection of the bean classes' methods
0N/A * and applying standard design patterns.
0N/A * <p>
0N/A * You get the opportunity to provide lots and lots of different
0N/A * information as part of the various XyZDescriptor classes. But
0N/A * don't panic, you only really need to provide the minimal core
0N/A * information required by the various constructors.
0N/A * <P>
0N/A * See also the SimpleBeanInfo class which provides a convenient
0N/A * "noop" base class for BeanInfo classes, which you can override
0N/A * for those specific places where you want to return explicit info.
0N/A * <P>
0N/A * To learn about all the behaviour of a bean see the Introspector class.
0N/A */
0N/A
0N/Apublic interface BeanInfo {
0N/A
0N/A /**
0N/A * Gets the beans <code>BeanDescriptor</code>.
0N/A *
0N/A * @return A BeanDescriptor providing overall information about
0N/A * the bean, such as its displayName, its customizer, etc. May
0N/A * return null if the information should be obtained by automatic
0N/A * analysis.
0N/A */
0N/A BeanDescriptor getBeanDescriptor();
0N/A
0N/A /**
0N/A * Gets the beans <code>EventSetDescriptor</code>s.
0N/A *
0N/A * @return An array of EventSetDescriptors describing the kinds of
0N/A * events fired by this bean. May return null if the information
0N/A * should be obtained by automatic analysis.
0N/A */
0N/A EventSetDescriptor[] getEventSetDescriptors();
0N/A
0N/A /**
0N/A * A bean may have a "default" event that is the event that will
0N/A * mostly commonly be used by humans when using the bean.
0N/A * @return Index of default event in the EventSetDescriptor array
0N/A * returned by getEventSetDescriptors.
0N/A * <P> Returns -1 if there is no default event.
0N/A */
0N/A int getDefaultEventIndex();
0N/A
0N/A /**
0N/A * Returns descriptors for all properties of the bean.
0N/A * May return {@code null} if the information
0N/A * should be obtained by automatic analysis.
0N/A * <p>
0N/A * If a property is indexed, then its entry in the result array
0N/A * will belong to the {@link IndexedPropertyDescriptor} subclass
0N/A * of the {@link PropertyDescriptor} class.
0N/A * A client of the {@code getPropertyDescriptors} method
0N/A * can use "{@code instanceof}" to check
0N/A * whether a given {@code PropertyDescriptor}
0N/A * is an {@code IndexedPropertyDescriptor}.
0N/A *
0N/A * @return an array of {@code PropertyDescriptor}s
0N/A * describing all properties supported by the bean
0N/A * or {@code null}
0N/A */
0N/A PropertyDescriptor[] getPropertyDescriptors();
0N/A
0N/A /**
0N/A * A bean may have a "default" property that is the property that will
0N/A * mostly commonly be initially chosen for update by human's who are
0N/A * customizing the bean.
0N/A * @return Index of default property in the PropertyDescriptor array
0N/A * returned by getPropertyDescriptors.
0N/A * <P> Returns -1 if there is no default property.
0N/A */
0N/A int getDefaultPropertyIndex();
0N/A
0N/A /**
0N/A * Gets the beans <code>MethodDescriptor</code>s.
0N/A *
0N/A * @return An array of MethodDescriptors describing the externally
0N/A * visible methods supported by this bean. May return null if
0N/A * the information should be obtained by automatic analysis.
0N/A */
0N/A MethodDescriptor[] getMethodDescriptors();
0N/A
0N/A /**
0N/A * This method allows a BeanInfo object to return an arbitrary collection
0N/A * of other BeanInfo objects that provide additional information on the
0N/A * current bean.
0N/A * <P>
0N/A * If there are conflicts or overlaps between the information provided
0N/A * by different BeanInfo objects, then the current BeanInfo takes precedence
0N/A * over the getAdditionalBeanInfo objects, and later elements in the array
0N/A * take precedence over earlier ones.
0N/A *
0N/A * @return an array of BeanInfo objects. May return null.
0N/A */
0N/A BeanInfo[] getAdditionalBeanInfo();
0N/A
0N/A /**
0N/A * This method returns an image object that can be used to
0N/A * represent the bean in toolboxes, toolbars, etc. Icon images
0N/A * will typically be GIFs, but may in future include other formats.
0N/A * <p>
0N/A * Beans aren't required to provide icons and may return null from
0N/A * this method.
0N/A * <p>
0N/A * There are four possible flavors of icons (16x16 color,
0N/A * 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only
0N/A * support a single icon we recommend supporting 16x16 color.
0N/A * <p>
0N/A * We recommend that icons have a "transparent" background
0N/A * so they can be rendered onto an existing background.
0N/A *
0N/A * @param iconKind The kind of icon requested. This should be
0N/A * one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32,
0N/A * ICON_MONO_16x16, or ICON_MONO_32x32.
0N/A * @return An image object representing the requested icon. May
0N/A * return null if no suitable icon is available.
0N/A */
0N/A java.awt.Image getIcon(int iconKind);
0N/A
0N/A /**
0N/A * Constant to indicate a 16 x 16 color icon.
0N/A */
0N/A final static int ICON_COLOR_16x16 = 1;
0N/A
0N/A /**
0N/A * Constant to indicate a 32 x 32 color icon.
0N/A */
0N/A final static int ICON_COLOR_32x32 = 2;
0N/A
0N/A /**
0N/A * Constant to indicate a 16 x 16 monochrome icon.
0N/A */
0N/A final static int ICON_MONO_16x16 = 3;
0N/A
0N/A /**
0N/A * Constant to indicate a 32 x 32 monochrome icon.
0N/A */
0N/A final static int ICON_MONO_32x32 = 4;
0N/A}