1 14 package org.eclipse.ui.internal.net; 15 16 import org.eclipse.core.net.proxy.IProxyService; 17 import org.eclipse.ui.plugin.AbstractUIPlugin; 18 import org.osgi.framework.BundleContext; 19 import org.osgi.util.tracker.ServiceTracker; 20 21 24 public class Activator extends AbstractUIPlugin { 25 26 public static final String PLUGIN_ID = "org.eclipse.ui.net"; 29 private static Activator plugin; 31 32 private ServiceTracker tracker; 33 34 37 public Activator() { 38 plugin = this; 39 } 40 41 46 public static Activator getDefault() { 47 return plugin; 48 } 49 50 56 public IProxyService getProxyService() { 57 return (IProxyService) tracker.getService(); 58 } 59 60 public void start(BundleContext context) throws Exception { 61 super.start(context); 62 tracker = new ServiceTracker(getBundle().getBundleContext(), 63 IProxyService.class.getName(), null); 64 tracker.open(); 65 } 66 67 public void stop(BundleContext context) throws Exception { 68 plugin = null; 69 super.stop(context); 70 tracker.close(); 71 } 72 } 73 | Popular Tags |