KickJava   Java API By Example, From Geeks To Geeks.

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


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.TreeConditionalSection;
23 import org.netbeans.modules.xml.tax.beans.customizer.TreeConditionalSectionCustomizer;
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 TreeConditionalSectionBeanInfo 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 ( TreeConditionalSection.class , TreeConditionalSectionCustomizer.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_ignoredContent = 0;
59         int PROPERTY_include = 1;
60         PropertyDescriptor[] properties = new PropertyDescriptor[2];
61
62         try {
63             properties[PROPERTY_ignoredContent] = new PropertyDescriptor ( "ignoredContent", TreeConditionalSection.class, "getIgnoredContent", null ); // NOI18N
64
properties[PROPERTY_ignoredContent].setDisplayName ( Util.THIS.getString ( "PROP_TreeConditionalSectionBeanInfo_ignoredContent" ) );
65             properties[PROPERTY_ignoredContent].setShortDescription ( Util.THIS.getString ( "HINT_TreeConditionalSectionBeanInfo_ignoredContent" ) );
66             properties[PROPERTY_ignoredContent].setPropertyEditorClass ( NullStringEditor.class );
67
68             properties[PROPERTY_include] = new PropertyDescriptor ( "include", TreeConditionalSection.class, "isInclude", null ); // NOI18N
69
properties[PROPERTY_include].setDisplayName ( Util.THIS.getString ( "PROP_TreeConditionalSectionBeanInfo_include" ) );
70             properties[PROPERTY_include].setShortDescription ( Util.THIS.getString ( "HINT_TreeConditionalSectionBeanInfo_include" ) );
71         } catch( IntrospectionException e) {
72             Exceptions.printStackTrace(e);
73         }
74         return properties;
75     }
76
77     /**
78      * Gets the bean's <code>EventSetDescriptor</code>s.
79      *
80      * @return An array of EventSetDescriptors describing the kinds of
81      * events fired by this bean. May return null if the information
82      * should be obtained by automatic analysis.
83      */

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

102     public MethodDescriptor[] getMethodDescriptors() {
103     return new MethodDescriptor[0];
104     }
105
106 }
107
Popular Tags