KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > nodes > Bean21341HiddenBeanInfo


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
20 package org.openide.nodes;
21
22 import java.beans.*;
23
24 public class Bean21341HiddenBeanInfo extends SimpleBeanInfo {
25
26     // Bean descriptor//GEN-FIRST:BeanDescriptor
27
/*lazy BeanDescriptor*/
28     private static BeanDescriptor getBdescriptor(){
29         BeanDescriptor beanDescriptor = new BeanDescriptor ( Bean21341Hidden.class , null );
30         beanDescriptor.setShortDescription ( "ShortDescription" );//GEN-HEADEREND:BeanDescriptor
31
beanDescriptor.setValue("helpID", "HelpID" );
32         beanDescriptor.setValue("propertiesHelpID", "PropertiesHelpID" );
33         beanDescriptor.setValue("expertHelpID", "ExpertHelpID" );
34         // Here you can add code for customizing the BeanDescriptor.
35

36         return beanDescriptor; }//GEN-LAST:BeanDescriptor
37

38     
39     // Property identifiers//GEN-FIRST:Properties
40
private static final int PROPERTY_karel = 0;
41     private static final int PROPERTY_indexedProperty = 1;
42
43     // Property array
44
/*lazy PropertyDescriptor*/
45     private static PropertyDescriptor[] getPdescriptor(){
46         PropertyDescriptor[] properties = new PropertyDescriptor[2];
47     
48         try {
49             properties[PROPERTY_karel] = new PropertyDescriptor ( "karel", Bean21341Hidden.class, "getKarel", "setKarel" );
50             properties[PROPERTY_karel].setExpert ( true );
51             properties[PROPERTY_indexedProperty] = new IndexedPropertyDescriptor ( "indexedProperty", Bean21341Hidden.class, null, null, "getIndexedProperty", null );
52         }
53         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
54

55         // Here you can add code for customizing the properties array.
56

57         return properties; }//GEN-LAST:Properties
58

59     // EventSet identifiers//GEN-FIRST:Events
60

61     // EventSet array
62
/*lazy EventSetDescriptor*/
63     private static EventSetDescriptor[] getEdescriptor(){
64         EventSetDescriptor[] eventSets = new EventSetDescriptor[0];//GEN-HEADEREND:Events
65

66         // Here you can add code for customizing the event sets array.
67

68         return eventSets; }//GEN-LAST:Events
69

70     // Method identifiers//GEN-FIRST:Methods
71

72     // Method array
73
/*lazy MethodDescriptor*/
74     private static MethodDescriptor[] getMdescriptor(){
75         MethodDescriptor[] methods = new MethodDescriptor[0];//GEN-HEADEREND:Methods
76

77         // Here you can add code for customizing the methods array.
78

79         return methods; }//GEN-LAST:Methods
80

81     
82     private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
83
private static final int defaultEventIndex = -1;//GEN-END:Idx
84

85     
86 //GEN-FIRST:Superclass
87

88     // Here you can add code for customizing the Superclass BeanInfo.
89

90 //GEN-LAST:Superclass
91

92     /**
93      * Gets the bean's <code>BeanDescriptor</code>s.
94      *
95      * @return BeanDescriptor describing the editable
96      * properties of this bean. May return null if the
97      * information should be obtained by automatic analysis.
98      */

99     public BeanDescriptor getBeanDescriptor() {
100         return getBdescriptor();
101     }
102     
103     /**
104      * Gets the bean's <code>PropertyDescriptor</code>s.
105      *
106      * @return An array of PropertyDescriptors describing the editable
107      * properties supported by this bean. May return null if the
108      * information should be obtained by automatic analysis.
109      * <p>
110      * If a property is indexed, then its entry in the result array will
111      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
112      * A client of getPropertyDescriptors can use "instanceof" to check
113      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
114      */

115     public PropertyDescriptor[] getPropertyDescriptors() {
116         return getPdescriptor();
117     }
118     
119     /**
120      * Gets the bean's <code>EventSetDescriptor</code>s.
121      *
122      * @return An array of EventSetDescriptors describing the kinds of
123      * events fired by this bean. May return null if the information
124      * should be obtained by automatic analysis.
125      */

126     public EventSetDescriptor[] getEventSetDescriptors() {
127         return getEdescriptor();
128     }
129     
130     /**
131      * Gets the bean's <code>MethodDescriptor</code>s.
132      *
133      * @return An array of MethodDescriptors describing the methods
134      * implemented by this bean. May return null if the information
135      * should be obtained by automatic analysis.
136      */

137     public MethodDescriptor[] getMethodDescriptors() {
138         return getMdescriptor();
139     }
140     
141     /**
142      * A bean may have a "default" property that is the property that will
143      * mostly commonly be initially chosen for update by human's who are
144      * customizing the bean.
145      * @return Index of default property in the PropertyDescriptor array
146      * returned by getPropertyDescriptors.
147      * <P> Returns -1 if there is no default property.
148      */

149     public int getDefaultPropertyIndex() {
150         return defaultPropertyIndex;
151     }
152     
153     /**
154      * A bean may have a "default" event that is the event that will
155      * mostly commonly be used by human's when using the bean.
156      * @return Index of default event in the EventSetDescriptor array
157      * returned by getEventSetDescriptors.
158      * <P> Returns -1 if there is no default event.
159      */

160     public int getDefaultEventIndex() {
161         return defaultEventIndex;
162     }
163 }
164
165
Popular Tags