KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tax > decl > ANYTypeBeanInfo


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 package org.netbeans.tax.decl;
20
21 import java.beans.*;
22
23 public class ANYTypeBeanInfo extends SimpleBeanInfo {
24
25     /**
26      * Gets the bean's <code>PropertyDescriptor</code>s.
27      *
28      * @return An array of PropertyDescriptors describing the editable
29      * properties supported by this bean. May return null if the
30      * information should be obtained by automatic analysis.
31      * <p>
32      * If a property is indexed, then its entry in the result array will
33      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
34      * A client of getPropertyDescriptors can use "instanceof" to check
35      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
36      */

37     public PropertyDescriptor[] getPropertyDescriptors () {
38         int PROPERTY_XMLString = 0;
39         PropertyDescriptor[] properties = new PropertyDescriptor[1];
40         try {
41             properties[PROPERTY_XMLString] = new PropertyDescriptor ( "XMLString", ANYType.class, "toString", null ); // NOI18N
42
} catch( IntrospectionException e) {}
43         return properties;
44     }
45   
46     /**
47      * Gets the bean's <code>EventSetDescriptor</code>s.
48      *
49      * @return An array of EventSetDescriptors describing the kinds of
50      * events fired by this bean. May return null if the information
51      * should be obtained by automatic analysis.
52      */

53     public EventSetDescriptor[] getEventSetDescriptors () {
54         int EVENT_propertyChangeListener = 0;
55         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
56         
57         try {
58             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( ANYType.class, "propertyChangeListener", PropertyChangeListener.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
59
} catch( IntrospectionException e) {}
60         return eventSets;
61     }
62   
63     /**
64      * Gets the bean's <code>MethodDescriptor</code>s.
65      *
66      * @return An array of MethodDescriptors describing the methods
67      * implemented by this bean. May return null if the information
68      * should be obtained by automatic analysis.
69      */

70     public MethodDescriptor[] getMethodDescriptors () {
71         return new MethodDescriptor[0];
72     }
73 }
74
Popular Tags