KickJava   Java API By Example, From Geeks To Geeks.

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


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  * WebServiceDescriptorBeanInfo.java
21  *
22  * Created on October 5, 2005, 4:28 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 WebServiceDescriptorBeanInfo 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/WebServiceDescriptorIcon16.png"); // 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.WebServiceDescriptor.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice.WebServiceDescriptorCustomizer.class );
50         beanDescriptor.setDisplayName ( "WebServiceDescriptorDisplayName" );
51         beanDescriptor.setShortDescription ( "WebServiceDescriptorShortDescription" );//GEN-HEADEREND:BeanDescriptor
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_webServiceDescriptionName = 3;
72         int PROPERTY_webServiceEndpoint = 4;
73         int PROPERTY_webServiceEndpoints = 5;
74         int PROPERTY_wsdlPublishLocation = 6;
75         PropertyDescriptor[] properties = new PropertyDescriptor[7];
76     
77         try {
78             properties[PROPERTY_displayName] = new PropertyDescriptor ( "displayName", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getDisplayName", null );
79             properties[PROPERTY_helpId] = new PropertyDescriptor ( "helpId", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getHelpId", null );
80             properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getIdentity", "setIdentity" );
81             properties[PROPERTY_webServiceDescriptionName] = new PropertyDescriptor ( "webServiceDescriptionName", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getWebServiceDescriptionName", null );
82             properties[PROPERTY_webServiceEndpoint] = new IndexedPropertyDescriptor ( "webServiceEndpoint", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, null, null, "getWebServiceEndpoint", null );
83             properties[PROPERTY_webServiceEndpoints] = new PropertyDescriptor ( "webServiceEndpoints", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getWebServiceEndpoints", "setWebServiceEndpoints" );
84             properties[PROPERTY_wsdlPublishLocation] = new PropertyDescriptor ( "wsdlPublishLocation", org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class, "getWsdlPublishLocation", "setWsdlPublishLocation" );
85         }
86         catch( IntrospectionException e) {
87             Exceptions.printStackTrace(e);
88         }
89         
90         return properties;
91     }
92     
93     /**
94      * Gets the bean's <code>EventSetDescriptor</code>s.
95      *
96      * @return An array of EventSetDescriptors describing the kinds of
97      * events fired by this bean. May return null if the information
98      * should be obtained by automatic analysis.
99      */

100     public EventSetDescriptor[] getEventSetDescriptors() {
101         return new EventSetDescriptor[0];
102     }
103     
104     /**
105      * Gets the bean's <code>MethodDescriptor</code>s.
106      *
107      * @return An array of MethodDescriptors describing the methods
108      * implemented by this bean. May return null if the information
109      * should be obtained by automatic analysis.
110      */

111     public MethodDescriptor[] getMethodDescriptors() {
112         int METHOD_addWebServiceEndpoint0 = 0;
113         int METHOD_removeWebServiceEndpoint1 = 1;
114         int METHOD_setDirty2 = 2;
115         MethodDescriptor[] methods = new MethodDescriptor[3];
116     
117         try {
118             methods[METHOD_addWebServiceEndpoint0] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class.getMethod("addWebServiceEndpoint", new Class JavaDoc[] {org.netbeans.modules.j2ee.sun.dd.api.common.WebserviceEndpoint.class}));
119             methods[METHOD_addWebServiceEndpoint0].setDisplayName ( "" );
120             methods[METHOD_removeWebServiceEndpoint1] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class.getMethod("removeWebServiceEndpoint", new Class JavaDoc[] {org.netbeans.modules.j2ee.sun.dd.api.common.WebserviceEndpoint.class}));
121             methods[METHOD_removeWebServiceEndpoint1].setDisplayName ( "" );
122             methods[METHOD_setDirty2] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.WebServiceDescriptor.class.getMethod("setDirty", new Class JavaDoc[] {}));
123             methods[METHOD_setDirty2].setDisplayName ( "" );
124         }
125         catch( Exception JavaDoc e) {
126             Exceptions.printStackTrace(e);
127         }
128         return methods;
129     }
130 }
131
132
Popular Tags