KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > catalog > impl > SystemCatalogReaderBeanInfo


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.catalog.impl;
20
21 import java.beans.*;
22 import java.awt.Image JavaDoc;
23
24 import org.openide.util.Utilities;
25
26 public class SystemCatalogReaderBeanInfo extends SimpleBeanInfo {
27
28     private static final String JavaDoc ICON_DIR_BASE = "org/netbeans/modules/xml/catalog/impl/"; // NOI18N
29

30     /**
31      * Gets the bean's <code>BeanDescriptor</code>s.
32      *
33      * @return BeanDescriptor describing the editable
34      * properties of this bean. May return null if the
35      * information should be obtained by automatic analysis.
36      */

37     public BeanDescriptor getBeanDescriptor() {
38         BeanDescriptor beanDescriptor = new BeanDescriptor ( SystemCatalogReader.class , SystemCatalogCustomizer.class );
39
40         beanDescriptor.setDisplayName ( Util.THIS.getString("NAME_system_catalog") );
41         beanDescriptor.setShortDescription ( Util.THIS.getString("TEXT_system_catalog_desc") );
42     return beanDescriptor;
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     return new PropertyDescriptor[0];
59     }
60
61     /**
62      * Gets the bean's <code>EventSetDescriptor</code>s.
63      *
64      * @return An array of EventSetDescriptors describing the kinds of
65      * events fired by this bean. May return null if the information
66      * should be obtained by automatic analysis.
67      */

68     public EventSetDescriptor[] getEventSetDescriptors() {
69     return new EventSetDescriptor[0];
70     }
71
72     /**
73      * Gets the bean's <code>MethodDescriptor</code>s.
74      *
75      * @return An array of MethodDescriptors describing the methods
76      * implemented by this bean. May return null if the information
77      * should be obtained by automatic analysis.
78      */

79     public MethodDescriptor[] getMethodDescriptors() {
80     return new MethodDescriptor[0];
81     }
82
83     public Image JavaDoc getIcon (int type) {
84         if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) ||
85             (type == java.beans.BeanInfo.ICON_MONO_16x16)) {
86
87             return Utilities.loadImage (ICON_DIR_BASE + "sysCatalog.gif"); // NOI18N
88
} else {
89             return null;
90         }
91     }
92
93 }
94
Popular Tags