0N/A/*
2362N/A * Copyright (c) 1998, 2004, 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 @(BeanPackageName);
0N/A
0N/Aimport java.beans.BeanDescriptor;
0N/Aimport java.beans.PropertyDescriptor;
0N/Aimport java.awt.Image;
0N/A
0N/Aimport sun.swing.BeanInfoUtils;
0N/A
0N/A/**
0N/A * Descriptive information about the @(BeanClassName) class for Java
0N/A * Beans application builders. This BeanInfo class provides descriptions
0N/A * of each property, of the bean itself, it indicates which
0N/A * @(BeanClassName) properties are bound, and it provides other
0N/A * information and icons useful to builders.
0N/A *
0N/A * @author Auto-Generated Source Code
0N/A */
0N/A
0N/Apublic class @(BeanClassName)BeanInfo extends javax.swing.SwingBeanInfoBase {
0N/A private static final Class class@(BeanClassName) = @(BeanClassObject);
0N/A
0N/A /**
0N/A * @return a @(BeanClassName) BeanDescriptor
0N/A */
0N/A public BeanDescriptor getBeanDescriptor() {
0N/A return BeanInfoUtils.createBeanDescriptor(class@(BeanClassName),
0N/A new Object[] {
0N/A BeanInfoUtils.PREFERRED, Boolean.TRUE,
0N/A @(ClassDescriptors)
0N/A BeanInfoUtils.SHORTDESCRIPTION, "@(BeanDescription)"
0N/A });
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Create a @(BeanClassName) PropertyDescriptor. This is just an internal
0N/A * convenience method that allows one to leave the @(BeanClassName).class
0N/A * argument out of the createPropertyDescriptor() class in the
0N/A * getPropertyDescriptors() method below.
0N/A *
0N/A * @param name the name of the property
0N/A * @param args an array java.beans.PropertyDescriptor property names and values
0N/A * @return a @(BeanClassName) PropertyDescriptor.
0N/A * @see BeanInfoUtils#createPropertyDescriptor
0N/A */
0N/A private PropertyDescriptor createPropertyDescriptor(String name, Object[] args) {
0N/A return BeanInfoUtils.createPropertyDescriptor(class@(BeanClassName), name, args);
0N/A }
0N/A
0N/A
0N/A /**
0N/A * This method returns a list of bean PropertyDescriptors, one for each public
0N/A * property in @(BeanClassName). The first property is the "default" property.
0N/A *
0N/A * @return a complete list of bean PropertyDescriptors for @(BeanClassName)
0N/A * @see SwingBeanInfo
0N/A * @see java.beans.BeanInfo#getDefaultPropertyIndex
0N/A */
0N/A public PropertyDescriptor[] getPropertyDescriptors() {
0N/A @(EnumVariables)
0N/A return new PropertyDescriptor[] {
0N/A @(BeanPropertyDescriptors)
0N/A };
0N/A }
0N/A
0N/A
0N/A /**
0N/A * @return an icon of the specified kind for @(BeanClassName)
0N/A */
0N/A public Image getIcon(int kind) {
0N/A Image i;
0N/A switch (kind){
0N/A case ICON_COLOR_32x32:
0N/A i = loadImage("beaninfo/images/@(BeanClassName)Color32.gif");
0N/A return ((i == null) ? loadImage("beaninfo/images/JComponentColor32.gif") : i);
0N/A case ICON_COLOR_16x16:
0N/A i = loadImage("beaninfo/images/@(BeanClassName)Color16.gif");
0N/A return ((i == null) ? loadImage("beaninfo/images/JComponentColor16.gif") : i);
0N/A case ICON_MONO_32x32:
0N/A i = loadImage("beaninfo/images/@(BeanClassName)Mono32.gif");
0N/A return ((i == null) ? loadImage("beaninfo/images/JComponentMono32.gif") : i);
0N/A case ICON_MONO_16x16:
0N/A i = loadImage("beaninfo/images/@(BeanClassName)Mono16.gif");
0N/A return ((i == null) ? loadImage("beaninfo/images/JComponentMono16.gif") : i);
0N/A default:
0N/A return super.getIcon(kind);
0N/A }
0N/A }
0N/A}
0N/A
0N/A