KickJava   Java API By Example, From Geeks To Geeks.

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


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 ToolSideErrorBeanInfo extends SimpleBeanInfo {
26     
27     /**
28      * Gets the bean's <code>BeanDescriptor</code>s.
29      *
30      * @return BeanDescriptor describing the editable
31      * properties of this bean. May return null if the
32      * information should be obtained by automatic analysis.
33      */

34     public BeanDescriptor getBeanDescriptor() {
35             BeanDescriptor beanDescriptor = new BeanDescriptor ( ToolSideError.class , null );//GEN-HEADEREND:BeanDescriptor
36
return beanDescriptor;
37     }
38     
39     /**
40      * Gets the bean's <code>PropertyDescriptor</code>s.
41      *
42      * @return An array of PropertyDescriptors describing the editable
43      * properties supported by this bean. May return null if the
44      * information should be obtained by automatic analysis.
45      * <p>
46      * If a property is indexed, then its entry in the result array will
47      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
48      * A client of getPropertyDescriptors can use "instanceof" to check
49      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
50      */

51     public PropertyDescriptor[] getPropertyDescriptors() {
52             int PROPERTY_ddbeanText = 0;
53             int PROPERTY_ddbeanXpath = 1;
54             int PROPERTY_identity = 2;
55             int PROPERTY_message = 3;
56             
57             PropertyDescriptor[] properties = new PropertyDescriptor[4];
58             
59             try {
60                 properties[PROPERTY_ddbeanText] = new PropertyDescriptor ( "ddbeanText", ToolSideError.class, "getDdbeanText", null );
61                 properties[PROPERTY_ddbeanXpath] = new PropertyDescriptor ( "ddbeanXpath", ToolSideError.class, "getDdbeanXpath", null );
62                 properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", ToolSideError.class, "getIdentity", "setIdentity" );
63                 properties[PROPERTY_message] = new PropertyDescriptor ( "message", ToolSideError.class, "getMessage", null );
64             } catch( IntrospectionException e) {
65                 Exceptions.printStackTrace(e);
66             }
67             return properties;
68     }
69     
70     /**
71      * Gets the bean's <code>EventSetDescriptor</code>s.
72      *
73      * @return An array of EventSetDescriptors describing the kinds of
74      * events fired by this bean. May return null if the information
75      * should be obtained by automatic analysis.
76      */

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

101     public MethodDescriptor[] getMethodDescriptors() {
102         int METHOD_getDConfigBean0 = 0;
103         int METHOD_notifyDDChange1 = 1;
104         int METHOD_removeDConfigBean2 = 2;
105         MethodDescriptor[] methods = new MethodDescriptor[3];
106     
107         try {
108             methods[METHOD_getDConfigBean0] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.ToolSideError.class.getMethod("getDConfigBean", new Class JavaDoc[] {javax.enterprise.deploy.model.DDBeanRoot JavaDoc.class}));
109             methods[METHOD_getDConfigBean0].setHidden ( true );
110             methods[METHOD_getDConfigBean0].setDisplayName ( "" );
111             methods[METHOD_notifyDDChange1] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.ToolSideError.class.getMethod("notifyDDChange", new Class JavaDoc[] {javax.enterprise.deploy.model.XpathEvent JavaDoc.class}));
112             methods[METHOD_notifyDDChange1].setHidden ( true );
113             methods[METHOD_notifyDDChange1].setDisplayName ( "" );
114             methods[METHOD_removeDConfigBean2] = new MethodDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.ToolSideError.class.getMethod("removeDConfigBean", new Class JavaDoc[] {javax.enterprise.deploy.spi.DConfigBean JavaDoc.class}));
115             methods[METHOD_removeDConfigBean2].setHidden ( true );
116             methods[METHOD_removeDConfigBean2].setDisplayName ( "" );
117         }
118         catch( Exception JavaDoc e) {
119             Exceptions.printStackTrace(e);
120         }
121         return methods;
122     }
123 }
124
125
Popular Tags