KickJava   Java API By Example, From Geeks To Geeks.

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


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.TreeNotationDecl;
23 import org.netbeans.modules.xml.tax.beans.customizer.TreeNotationDeclCustomizer;
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 TreeNotationDeclBeanInfo 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 ( TreeNotationDecl.class , TreeNotationDeclCustomizer.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_systemId = 0;
59         int PROPERTY_name = 1;
60         int PROPERTY_publicId = 2;
61         PropertyDescriptor[] properties = new PropertyDescriptor[3];
62
63         try {
64             properties[PROPERTY_systemId] = new PropertyDescriptor ( "systemId", TreeNotationDecl.class, "getSystemId", null ); // NOI18N
65
properties[PROPERTY_systemId].setDisplayName ( Util.THIS.getString ( "PROP_TreeNotationDeclBeanInfo_systemId" ) );
66             properties[PROPERTY_systemId].setShortDescription ( Util.THIS.getString ( "HINT_TreeNotationDeclBeanInfo_systemId" ) );
67             properties[PROPERTY_systemId].setPropertyEditorClass ( NullStringEditor.class );
68
69             properties[PROPERTY_name] = new PropertyDescriptor ( "name", TreeNotationDecl.class, "getName", null ); // NOI18N
70
properties[PROPERTY_name].setDisplayName ( Util.THIS.getString ( "PROP_TreeNotationDeclBeanInfo_name" ) );
71             properties[PROPERTY_name].setShortDescription ( Util.THIS.getString ( "HINT_TreeNotationDeclBeanInfo_name" ) );
72
73             properties[PROPERTY_publicId] = new PropertyDescriptor ( "publicId", TreeNotationDecl.class, "getPublicId", null ); // NOI18N
74
properties[PROPERTY_publicId].setDisplayName ( Util.THIS.getString ( "PROP_TreeNotationDeclBeanInfo_publicId" ) );
75             properties[PROPERTY_publicId].setShortDescription ( Util.THIS.getString ( "HINT_TreeNotationDeclBeanInfo_publicId" ) );
76             properties[PROPERTY_publicId].setPropertyEditorClass ( NullStringEditor.class );
77         } catch( IntrospectionException e) {
78             Exceptions.printStackTrace(e);
79         }
80         return properties;
81     }
82
83     /**
84      * Gets the bean's <code>EventSetDescriptor</code>s.
85      *
86      * @return An array of EventSetDescriptors describing the kinds of
87      * events fired by this bean. May return null if the information
88      * should be obtained by automatic analysis.
89      */

90     public EventSetDescriptor[] getEventSetDescriptors() {
91         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
92
93         try {
94             eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeNotationDecl.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
95
} catch( IntrospectionException e) {
96             Exceptions.printStackTrace(e);
97         }
98     return eventSets;
99     }
100
101     /**
102      * Gets the bean's <code>MethodDescriptor</code>s.
103      *
104      * @return An array of MethodDescriptors describing the methods
105      * implemented by this bean. May return null if the information
106      * should be obtained by automatic analysis.
107      */

108     public MethodDescriptor[] getMethodDescriptors() {
109     return new MethodDescriptor[0];
110     }
111
112 }
113
Popular Tags