ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r988067 - /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java
Date Mon, 23 Aug 2010 10:36:45 GMT
Author: hibou
Date: Mon Aug 23 10:36:45 2010
New Revision: 988067

URL: http://svn.apache.org/viewvc?rev=988067&view=rev
Log:
IVYDE-56: ...work still in progress...
 * refresh after retrieve was lost in the move

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java?rev=988067&r1=988066&r2=988067&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/menu/RetrieveAction.java
Mon Aug 23 10:36:45 2010
@@ -20,13 +20,16 @@ package org.apache.ivyde.eclipse.ui.menu
 import java.io.IOException;
 
 import org.apache.ivy.Ivy;
+import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.retrieve.RetrieveOptions;
 import org.apache.ivy.util.filter.ArtifactTypeFilter;
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.apache.ivyde.eclipse.cpcontainer.RefreshFolderJob;
 import org.apache.ivyde.eclipse.retrieve.StandaloneRetrieveSetup;
+import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.action.Action;
@@ -63,7 +66,15 @@ public class RetrieveAction extends Acti
             return;
         }
         try {
-            ivy.retrieve(md.getModuleRevisionId(), pattern, c);
+            int numberOfItemsRetrieved = ivy.retrieve(md.getModuleRevisionId(), pattern,
c);
+            if (numberOfItemsRetrieved > 0) {
+                // Only refresh if we actually retrieved a file.
+                String refreshPath = IvyPatternHelper.getTokenRoot(retrieveSetup.getRetrieveSetup()
+                        .getRetrievePattern());
+                IFolder folder = project.getFolder(refreshPath);
+                RefreshFolderJob refreshFolderJob = new RefreshFolderJob(folder);
+                refreshFolderJob.schedule();
+            }
         } catch (IOException e) {
             IvyPlugin.log(IStatus.ERROR, "Error while retrieving '" + retrieveSetup.getName()
                     + "' in " + retrieveSetup.getProject().getName(), e);



Mime
View raw message