reuse utils method to check if project is in sync during refactor


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@967013 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java
index 7ad5e0b..0f80102 100644
--- a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java
+++ b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java
@@ -61,6 +61,9 @@
                 
                 RefactoringStatus status = new RefactoringStatus();
                 if ( !sourceProject.equals(destProject) ) {                    
+                    RefactorUtil.touch(context, sourceProject);
+                    RefactorUtil.touch(context, destProject);
+                    
                     final String packageName = packageFragment.getElementName();
                     IPackageExport oldExport = ModelHelper.findExport(sourceProject, packageName);
                     
diff --git a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java
index c8f2387..01d1b55 100644
--- a/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java
+++ b/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java
@@ -30,8 +30,6 @@
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
@@ -42,7 +40,6 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.ltk.core.refactoring.participants.ResourceChangeChecker;
 
 public class RenamePackageParticipant extends RenameParticipant
 {
@@ -67,7 +64,7 @@
                 
                 if (oldExport != null) {
                     // record change to check if out of sync...
-                    touch(context, sigil);
+                    RefactorUtil.touch(context, sigil);
                                 
                     status = RefactoringStatus.createWarningStatus("Package " + packageName + " is exported. Renaming this package may effect bundles outside of this workspace");
                     SigilCore.log("Export Package " + packageName + " renamed to " + getArguments().getNewName());
@@ -81,7 +78,7 @@
                     for ( ISigilProjectModel other : SigilCore.getRoot().getProjects() ) {
                         if ( !sigil.equals(other) ) {
                             // record change to check if out of sync...
-                            touch(context, other);
+                            RefactorUtil.touch(context, other);
                         }
                         changes.add(createImportChange(status, other, oldExport, newExport));
                     }
@@ -126,14 +123,6 @@
         return true;
     }
 
-    private static final void touch(CheckConditionsContext context, ISigilProjectModel sigil)
-    {
-        ResourceChangeChecker checker = (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class);
-        IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory();        
-        IFile file = sigil.getProject().getFile(SigilCore.SIGIL_PROJECT_FILE);
-        deltaFactory.change(file);
-    }
-
     private Change createImportChange(RefactoringStatus status, ISigilProjectModel sigil, IPackageExport oldExport, IPackageExport newExport)
     {
         IBundleModelElement info = sigil.getBundle().getBundleInfo();