1 11 package org.eclipse.ui.internal.presentations.r21; 12 13 import java.util.MissingResourceException ; 14 import java.util.ResourceBundle ; 15 16 import org.eclipse.ui.plugin.AbstractUIPlugin; 17 import org.osgi.framework.BundleContext; 18 19 22 public class R21PresentationPlugin extends AbstractUIPlugin { 23 private static R21PresentationPlugin plugin; 25 26 private ResourceBundle resourceBundle; 28 29 32 public R21PresentationPlugin() { 33 super(); 34 plugin = this; 35 try { 36 resourceBundle = ResourceBundle 37 .getBundle("org.eclipse.ui.internal.r21presentation.R21lookPluginResources"); } catch (MissingResourceException x) { 39 resourceBundle = null; 40 } 41 } 42 43 46 public static R21PresentationPlugin getDefault() { 47 return plugin; 48 } 49 50 54 public static String getResourceString(String key) { 55 ResourceBundle bundle = R21PresentationPlugin.getDefault() 56 .getResourceBundle(); 57 try { 58 return (bundle != null) ? bundle.getString(key) : key; 59 } catch (MissingResourceException e) { 60 return key; 61 } 62 } 63 64 67 public ResourceBundle getResourceBundle() { 68 return resourceBundle; 69 } 70 71 74 public void start(BundleContext context) throws Exception { 75 super.start(context); 76 R21Colors.startup(); 77 } 78 79 82 public void stop(BundleContext context) throws Exception { 83 super.stop(context); 84 R21Colors.shutdown(); 85 } 86 } 87 | Popular Tags |