KickJava   Java API By Example, From Geeks To Geeks.

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


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

32 public class TreeEntityDeclBeanInfo 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 ( TreeEntityDecl.class , TreeEntityDeclCustomizer.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_name = 0;
59         int PROPERTY_parameter = 1;
60         int PROPERTY_notationName = 2;
61         int PROPERTY_systemId = 3;
62         int PROPERTY_internalText = 4;
63         int PROPERTY_publicId = 5;
64         PropertyDescriptor[] properties = new PropertyDescriptor[6];
65
66         try {
67             properties[PROPERTY_name] = new PropertyDescriptor ( "name", TreeEntityDecl.class, "getName", null ); // NOI18N
68
properties[PROPERTY_name].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_name" ) );
69             properties[PROPERTY_name].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_name" ) );
70
71             properties[PROPERTY_parameter] = new PropertyDescriptor ( "parameter", TreeEntityDecl.class, "isParameter", null ); // NOI18N
72
properties[PROPERTY_parameter].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_parameter" ) );
73             properties[PROPERTY_parameter].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_parameter" ) );
74
75             properties[PROPERTY_notationName] = new PropertyDescriptor ( "notationName", TreeEntityDecl.class, "getNotationName", null ); // NOI18N
76
properties[PROPERTY_notationName].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_notationName" ) );
77             properties[PROPERTY_notationName].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_notationName" ) );
78             properties[PROPERTY_notationName].setPropertyEditorClass ( NullStringEditor.class );
79
80             properties[PROPERTY_systemId] = new PropertyDescriptor ( "systemId", TreeEntityDecl.class, "getSystemId", null ); // NOI18N
81
properties[PROPERTY_systemId].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_systemId" ) );
82             properties[PROPERTY_systemId].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_systemId" ) );
83             properties[PROPERTY_systemId].setPropertyEditorClass ( NullStringEditor.class );
84
85             properties[PROPERTY_internalText] = new PropertyDescriptor ( "internalText", TreeEntityDecl.class, "getInternalText", null ); // NOI18N
86
properties[PROPERTY_internalText].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_internalText" ) );
87             properties[PROPERTY_internalText].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_internalText" ) );
88             properties[PROPERTY_internalText].setPropertyEditorClass ( NullStringEditor.class );
89
90             properties[PROPERTY_publicId] = new PropertyDescriptor ( "publicId", TreeEntityDecl.class, "getPublicId", null ); // NOI18N
91
properties[PROPERTY_publicId].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_publicId" ) );
92             properties[PROPERTY_publicId].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_publicId" ) );
93             properties[PROPERTY_publicId].setPropertyEditorClass ( NullStringEditor.class );
94         } catch( IntrospectionException e) {
95             Exceptions.printStackTrace(e);
96         }
97         return properties;
98     }
99
100     /**
101      * Gets the bean's <code>EventSetDescriptor</code>s.
102      *
103      * @return An array of EventSetDescriptors describing the kinds of
104      * events fired by this bean. May return null if the information
105      * should be obtained by automatic analysis.
106      */

107     public EventSetDescriptor[] getEventSetDescriptors() {
108         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
109
110         try {
111             eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeEntityDecl.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
112
} catch( IntrospectionException e) {
113             Exceptions.printStackTrace(e);
114         }
115     return eventSets;
116     }
117
118     /**
119      * Gets the bean's <code>MethodDescriptor</code>s.
120      *
121      * @return An array of MethodDescriptors describing the methods
122      * implemented by this bean. May return null if the information
123      * should be obtained by automatic analysis.
124      */

125     public MethodDescriptor[] getMethodDescriptors() {
126     return new MethodDescriptor[0];
127     }
128
129 }
130
Popular Tags