KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > diff > builtin > provider > BuiltInDiffProviderBeanInfo


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.modules.diff.builtin.provider;
21
22 import java.beans.*;
23 import org.openide.util.*;
24
25 /**
26  * @author Petr Kuzel
27  */

28 public class BuiltInDiffProviderBeanInfo extends SimpleBeanInfo {
29
30     private static final int PROPERTY_trimLines = 0;
31
32     private static String JavaDoc iconNameC16 = "/org/netbeans/modules/diff/diffSettingsIcon.gif";//GEN-BEGIN:Icons
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 ( BuiltInDiffProvider.class , null );
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         PropertyDescriptor[] properties = new PropertyDescriptor[1];
59     
60         try {
61             properties[PROPERTY_trimLines] = new PropertyDescriptor ( "trimLines", BuiltInDiffProvider.class, "isTrimLines", "setTrimLines" ); // NOI18N
62
properties[PROPERTY_trimLines].setDisplayName ( NbBundle.getMessage(BuiltInDiffProvider.class,"BK0001") );
63             properties[PROPERTY_trimLines].setShortDescription ( NbBundle.getMessage(BuiltInDiffProvider.class,"BK0002") );
64         }
65         catch(IntrospectionException e) {
66             Exceptions.printStackTrace(e);
67         }
68         
69         return properties;
70     }
71     
72     /**
73      * Gets the bean's <code>EventSetDescriptor</code>s.
74      *
75      * @return An array of EventSetDescriptors describing the kinds of
76      * events fired by this bean. May return null if the information
77      * should be obtained by automatic analysis.
78      */

79     public EventSetDescriptor[] getEventSetDescriptors() {
80         return new EventSetDescriptor[0];
81     }
82     
83     /**
84      * Gets the bean's <code>MethodDescriptor</code>s.
85      *
86      * @return An array of MethodDescriptors describing the methods
87      * implemented by this bean. May return null if the information
88      * should be obtained by automatic analysis.
89      */

90     public MethodDescriptor[] getMethodDescriptors() {
91         return new MethodDescriptor[0];
92     }
93     
94     public java.awt.Image JavaDoc getIcon(int iconKind) {
95         return Utilities.loadImage(iconNameC16);
96     }
97     
98 }
99
100
Popular Tags