1 11 package org.eclipse.pde.internal.ui.correction; 12 13 import org.eclipse.pde.internal.core.ibundle.IManifestHeader; 14 import org.eclipse.pde.internal.core.text.bundle.BundleModel; 15 import org.eclipse.pde.internal.core.text.bundle.ExportPackageHeader; 16 import org.eclipse.pde.internal.core.text.bundle.ExportPackageObject; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.osgi.framework.Constants; 19 20 public class RemoveInternalDirectiveEntryResolution extends 21 AbstractManifestMarkerResolution { 22 23 private String fPackageName; 24 25 public RemoveInternalDirectiveEntryResolution(int type, String packageName) { 26 super(type); 27 fPackageName = packageName; 28 } 29 30 protected void createChange(BundleModel model) { 31 IManifestHeader header = model.getBundle().getManifestHeader(Constants.EXPORT_PACKAGE); 32 if (header instanceof ExportPackageHeader) { 33 ExportPackageObject exportedPackage = ((ExportPackageHeader)header).getPackage(fPackageName); 34 if (exportedPackage != null) 35 exportedPackage.removeInternalDirective(); 36 } 37 } 38 39 public String getLabel() { 40 return PDEUIMessages.RemoveInternalDirective_label; 41 } 42 43 public String getDescription() { 44 return PDEUIMessages.RemoveInternalDirective_desc; 45 } 46 47 } 48 | Popular Tags |