1 11 package org.eclipse.core.internal.registry; 12 13 import org.eclipse.core.runtime.IPluginDescriptor; 14 import org.eclipse.core.runtime.InvalidRegistryObjectException; 15 import org.osgi.framework.Bundle; 16 17 22 public class ExtensionHandle extends BaseExtensionHandle { 23 24 static final ExtensionHandle[] EMPTY_ARRAY = new ExtensionHandle[0]; 25 26 public ExtensionHandle(IObjectManager objectManager, int id) { 27 super(objectManager, id); 28 } 29 30 public IPluginDescriptor getDeclaringPluginDescriptor() throws InvalidRegistryObjectException { 31 String namespace = getContributor().getName(); 32 IPluginDescriptor result = RegistryCompatibilityHelper.getPluginDescriptor(namespace); 33 if (result == null) { 34 Bundle underlyingBundle = BundleHelper.getDefault().getBundle(namespace); 35 if (underlyingBundle != null) { 36 Bundle[] hosts = BundleHelper.getDefault().getHosts(underlyingBundle); 37 if (hosts != null) 38 result = RegistryCompatibilityHelper.getPluginDescriptor(hosts[0].getSymbolicName()); 39 } 40 } 41 42 return result; 43 } 44 } 45 | Popular Tags |