blob: 14ac9ccdd808dd2e5fd19947eb5f41f58ec62103 [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2005, 2011 IBM Corporation.
* 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
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ptp.pldt.mpi.fortran;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used for MPI development Tools.
*/
public class Activator extends AbstractUIPlugin {
/** The shared instance */
private static Activator plugin;
protected static final boolean traceOn = false;
private static final String PLUGIN_ID = "org.eclipse.ptp.pldt.mpi.fortran"; //$NON-NLS-1$
/**
* The constructor.
*/
public Activator() {
super();
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static Activator getDefault() {
return plugin;
}
/**
* Returns the workspace instance.
*/
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
/**
* Returns the standard display to be used. The method first checks, if the
* thread calling this method has an associated display. If so, this display
* is returned. Otherwise the method returns the default display.
*/
public static Display getStandardDisplay() {
Display display;
display = Display.getCurrent();
if (display == null) {
display = Display.getDefault();
}
return display;
}
public static String getPluginId() {
return PLUGIN_ID;
}
}