1 11 package org.eclipse.update.internal.operations; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.update.configuration.*; 15 import org.eclipse.update.core.*; 16 import org.eclipse.update.operations.*; 17 18 19 public abstract class FeatureOperation extends Operation implements IFeatureOperation { 20 21 protected IFeature feature; 22 protected IFeature oldFeature; 23 protected IConfiguredSite targetSite; 24 25 27 28 public FeatureOperation(IConfiguredSite targetSite, IFeature feature) { 29 super(); 30 this.feature = feature; 31 this.targetSite = targetSite; 32 } 33 34 public IFeature getFeature() { 35 return feature; 36 } 37 38 public IFeature getOldFeature() { 39 return oldFeature; 40 } 41 42 46 public IConfiguredSite getTargetSite() { 47 return targetSite; 48 } 49 50 public void setTargetSite(IConfiguredSite targetSite) { 51 this.targetSite = targetSite; 52 } 53 54 55 static boolean unconfigure(IFeature feature, IConfiguredSite site) 56 throws CoreException { 57 IInstallConfiguration config = SiteManager.getLocalSite().getCurrentConfiguration(); 58 if (site == null) 59 site = UpdateUtils.getConfigSite(feature, config); 60 61 if (site != null) { 62 PatchCleaner cleaner = new PatchCleaner(site, feature); 63 boolean result = site.unconfigure(feature); 64 cleaner.dispose(); 65 return result; 66 } 67 return false; 68 } 69 70 public void setFeature(IFeature feature) { 71 this.feature = feature; 72 } 73 74 75 } 76 | Popular Tags |