1 11 package org.eclipse.core.runtime.adaptor; 12 13 import org.eclipse.osgi.internal.resolver.BundleInstaller; 14 import org.eclipse.osgi.service.resolver.BundleDescription; 15 import org.osgi.framework.Bundle; 16 import org.osgi.framework.BundleException; 17 18 21 public class EclipseBundleInstaller implements BundleInstaller { 23 public void installBundle(BundleDescription toInstall) throws BundleException { 24 EclipseAdaptor.getDefault().getContext().installBundle(toInstall.getLocation()); 25 } 26 27 public void uninstallBundle(BundleDescription toUninstallId) throws BundleException { 28 Bundle toUninstall = EclipseAdaptor.getDefault().getContext().getBundle(toUninstallId.getBundleId()); 29 if (toUninstall != null) 30 toUninstall.uninstall(); 31 } 32 33 public void updateBundle(BundleDescription toUpdateId) throws BundleException { 34 Bundle toUpdate = EclipseAdaptor.getDefault().getContext().getBundle(toUpdateId.getBundleId()); 35 if (toUpdate != null) 36 toUpdate.update(); 37 } 38 } | Popular Tags |