KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > output > OutputSettingsBeanInfo


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.core.output;
21
22 import java.awt.Image JavaDoc;
23 import java.beans.*;
24
25 import org.openide.util.Utilities;
26 import org.openide.ErrorManager;
27
28 /** BeanInfo for OutputSettings.
29 *
30 * @author Ian Formanek
31 */

32 public class OutputSettingsBeanInfo extends SimpleBeanInfo {
33
34
35     /** Descriptor of valid properties
36     * @return array of properties
37     */

38     public PropertyDescriptor[] getPropertyDescriptors () {
39     try {
40         PropertyDescriptor[] desc = new PropertyDescriptor[] {
41                        new PropertyDescriptor (OutputSettings.PROP_TAB_SIZE, OutputSettings.class, "getTabSize", "setTabSize"), // 1 // NOI18N
42
new PropertyDescriptor (OutputSettings.PROP_HISTORY_SIZE, OutputSettings.class, "getHistorySize", "setHistorySize"), // 8 // NOI18N
43
new PropertyDescriptor (OutputSettings.PROP_REDIRECTION, OutputSettings.class, "isRedirection", "setRedirection"), // 9 // NOI18N
44
new PropertyDescriptor (OutputSettings.PROP_DIRECTORY, OutputSettings.class), // 10 // NOI18N
45
};
46             desc[0].setDisplayName (OutputSettings.getString ("PROP_TAB_SIZE"));
47             desc[0].setShortDescription (OutputSettings.getString ("HINT_TAB_SIZE"));
48             desc[1].setDisplayName (OutputSettings.getString ("PROP_HISTORY_SIZE"));
49             desc[1].setShortDescription (OutputSettings.getString ("HINT_HISTORY_SIZE"));
50             desc[2].setDisplayName (OutputSettings.getString ("PROP_REDIRECTION"));
51             desc[2].setShortDescription (OutputSettings.getString ("HINT_REDIRECTION"));
52             desc[3].setDisplayName (OutputSettings.getString ("PROP_REDIR_LOCATION"));
53             desc[3].setShortDescription (OutputSettings.getString ("HINT_REDIR_LOCATION"));
54             desc[3].setValue("files", Boolean.FALSE);
55             return desc;
56         } catch (IntrospectionException ex) {
57         ErrorManager.getDefault().notify(ex);
58         return null;
59         }
60     }
61
62     /** Returns the OutputSettings' icon */
63     public Image JavaDoc getIcon(int type) {
64         if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16))
65             return Utilities.loadImage("org/netbeans/core/resources/outputSettings.gif"); // NOI18N
66
else
67             return Utilities.loadImage("org/netbeans/core/resources/outputSettings32.gif"); // NOI18N
68
}
69
70 }
71
Popular Tags