You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ds...@apache.org on 2010/07/23 11:28:56 UTC

svn commit: r967013 - in /felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor: MovePackageParticipant.java RenamePackageParticipant.java

Author: dsavage
Date: Fri Jul 23 09:28:55 2010
New Revision: 967013

URL: http://svn.apache.org/viewvc?rev=967013&view=rev
Log:
reuse utils method to check if project is in sync during refactor

Modified:
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java?rev=967013&r1=967012&r2=967013&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/MovePackageParticipant.java Fri Jul 23 09:28:55 2010
@@ -61,6 +61,9 @@ public class MovePackageParticipant exte
                 
                 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);
                     

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java?rev=967013&r1=967012&r2=967013&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/refactor/RenamePackageParticipant.java Fri Jul 23 09:28:55 2010
@@ -30,8 +30,6 @@ import org.apache.felix.sigil.model.Mode
 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.
 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 @@ public class RenamePackageParticipant ex
                 
                 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 @@ public class RenamePackageParticipant ex
                     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 @@ public class RenamePackageParticipant ex
         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();