1 11 package org.eclipse.pde.internal.ui.correction; 12 13 import org.eclipse.osgi.util.NLS; 14 import org.eclipse.pde.internal.core.text.bundle.Bundle; 15 import org.eclipse.pde.internal.core.text.bundle.BundleModel; 16 import org.eclipse.pde.internal.core.text.bundle.RequireBundleHeader; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.osgi.framework.Constants; 19 20 public class RemoveRequireBundleResolution extends AbstractManifestMarkerResolution { 21 22 private String fBundleId; 23 24 public RemoveRequireBundleResolution(int type, String bundleID) { 25 super(type); 26 fBundleId = bundleID; 27 } 28 29 protected void createChange(BundleModel model) { 30 Bundle bundle = (Bundle)model.getBundle(); 31 RequireBundleHeader header = (RequireBundleHeader)bundle.getManifestHeader(Constants.REQUIRE_BUNDLE); 32 if (header != null) 33 header.removeBundle(fBundleId); 34 } 35 36 public String getDescription() { 37 return NLS.bind(PDEUIMessages.RemoveRequireBundleResolution_description, fBundleId); 38 } 39 40 public String getLabel() { 41 return NLS.bind(PDEUIMessages.RemoveRequireBundleResolution_label, fBundleId); 42 } 43 44 } 45 | Popular Tags |