KickJava   Java API By Example, From Geeks To Geeks.

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


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  * WebServicesBeanInfo.java
21  *
22  * Created on October 5, 2005, 3:58 PM
23  */

24
25 package org.netbeans.modules.j2ee.sun.share.configbean;
26
27 import java.beans.*;
28 import org.openide.util.Exceptions;
29
30 /**
31  * @author Peter Williams
32  */

33 public class WebServicesBeanInfo extends SimpleBeanInfo {
34     
35     /** Return an appropriate icon (currently, only 16x16 color is available)
36      */

37     public java.awt.Image JavaDoc getIcon(int iconKind) {
38         return loadImage("resources/WebServicesRootIcon16.gif"); // NOI18N
39
}
40     
41     /**
42      * Gets the bean's <code>BeanDescriptor</code>s.
43      *
44      * @return BeanDescriptor describing the editable
45      * properties of this bean. May return null if the
46      * information should be obtained by automatic analysis.
47      */

48     public BeanDescriptor getBeanDescriptor() {
49         BeanDescriptor beanDescriptor = new BeanDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice.WebServicesCustomizer.class );
50         beanDescriptor.setDisplayName ( "WSDisplayName" );
51         beanDescriptor.setShortDescription ( "WSShortDescription" );
52         return beanDescriptor;
53     }
54     
55     /**
56      * Gets the bean's <code>PropertyDescriptor</code>s.
57      *
58      * @return An array of PropertyDescriptors describing the editable
59      * properties supported by this bean. May return null if the
60      * information should be obtained by automatic analysis.
61      * <p>
62      * If a property is indexed, then its entry in the result array will
63      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
64      * A client of getPropertyDescriptors can use "instanceof" to check
65      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
66      */

67     public PropertyDescriptor[] getPropertyDescriptors() {
68         int PROPERTY_displayName = 0;
69         int PROPERTY_helpId = 1;
70         int PROPERTY_identity = 2;
71         int PROPERTY_refIdentity = 3;
72         PropertyDescriptor[] properties = new PropertyDescriptor[4];
73     
74         try {
75             properties[PROPERTY_displayName] = new PropertyDescriptor ( "displayName", org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class, "getDisplayName", null );
76             properties[PROPERTY_helpId] = new PropertyDescriptor ( "helpId", org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class, "getHelpId", null );
77             properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class, "getIdentity", "setIdentity" );
78             properties[PROPERTY_refIdentity] = new PropertyDescriptor ( "refIdentity", org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class, "getRefIdentity", null );
79         }
80         catch( IntrospectionException e) {
81             Exceptions.printStackTrace(e);
82         }
83         return properties;
84     }
85     
86     /**
87      * Gets the bean's <code>EventSetDescriptor</code>s.
88      *
89      * @return An array of EventSetDescriptors describing the kinds of
90      * events fired by this bean. May return null if the information
91      * should be obtained by automatic analysis.
92      */

93     public EventSetDescriptor[] getEventSetDescriptors() {
94         return new EventSetDescriptor[0];
95     }
96     
97     /**
98      * Gets the bean's <code>MethodDescriptor</code>s.
99      *
100      * @return An array of MethodDescriptors describing the methods
101      * implemented by this bean. May return null if the information
102      * should be obtained by automatic analysis.
103      */

104     public MethodDescriptor[] getMethodDescriptors() {
105         int METHOD_setDirty0 = 0;
106         MethodDescriptor[] methods = new MethodDescriptor[1];
107             
108         try {
109             methods[METHOD_setDirty0] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebServices.class.getMethod("setDirty", new Class JavaDoc[] {}));
110             methods[METHOD_setDirty0].setDisplayName ( "" );
111         }
112         catch( Exception JavaDoc e) {
113             Exceptions.printStackTrace(e);
114         }
115         return methods;
116     }
117 }
118
119
Popular Tags