Projection_testPlugin.java
上传用户:fanxing
上传日期:2017-01-19
资源大小:36k
文件大小:2k
- /*******************************************************************************
- * Copyright (c) 2005 Prashant Deva.
-
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License - v 1.0
- * which is available at http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
- package projection_test;
- import org.eclipse.ui.plugin.*;
- import org.osgi.framework.BundleContext;
- import java.util.*;
- /**
- * The main plugin class to be used in the desktop.
- */
- public class Projection_testPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static Projection_testPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public Projection_testPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("projection_test.Projection_testPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
- /**
- * Returns the shared instance.
- */
- public static Projection_testPlugin getDefault() {
- return plugin;
- }
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = Projection_testPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
- }