KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > jmi > mapping > JMIMapperImplBeanInfo


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.netbeans.lib.jmi.mapping;
21
22 import java.beans.*;
23 import org.openide.util.NbBundle;
24
25 public class JMIMapperImplBeanInfo extends SimpleBeanInfo {
26
27     // Bean descriptor//GEN-FIRST:BeanDescriptor
28
/*lazy BeanDescriptor*/
29     private static BeanDescriptor getBdescriptor(){
30         BeanDescriptor beanDescriptor = new BeanDescriptor ( JMIMapperImpl.class , null );//GEN-HEADEREND:BeanDescriptor
31

32         // Here you can add code for customizing the BeanDescriptor.
33

34         return beanDescriptor; }//GEN-LAST:BeanDescriptor
35

36     
37     // Property identifiers//GEN-FIRST:Properties
38
private static final int PROPERTY_header = 0;
39
40     // Property array
41
/*lazy PropertyDescriptor*/
42     private static PropertyDescriptor[] getPdescriptor(){
43         PropertyDescriptor[] properties = new PropertyDescriptor[1];
44     
45         try {
46             properties[PROPERTY_header] = new PropertyDescriptor ( "header", JMIMapperImpl.class, "getHeader", "setHeader" );
47             properties[PROPERTY_header].setDisplayName ( NbBundle.getMessage(JMIMapperImpl.class,"PROP_HEADER") );
48             properties[PROPERTY_header].setShortDescription ( NbBundle.getMessage(JMIMapperImpl.class,"HINT_HEADER") );
49         }
50         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
51

52         // Here you can add code for customizing the properties array.
53

54         return properties; }//GEN-LAST:Properties
55

56     // Event set information will be obtained from introspection.//GEN-FIRST:Events
57
private static EventSetDescriptor[] eventSets = null;
58     private static EventSetDescriptor[] getEdescriptor(){//GEN-HEADEREND:Events
59

60         // Here you can add code for customizing the event sets array.
61

62         return eventSets; }//GEN-LAST:Events
63

64     // Method information will be obtained from introspection.//GEN-FIRST:Methods
65
private static MethodDescriptor[] methods = null;
66     private static MethodDescriptor[] getMdescriptor(){//GEN-HEADEREND:Methods
67

68         // Here you can add code for customizing the methods array.
69

70         return methods; }//GEN-LAST:Methods
71

72     
73     private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
74
private static final int defaultEventIndex = -1;//GEN-END:Idx
75

76     
77 //GEN-FIRST:Superclass
78

79     // Here you can add code for customizing the Superclass BeanInfo.
80

81 //GEN-LAST:Superclass
82

83     /**
84      * Gets the bean's <code>BeanDescriptor</code>s.
85      *
86      * @return BeanDescriptor describing the editable
87      * properties of this bean. May return null if the
88      * information should be obtained by automatic analysis.
89      */

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

106     public PropertyDescriptor[] getPropertyDescriptors() {
107         return getPdescriptor();
108     }
109     
110     /**
111      * Gets the bean's <code>EventSetDescriptor</code>s.
112      *
113      * @return An array of EventSetDescriptors describing the kinds of
114      * events fired by this bean. May return null if the information
115      * should be obtained by automatic analysis.
116      */

117     public EventSetDescriptor[] getEventSetDescriptors() {
118         return getEdescriptor();
119     }
120     
121     /**
122      * Gets the bean's <code>MethodDescriptor</code>s.
123      *
124      * @return An array of MethodDescriptors describing the methods
125      * implemented by this bean. May return null if the information
126      * should be obtained by automatic analysis.
127      */

128     public MethodDescriptor[] getMethodDescriptors() {
129         return getMdescriptor();
130     }
131     
132     /**
133      * A bean may have a "default" property that is the property that will
134      * mostly commonly be initially chosen for update by human's who are
135      * customizing the bean.
136      * @return Index of default property in the PropertyDescriptor array
137      * returned by getPropertyDescriptors.
138      * <P> Returns -1 if there is no default property.
139      */

140     public int getDefaultPropertyIndex() {
141         return defaultPropertyIndex;
142     }
143     
144     /**
145      * A bean may have a "default" event that is the event that will
146      * mostly commonly be used by human's when using the bean.
147      * @return Index of default event in the EventSetDescriptor array
148      * returned by getEventSetDescriptors.
149      * <P> Returns -1 if there is no default event.
150      */

151     public int getDefaultEventIndex() {
152         return defaultEventIndex;
153     }
154 }
155
156
Popular Tags