KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.kelp.forte.services;
2
3 import java.awt.Image JavaDoc;
4 import java.beans.*;
5
6 import org.openide.execution.ProcessExecutor;
7 import org.openide.util.NbBundle;
8
9 /** Description of the executor.
10  *
11  * @author root
12  */

13 public class KelpExecutorBeanInfo extends SimpleBeanInfo {
14
15     // Inherit properties and so on from ProcessExecutor.
16
public BeanInfo[] getAdditionalBeanInfo () {
17         try {
18             return new BeanInfo[] {
19                        Introspector.getBeanInfo (ProcessExecutor.class)
20                    };
21         } catch (IntrospectionException ie) {
22             if (Boolean.getBoolean ("netbeans.debug.exceptions"))
23                 ie.printStackTrace ();
24             return null;
25         }
26     }
27
28     public BeanDescriptor getBeanDescriptor () {
29         // Here is where to include a customizer class if you have one:
30
BeanDescriptor desc = new BeanDescriptor (KelpExecutor.class);
31         // Display name also serves as default for instances:
32
desc.setDisplayName (NbBundle.getMessage (KelpExecutorBeanInfo.class, "LBL_executor"));
33         desc.setShortDescription (NbBundle.getMessage (KelpExecutorBeanInfo.class, "HINT_executor"));
34         return desc;
35     }
36
37     public PropertyDescriptor[] getPropertyDescriptors () {
38         try {
39             PropertyDescriptor valueOfMyOption = new PropertyDescriptor ("valueOfMyOption", KelpExecutor.class);
40             valueOfMyOption.setDisplayName (NbBundle.getMessage (KelpExecutorBeanInfo.class, "PROP_valueOfMyOption"));
41             valueOfMyOption.setShortDescription (NbBundle.getMessage (KelpExecutorBeanInfo.class, "HINT_valueOfMyOption"));
42             return new PropertyDescriptor[] { valueOfMyOption };
43         } catch (IntrospectionException ie) {
44             if (Boolean.getBoolean ("netbeans.debug.exceptions"))
45                 ie.printStackTrace ();
46             return null;
47         }
48     }
49
50     private static Image JavaDoc icon, icon32;
51     public Image JavaDoc getIcon (int type) {
52         if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
53             if (icon == null)
54                 icon = loadImage ("enhydraObject.gif");
55             return icon;
56         } else {
57             if (icon32 == null)
58                 icon32 = loadImage ("enhydraObject32.gif");
59             return icon32;
60         }
61     }
62
63 }
64
Popular Tags