/*******************************************************************************
* Copyright (c) 2009 University of Edinburgh.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the BSD Licence, which accompanies this feature
* and can be downloaded from http://groups.inf.ed.ac.uk/pepa/update/licence.txt
******************************************************************************/
package uk.ac.ed.inf.biopepa.ui;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import uk.ac.ed.inf.biopepa.ui.editors.ColourManager;
/**
* The activator class controls the plug-in life cycle
*/
public class BioPEPAPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "uk.ac.ed.inf.biopepa.ui";
// The shared instance
private static BioPEPAPlugin plugin;
private BioPEPAManager manager;
private ColourManager colourManager;
/**
* The constructor
*/
public BioPEPAPlugin() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
manager = new BioPEPAManager();
colourManager = new ColourManager();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
manager.shutdown();
colourManager.dispose();
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static BioPEPAPlugin getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
public BioPEPAManager getBioPEPAManager() {
return manager;
}
public ColourManager getColourManager() {
return colourManager;
}
public void log(IStatus status) {
getLog().log(status);
}
}