1 package org.enhydra.kelp.eclipse; 2 3 import org.eclipse.ui.plugin.*; 4 import org.eclipse.core.runtime.*; 5 import org.eclipse.core.resources.*; 6 import java.util.*; 7 8 11 public class KelpPlugin extends AbstractUIPlugin { 12 private static KelpPlugin plugin; 14 private ResourceBundle resourceBundle; 16 17 20 public KelpPlugin(IPluginDescriptor descriptor) { 21 super(descriptor); 22 plugin = this; 23 try { 24 resourceBundle= ResourceBundle.getBundle("org.enhydra.kelp.eclipse.KelpPluginResources"); 25 } catch (MissingResourceException x) { 26 resourceBundle = null; 27 } 28 } 29 30 33 public static KelpPlugin getDefault() { 34 return plugin; 35 } 36 37 40 public static IWorkspace getWorkspace() { 41 return ResourcesPlugin.getWorkspace(); 42 } 43 44 48 public static String getResourceString(String key) { 49 ResourceBundle bundle= KelpPlugin.getDefault().getResourceBundle(); 50 try { 51 return bundle.getString(key); 52 } catch (MissingResourceException e) { 53 return key; 54 } 55 } 56 57 60 public ResourceBundle getResourceBundle() { 61 return resourceBundle; 62 } 63 } 64 | Popular Tags |