KickJava   Java API By Example, From Geeks To Geeks.

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


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.TreeAttlistDecl;
23 import org.netbeans.modules.xml.tax.beans.customizer.TreeAttlistDeclCustomizer;
24 import org.netbeans.modules.xml.tax.beans.editor.TreeAttlistDeclAttributeListEditor;
25 import org.openide.util.Exceptions;
26
27 /**
28  *
29  * @author Libor Kramolis
30  * @version 0.1
31  */

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

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

57     public PropertyDescriptor[] getPropertyDescriptors() {
58         int PROPERTY_elementName = 0;
59         int PROPERTY_attributeDefs = 1;
60
61         PropertyDescriptor[] properties = new PropertyDescriptor[2];
62
63         try {
64             properties[PROPERTY_elementName] = new PropertyDescriptor ( "elementName", TreeAttlistDecl.class, "getElementName", null ); // NOI18N
65
properties[PROPERTY_elementName].setDisplayName ( Util.THIS.getString ( "PROP_TreeAttlistDeclBeanInfo_elementName" ) );
66             properties[PROPERTY_elementName].setShortDescription ( Util.THIS.getString ( "HINT_TreeAttlistDeclBeanInfo_elementName" ) );
67
68             properties[PROPERTY_attributeDefs] = new PropertyDescriptor ( "attributeDefs", TreeAttlistDecl.class, "getAttributeDefs", null ); // NOI18N
69
properties[PROPERTY_attributeDefs].setDisplayName ( Util.THIS.getString ( "PROP_TreeAttlistDeclBeanInfo_attributeDefs" ) );
70             properties[PROPERTY_attributeDefs].setShortDescription ( Util.THIS.getString ( "HINT_TreeAttlistDeclBeanInfo_attributeDefs" ) );
71             properties[PROPERTY_attributeDefs].setPropertyEditorClass ( TreeAttlistDeclAttributeListEditor.class );
72         } catch( IntrospectionException e) {
73             Exceptions.printStackTrace(e);
74         }
75
76         return properties;
77     }
78
79     /**
80      * Gets the bean's <code>EventSetDescriptor</code>s.
81      *
82      * @return An array of EventSetDescriptors describing the kinds of
83      * events fired by this bean. May return null if the information
84      * should be obtained by automatic analysis.
85      */

86     public EventSetDescriptor[] getEventSetDescriptors() {
87         int EVENT_propertyChangeListener = 0;
88         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
89
90         try {
91             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.tax.TreeAttlistDecl.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // 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 }
111
Popular Tags