KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > tax > beans > beaninfo > TreeElementDeclBeanInfo


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.modules.xml.tax.beans.beaninfo;
20
21 import java.beans.*;
22 import org.netbeans.tax.TreeElementDecl;
23 import org.netbeans.modules.xml.tax.beans.customizer.TreeElementDeclCustomizer;
24 import org.openide.util.Exceptions;
25
26 /**
27  *
28  * @author Libor Kramolis
29  * @version 0.1
30  */

31 public class TreeElementDeclBeanInfo extends SimpleBeanInfo {
32
33     /**
34      * Gets the bean's <code>BeanDescriptor</code>s.
35      *
36      * @return BeanDescriptor describing the editable
37      * properties of this bean. May return null if the
38      * information should be obtained by automatic analysis.
39      */

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

56     public PropertyDescriptor[] getPropertyDescriptors() {
57         int PROPERTY_name = 0;
58         PropertyDescriptor[] properties = new PropertyDescriptor[1];
59
60         try {
61             properties[PROPERTY_name] = new PropertyDescriptor ( "name", TreeElementDecl.class, "getName", null ); // NOI18N
62
properties[PROPERTY_name].setDisplayName ( Util.THIS.getString ( "PROP_TreeElementDeclBeanInfo_name" ) );
63             properties[PROPERTY_name].setShortDescription ( Util.THIS.getString ( "HINT_TreeElementDeclBeanInfo_name" ) );
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         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
79
80         try {
81             eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeElementDecl.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
82
} catch( IntrospectionException e) {
83             Exceptions.printStackTrace(e);
84         }
85     return eventSets;
86     }
87
88     /**
89      * Gets the bean's <code>MethodDescriptor</code>s.
90      *
91      * @return An array of MethodDescriptors describing the methods
92      * implemented by this bean. May return null if the information
93      * should be obtained by automatic analysis.
94      */

95     public MethodDescriptor[] getMethodDescriptors() {
96     return new MethodDescriptor[0];
97     }
98
99 }
100
Popular Tags