KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > tool > codegen > eclipse > plugin > CodegenWizardPlugin


1 package org.apache.axis.tool.codegen.eclipse.plugin;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.eclipse.ui.plugin.*;
5 import org.osgi.framework.BundleContext;
6 import java.util.*;
7
8 /**
9  * The main plugin class to be used in the desktop.
10  */

11 public class CodegenWizardPlugin extends AbstractUIPlugin {
12     //The shared instance.
13
private static CodegenWizardPlugin plugin;
14     //Resource bundle.
15
private ResourceBundle resourceBundle;
16     private static ImageDescriptor wizardImageDescriptor;
17     
18     /**
19      * The constructor.
20      */

21     public CodegenWizardPlugin() {
22         super();
23         plugin = this;
24         try {
25             resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.codegen.resource.Codegen");
26         } catch (MissingResourceException x) {
27             resourceBundle = null;
28         }
29     }
30
31     /**
32      * This method is called upon plug-in activation
33      */

34     public void start(BundleContext context) throws Exception JavaDoc {
35         super.start(context);
36     }
37
38     /**
39      * This method is called when the plug-in is stopped
40      */

41     public void stop(BundleContext context) throws Exception JavaDoc {
42         super.stop(context);
43     }
44
45     /**
46      * Returns the shared instance.
47      */

48     public static CodegenWizardPlugin getDefault() {
49         return plugin;
50     }
51
52     /**
53      * Returns the string from the plugin's resource bundle,
54      * or 'key' if not found.
55      */

56     public static String JavaDoc getResourceString(String JavaDoc key) {
57         ResourceBundle bundle = CodegenWizardPlugin.getDefault().getResourceBundle();
58         try {
59             return (bundle != null) ? bundle.getString(key) : key;
60         } catch (MissingResourceException e) {
61             return key;
62         }
63     }
64
65     /**
66      * Returns the plugin's resource bundle,
67      */

68     public ResourceBundle getResourceBundle() {
69         return resourceBundle;
70     }
71     
72     public static ImageDescriptor getWizardImageDescriptor(){
73         if (wizardImageDescriptor==null){
74             wizardImageDescriptor =CodegenWizardPlugin.imageDescriptorFromPlugin("Axis2_Codegen_Wizard","icons/asf-feather.gif");
75         }
76         return wizardImageDescriptor;
77     }
78     
79 }
80
Popular Tags