/*******************************************************************************
* Copyright (c) 2008 Scott Stanchfield
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package com.javadude.workingsets.internal;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
* @author Scott Stanchfield
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.javadude.workingsets";
// The shared instance
private static Activator plugin;
public Activator() {
// do nothing
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
Activator.plugin = this;
// force the working set updaters to load
Class.forName(NatureWorkingSetUpdater.class.getName());
Class.forName(RegExWorkingSetUpdater.class.getName());
}
@Override
public void stop(BundleContext context) throws Exception {
Activator.plugin = null;
super.stop(context);
}
public static Activator getDefault() {
return Activator.plugin;
}
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}