KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > javadoc > httpfs > HTTPFileSystemBeanInfo


1 /**************************************************************************
2  *
3  * The contents of this file are subject to the terms of the Common Development
4  * and Distribution License (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
8  * or http://www.netbeans.org/cddl.txt.
9  *
10  * When distributing Covered Code, include this CDDL Header Notice in each file
11  * and include the License file at http://www.netbeans.org/cddl.txt.
12  * If applicable, add the following below the CDDL Header, with the fields
13  * enclosed by brackets [] replaced by your own identifying information:
14  * "Portions Copyrighted [year] [name of copyright owner]"
15  *
16  * The Original Software is the HTTP Javadoc Filesystem.
17  * The Initial Developer of the Original Software is Jeffrey A. Keyser.
18  * Portions created by Jeffrey A. Keyser are Copyright (C) 2000-2005.
19  * All Rights Reserved.
20  *
21  * Contributor(s): Jeffrey A. Keyser.
22  *
23  **************************************************************************/

24
25
26 package org.netbeans.modules.javadoc.httpfs;
27
28 import java.beans.*;
29 import java.awt.Image JavaDoc;
30
31 import org.openide.util.NbBundle;
32 import org.openide.filesystems.FileSystem;
33 import org.openide.util.Utilities;
34
35
36 /**
37  * <p>Provides information about the "HTTP Javadoc Filesystem" bean.</p>
38  *
39  * @since 1.0
40  */

41 public class HTTPFileSystemBeanInfo extends SimpleBeanInfo {
42     
43     // Property descriptors
44
private PropertyDescriptor[] propertyDescriptors = null;
45         
46     /**
47      * Returns this bean's property descriptors.
48      *
49      * @since 1.0
50      */

51     public PropertyDescriptor[] getPropertyDescriptors() {
52         
53         if( propertyDescriptors == null ){
54             try {
55
56                 propertyDescriptors = new PropertyDescriptor[ 3 ];
57
58                 // URL property
59
propertyDescriptors[ 0 ] = new PropertyDescriptor( HTTPFileSystem.PROP_URL, HTTPFileSystem.class, "getURL", "setURL" ); // NOI18N
60
propertyDescriptors[ 0 ].setDisplayName( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "PROP_URLPropertyName" ) ); //NOI18N
61
propertyDescriptors[ 0 ].setShortDescription( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "HINT_URLPropertyName" ) ); //NOI18N
62
propertyDescriptors[ 0 ].setBound( true );
63                 propertyDescriptors[ 0 ].setConstrained( true );
64                 propertyDescriptors[ 0 ].setPreferred( true );
65
66                 // RefreshRate property
67
propertyDescriptors[ 1 ] = new PropertyDescriptor( HTTPFileSystem.PROP_REFRESH_RATE, HTTPFileSystem.class, "getRefreshRate", "setRefreshRate" ); // NOI18N
68
propertyDescriptors[ 1 ].setDisplayName( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "PROP_RefreshRatePropertyName" ) ); //NOI18N
69
propertyDescriptors[ 1 ].setShortDescription( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "HINT_RefreshRatePropertyName" ) ); //NOI18N
70
propertyDescriptors[ 1 ].setBound( true );
71                 propertyDescriptors[ 1 ].setConstrained( true );
72                 propertyDescriptors[ 1 ].setExpert( true );
73
74                 // State property
75
propertyDescriptors[ 2 ] = new PropertyDescriptor( HTTPFileSystem.PROP_STATE, HTTPFileSystem.class, "getState", null ); // NOI18N
76
propertyDescriptors[ 2 ].setBound( true );
77                 propertyDescriptors[ 2 ].setConstrained( false );
78                 propertyDescriptors[ 2 ].setHidden( true );
79
80             }
81             catch( IntrospectionException e ) {
82                 org.openide.ErrorManager.getDefault().notify(e);
83             }
84         }
85         return propertyDescriptors;
86     }
87
88     /**
89      * Returns this bean's superclass' BeanInfos.
90      *
91      * @since 1.0
92      */

93     public BeanInfo[] getAdditionalBeanInfo () {
94         try {
95             return new BeanInfo[] { Introspector.getBeanInfo (FileSystem.class) };
96         } catch (IntrospectionException ie) {
97             org.openide.ErrorManager.getDefault().notify(ie);
98             return null;
99         }
100     }
101
102     
103     /**
104      * Returns an icon image for this bean.
105      * @since 1.0
106      */

107     public Image JavaDoc getIcon (int kind) {
108         return Utilities.loadImage( "org/netbeans/modules/javadoc/httpfs/resources/BeanIcon16C.gif" ); // NOI18N
109
}
110
111 }
112
Popular Tags