KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
26  * @author peterw99
27  */

28 public class MessageDestinationRefBeanInfo extends SimpleBeanInfo {
29     
30     /** Return an appropriate icon (currently, only 16x16 color is available)
31      */

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

43     public BeanDescriptor getBeanDescriptor() {
44         BeanDescriptor beanDescriptor = new BeanDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.MessageDestinationRefCustomizer.class ); // NOI18N//GEN-HEADEREND:BeanDescriptor
45
return beanDescriptor;
46     }
47     
48     /**
49      * Gets the bean's <code>PropertyDescriptor</code>s.
50      *
51      * @return An array of PropertyDescriptors describing the editable
52      * properties supported by this bean. May return null if the
53      * information should be obtained by automatic analysis.
54      * <p>
55      * If a property is indexed, then its entry in the result array will
56      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
57      * A client of getPropertyDescriptors can use "instanceof" to check
58      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
59      */

60     public PropertyDescriptor[] getPropertyDescriptors() {
61         int PROPERTY_identity = 0;
62         int PROPERTY_jndiName = 1;
63         int PROPERTY_messageDestinationRefName = 2;
64         PropertyDescriptor[] properties = new PropertyDescriptor[3];
65
66         try {
67             properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class, "getIdentity", "setIdentity" ); // NOI18N
68
properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class, "getJndiName", "setJndiName" ); // NOI18N
69
properties[PROPERTY_messageDestinationRefName] = new PropertyDescriptor ( "messageDestinationRefName", org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class, "getMessageDestinationRefName", null ); // NOI18N
70
}
71         catch(IntrospectionException e) {
72             Exceptions.printStackTrace(e);
73         }
74         return properties;
75     }
76     
77     /**
78      * Gets the bean's <code>EventSetDescriptor</code>s.
79      *
80      * @return An array of EventSetDescriptors describing the kinds of
81      * events fired by this bean. May return null if the information
82      * should be obtained by automatic analysis.
83      */

84     public EventSetDescriptor[] getEventSetDescriptors() {
85         int EVENT_propertyChangeListener = 0;
86         int EVENT_vetoableChangeListener = 1;
87         EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
88         
89         try {
90             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
91
eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.MessageDestinationRef.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" ); // NOI18N
92
}
93         catch(IntrospectionException e) {
94             Exceptions.printStackTrace(e);
95         }
96         return eventSets;
97     }
98     
99     /**
100      * Gets the bean's <code>MethodDescriptor</code>s.
101      *
102      * @return An array of MethodDescriptors describing the methods
103      * implemented by this bean. May return null if the information
104      * should be obtained by automatic analysis.
105      */

106     public MethodDescriptor[] getMethodDescriptors() {
107         return new MethodDescriptor[0];
108     }
109 }
110
Popular Tags