1
/*******************************************************************************
2
* Copyright (c) 2005, 2009 QNX Software Systems and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* QNX Software Systems - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.make.core.tests;
13
import org.eclipse.core.runtime.Plugin;
14
import org.osgi.framework.BundleContext;
18
* The main plugin class to be used in the desktop.
20
public class MakeTestsPlugin extends Plugin {
21
//The shared instance.
22
private static MakeTestsPlugin plugin;
24
private ResourceBundle resourceBundle;
29
public MakeTestsPlugin() {
35
* This method is called upon plug-in activation
38
public void start(BundleContext context) throws Exception {
43
* This method is called when the plug-in is stopped
46
public void stop(BundleContext context) throws Exception {
49
resourceBundle = null;
53
* Returns the shared instance.
55
public static MakeTestsPlugin getDefault() {
60
* Returns the string from the plugin's resource bundle,
61
* or 'key' if not found.
63
public static String getResourceString(String key) {
64
ResourceBundle bundle = MakeTestsPlugin.getDefault().getResourceBundle();
66
return (bundle != null) ? bundle.getString(key) : key;
67
} catch (MissingResourceException e) {
73
* Returns the plugin's resource bundle,
75
public ResourceBundle getResourceBundle() {
77
if (resourceBundle == null)
78
resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.make.core.tests.MakeTestsPluginResources");
79
} catch (MissingResourceException x) {
80
resourceBundle = null;
82
return resourceBundle;