1 16 package org.apache.axis.tool.service.eclipse.plugin; 17 18 import java.util.MissingResourceException ; 19 import java.util.ResourceBundle ; 20 21 import org.eclipse.jface.resource.ImageDescriptor; 22 import org.eclipse.ui.plugin.AbstractUIPlugin; 23 import org.osgi.framework.BundleContext; 24 25 28 public class ServiceArchiver extends AbstractUIPlugin { 29 private static ServiceArchiver plugin; 31 private ResourceBundle resourceBundle; 33 private static ImageDescriptor wizardImageDescriptor; 34 37 public ServiceArchiver() { 38 super(); 39 plugin = this; 40 try { 41 resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.service.resource.ServiceResources"); 42 } catch (MissingResourceException x) { 43 resourceBundle = null; 44 } 45 } 46 47 50 public void start(BundleContext context) throws Exception { 51 super.start(context); 52 } 53 54 57 public void stop(BundleContext context) throws Exception { 58 super.stop(context); 59 } 60 61 64 public static ServiceArchiver getDefault() { 65 return plugin; 66 } 67 68 72 public static String getResourceString(String key) { 73 ResourceBundle bundle = ServiceArchiver.getDefault().getResourceBundle(); 74 try { 75 return (bundle != null) ? bundle.getString(key) : key; 76 } catch (MissingResourceException e) { 77 return key; 78 } 79 } 80 81 84 public ResourceBundle getResourceBundle() { 85 return resourceBundle; 86 } 87 88 public static ImageDescriptor getWizardImageDescriptor(){ 89 if (wizardImageDescriptor==null){ 90 wizardImageDescriptor =ServiceArchiver.imageDescriptorFromPlugin("Axis_Service_Archiver","icons/asf-feather.gif"); 91 } 92 return wizardImageDescriptor; 93 } 94 } 95 | Popular Tags |