KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > WebAppRootBeanInfo


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.sun.share.configbean;
21
22 import java.beans.*;
23 import org.openide.util.Exceptions;
24
25 public class WebAppRootBeanInfo extends SimpleBeanInfo {
26     
27     /** Return an appropriate icon (currently, only 16x16 color is available)
28      */

29     public java.awt.Image JavaDoc getIcon(int iconKind) {
30         return loadImage("resources/WebAppRootIcon16.gif"); // NOI18N
31
}
32     
33     /**
34      * Gets the bean's <code>BeanDescriptor</code>s.
35      *
36      * @return BeanDescriptor describing the editable
37      * properties of this bean. May return null if the
38      * information should be obtained by automatic analysis.
39      */

40     public BeanDescriptor getBeanDescriptor() {
41             BeanDescriptor beanDescriptor = new BeanDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp.WebAppRootCustomizer.class );
42             beanDescriptor.setDisplayName ( "WARDisplayName" );
43             beanDescriptor.setShortDescription ( "WARShortDescription" );//GEN-HEADEREND:BeanDescriptor
44

45                     // Here you can add code for customizing the BeanDescriptor.
46

47             return beanDescriptor;
48     }
49     
50     /**
51      * Gets the bean's <code>PropertyDescriptor</code>s.
52      *
53      * @return An array of PropertyDescriptors describing the editable
54      * properties supported by this bean. May return null if the
55      * information should be obtained by automatic analysis.
56      * <p>
57      * If a property is indexed, then its entry in the result array will
58      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
59      * A client of getPropertyDescriptors can use "instanceof" to check
60      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
61      */

62     public PropertyDescriptor[] getPropertyDescriptors() {
63             int PROPERTY_classLoader = 0;
64             int PROPERTY_contextRoot = 1;
65             int PROPERTY_delegate = 2;
66             int PROPERTY_extraClassPath = 3;
67             int PROPERTY_identity = 4;
68             int PROPERTY_jspConfig = 5;
69             int PROPERTY_localeCharsetInfo = 6;
70             int PROPERTY_property = 7;
71             int PROPERTY_refIdentity = 8;
72             PropertyDescriptor[] properties = new PropertyDescriptor[9];
73
74             try {
75                 properties[PROPERTY_classLoader] = new PropertyDescriptor ( "classLoader", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "isClassLoader", "setClassLoader" );
76                 properties[PROPERTY_classLoader].setExpert ( true );
77                 properties[PROPERTY_contextRoot] = new PropertyDescriptor ( "contextRoot", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getContextRoot", "setContextRoot" );
78                 properties[PROPERTY_delegate] = new PropertyDescriptor ( "delegate", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "isDelegate", "setDelegate" );
79                 properties[PROPERTY_extraClassPath] = new PropertyDescriptor ( "extraClassPath", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getExtraClassPath", "setExtraClassPath" );
80                 properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getIdentity", "setIdentity" );
81                 properties[PROPERTY_jspConfig] = new PropertyDescriptor ( "jspConfig", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getJspConfig", "setJspConfig" );
82                 properties[PROPERTY_jspConfig].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
83                 properties[PROPERTY_localeCharsetInfo] = new PropertyDescriptor ( "localeCharsetInfo", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getLocaleCharsetInfo", "setLocaleCharsetInfo" );
84                 properties[PROPERTY_property] = new IndexedPropertyDescriptor ( "property", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, null, null, "getProperty", null );
85                 properties[PROPERTY_property].setExpert ( true );
86                 properties[PROPERTY_property].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
87                 properties[PROPERTY_refIdentity] = new PropertyDescriptor ( "refIdentity", org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "getRefIdentity", null );
88             }
89             catch( IntrospectionException e) {
90                 Exceptions.printStackTrace(e);
91             }
92             return properties;
93     }
94     
95     /**
96      * Gets the bean's <code>EventSetDescriptor</code>s.
97      *
98      * @return An array of EventSetDescriptors describing the kinds of
99      * events fired by this bean. May return null if the information
100      * should be obtained by automatic analysis.
101      */

102     public EventSetDescriptor[] getEventSetDescriptors() {
103             int EVENT_propertyChangeListener = 0;
104             int EVENT_vetoableChangeListener = 1;
105             EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
106
107             try {
108                 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
109                 eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebAppRoot.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" );
110             }
111             catch( IntrospectionException e) {
112                 Exceptions.printStackTrace(e);
113             }
114             return eventSets;
115     }
116     
117     /**
118      * Gets the bean's <code>MethodDescriptor</code>s.
119      *
120      * @return An array of MethodDescriptors describing the methods
121      * implemented by this bean. May return null if the information
122      * should be obtained by automatic analysis.
123      */

124     public MethodDescriptor[] getMethodDescriptors() {
125             return new MethodDescriptor[0];
126     }
127     
128 }
129
130
Popular Tags