KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > forte > services > XMLCCompilerTypeBeanInfo


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  * Lisa Reese
21  *
22  */

23
24 package org.enhydra.kelp.forte.services;
25
26 import java.awt.Image JavaDoc;
27 import java.beans.*;
28
29 import org.openide.compiler.ExternalCompilerType;
30 import org.openide.util.NbBundle;
31
32 /** Description of the compiler type.
33  *
34  * @author rees0234
35  */

36 public class XMLCCompilerTypeBeanInfo extends SimpleBeanInfo {
37     /** Icons for compiler settings objects. */
38
39 /* private static PropertyDescriptor[] desc;
40
41     static {
42         try {
43                 desc = new PropertyDescriptor[] {
44
45                 new PropertyDescriptor (XMLCCompilerType.NAME_AUTO_PACK, XMLCCompilerType.class), // 0
46                 new PropertyDescriptor (XMLCCompilerType.NAME_LIBRARIES, XMLCCompilerType.class), // 1
47                 new PropertyDescriptor (XMLCCompilerType.NAME_GENTO, XMLCCompilerType.class), // 2
48                 new PropertyDescriptor (XMLCCompilerType.NAME_XMLC_CUSTOM, XMLCCompilerType.class), // 3
49                 new PropertyDescriptor (XMLCCompilerType.NAME_WORKING_DIR, XMLCCompilerType.class), // 4 NOI18N
50                 new PropertyDescriptor(XMLCCompilerType.NAME_XMLC_TYPE, XMLCCompilerType.class), // 5 // NOI18N
51                 new PropertyDescriptor(XMLCCompilerType.NAME_XMLC_OPTION_FILEPATH, XMLCCompilerType.class), // 6 // NOI18
52                 new PropertyDescriptor (XMLCCompilerType.NAME_XMLC_PARAMETERS, XMLCCompilerType.class), // 0
53                 new PropertyDescriptor (XMLCCompilerType.XMLC_BUILD, XMLCCompilerType.class), // 1
54                 new PropertyDescriptor (XMLCCompilerType.XMLC_PRINT_DOM, XMLCCompilerType.class), // 2
55                 new PropertyDescriptor (XMLCCompilerType.XMLC_PRINT_PARSE, XMLCCompilerType.class), // 3
56                 new PropertyDescriptor (XMLCCompilerType.XMLC_PRINT_DOC, XMLCCompilerType.class), // 4 NOI18N
57                 new PropertyDescriptor(XMLCCompilerType.XMLC_VERBOSE, XMLCCompilerType.class), // 5 // NOI18N
58                 new PropertyDescriptor(XMLCCompilerType.XMLC_PRINT_ACCESSOR, XMLCCompilerType.class), // 6 // NOI18N
59            };
60
61             desc[0].setDisplayName("autoPack");
62             desc[0].setShortDescription("autoPackDesc");
63
64             desc[1].setDisplayName("libraries");
65             desc[1].setShortDescription("libariesDesc");
66
67             desc[2].setDisplayName("genTo");
68             desc[2].setShortDescription("genToDesc");
69
70             desc[3].setDisplayName("Custom");
71             desc[3].setShortDescription("customDesc");
72
73         desc[4].setDisplayName("workingDir");
74         desc[4].setShortDescription("workDirDesc");
75             //desc[4].setPropertyEditorClass(org.netbeans.modules.java.FileSystemPE.class);
76
77             desc[5].setDisplayName("type");
78             desc[5].setShortDescription("typeDesc");
79             desc[5].setExpert(true);
80
81             desc[6].setDisplayName("options");
82             desc[6].setShortDescription("optionsDesc");
83             desc[6].setExpert(true);
84
85             desc[9].setDisplayName("DOMprint");
86             desc[9].setShortDescription("DOMPrintDesc");
87             desc[9].setExpert(true);
88
89         } catch (IntrospectionException ex) {
90         ex.printStackTrace();
91            // throw new InternalError(MSGERRINIT);
92         }
93     }
94     // Inherit properties and so on from ExternalCompilerType.
95     public BeanInfo[] getAdditionalBeanInfo () {
96         try {
97             return new BeanInfo[] {
98                        Introspector.getBeanInfo (ExternalCompilerType.class)
99                    };
100         } catch (IntrospectionException ie) {
101             if (Boolean.getBoolean ("netbeans.debug.exceptions"))
102                 ie.printStackTrace ();
103             return null;
104         }
105     }
106
107     public BeanDescriptor getBeanDescriptor () {
108         // Here is where to include a customizer class if you have one:
109         BeanDescriptor desc = new BeanDescriptor (XMLCCompilerType.class);
110         // Display name also serves as default for instances:
111         desc.setDisplayName (NbBundle.getMessage (XMLCCompilerTypeBeanInfo.class, "LBL_CompilerType"));
112         desc.setShortDescription (NbBundle.getMessage (XMLCCompilerTypeBeanInfo.class, "HINT_CompilerType"));
113         return desc;
114     }
115
116     public PropertyDescriptor[] getPropertyDescriptors () {
117         return desc;
118     }
119 /* try {
120             PropertyDescriptor valueOfMyOption = new PropertyDescriptor ("valueOfMyOption", XMLCCompilerType.class);
121             valueOfMyOption.setDisplayName (NbBundle.getMessage (XMLCCompilerCompilerTypeBeanInfo.class, "PROP_valueOfMyOption"));
122             valueOfMyOption.setShortDescription (NbBundle.getMessage (XMLCCompilerCompilerTypeBeanInfo.class, "HINT_valueOfMyOption"));
123             // If you wish to provide a custom set of preconfigured error expressions:
124             /*
125             PropertyDescriptor errorExpression = new PropertyDescriptor ("errorExpression", XMLCCompilerCompilerType.class);
126             errorExpression.setDisplayName (NbBundle.getMessage (XMLCCompilerTypeBeanInfo.class, "PROP_errorExpression"));
127             errorExpression.setShortDescription (NbBundle.getMessage (XMLCCompilerTypeBeanInfo.class, "HINT_errorExpression"));
128             errorExpression.setPropertyEditorClass (ErrExprEd.class);
129             */

130 // return new PropertyDescriptor[] { valueOfMyOption /* , errorExpression */ };
131
/* } catch (IntrospectionException ie) {
132             if (Boolean.getBoolean ("netbeans.debug.exceptions"))
133                 ie.printStackTrace ();
134             return null;
135         }
136     }*/

137
138     private static Image JavaDoc icon, icon32;
139     public Image JavaDoc getIcon (int type) {
140         if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
141             if (icon == null)
142                 icon = loadImage ("XMLCCompilerIcon.gif");
143             return icon;
144         } else {
145             if (icon32 == null)
146                 icon32 = loadImage ("XMLCCompilerIcon32.gif");
147             return icon32;
148         }
149     }
150
151     /*
152     public static class ErrExprEd extends org.openide.explorer.propertysheet.editors.ExternalCompiler.ErrorExpressionEditor {
153
154     public ErrExprEd () {
155         super (makeCollection ());
156     }
157
158     private static Collection makeCollection () {
159         java.util.List list = new java.util.ArrayList ();
160             list.addAll (java.util.Arrays.asList (XMLCCompilerCompilerType.ERROR_EXPRS));
161         return list;
162     }
163
164     }
165     */

166
167 }
168
Popular Tags