1 package KelpEclipse21; 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 KelpEclipse21Plugin extends AbstractUIPlugin { 12 private static KelpEclipse21Plugin plugin; 14 private ResourceBundle resourceBundle; 16 17 20 public KelpEclipse21Plugin(IPluginDescriptor descriptor) { 21 super(descriptor); 22 plugin = this; 23 try { 24 resourceBundle= ResourceBundle.getBundle("KelpEclipse21.KelpEclipse21PluginResources"); 25 } catch (MissingResourceException x) { 26 resourceBundle = null; 27 } 28 } 29 30 33 public static KelpEclipse21Plugin 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= KelpEclipse21Plugin.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 |