Activator.java

Go to the documentation of this file.
00001 package edu.rice.cs.hpc.viewer.framework;
00002 
00003 import org.eclipse.jface.resource.ImageDescriptor;
00004 import org.eclipse.jface.resource.ImageRegistry;
00005 import org.eclipse.ui.plugin.AbstractUIPlugin;
00006 import org.osgi.framework.BundleContext;
00007 
00008 import edu.rice.cs.hpc.viewer.resources.Icons;
00009 
00013 public class Activator extends AbstractUIPlugin {
00014 
00015     // The plug-in ID
00016     public static final String PLUGIN_ID = "edu.rice.cs.hpc.viewer";
00017     
00018     // The shared instance
00019     private static Activator plugin;
00020     
00024     public Activator() {
00025     }
00026 
00027     /*
00028      * (non-Javadoc)
00029      * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
00030      */
00031     public void start(BundleContext context) throws Exception {
00032         super.start(context);
00033         plugin = this;
00034     }
00035 
00036     /*
00037      * (non-Javadoc)
00038      * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
00039      */
00040     public void stop(BundleContext context) throws Exception {
00041         plugin = null;
00042         super.stop(context);
00043     }
00044 
00050     public static Activator getDefault() {
00051         return plugin;
00052     }
00053 
00061     public static ImageDescriptor getImageDescriptor(String path) {
00062         return imageDescriptorFromPlugin(PLUGIN_ID, path);
00063     }
00064     
00065     /*
00066      * (non-Javadoc)
00067      * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
00068      */
00069     protected void initializeImageRegistry(ImageRegistry registry) {
00070         Icons.getInstance().init(registry);
00071     }
00072 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1