Author: hibou
Date: Wed Aug 13 10:37:20 2008
New Revision: 685616

URL: http://svn.apache.org/viewvc?rev=685616&view=rev
Log:
IVYDE-112:
 - remove the introduced popups which were raised while opening Eclipse
 - fix some error messages

Modified:
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvySettingsEditor.java

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
 Wed Aug 13 10:37:20 2008
@@ -138,7 +138,7 @@
         for (int i = 0; i < projects.length; i++) {
             IvyClasspathContainer cp = 
IvyClasspathUtil.getIvyClasspathContainer(projects[i]);
             if (cp != null && !cp.getConf().isProjectSpecific()) {
-                cp.scheduleRefresh(false);
+                cp.launchResolve(false, false, null);
             }
         }
     }

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
 Wed Aug 13 10:37:20 2008
@@ -177,7 +177,7 @@
      * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
      */
     private IvyResolveJob computeClasspathEntries(final boolean 
usePreviousResolveIfExist,
-            boolean notify, boolean isUser) {
+            boolean isUser) {
         try {
             synchronized (this) {
                 if (job != null) {
@@ -192,15 +192,18 @@
                 if (md == null) {
                     return null;
                 }
-                job = new IvyResolveJob(this, usePreviousResolveIfExist, 
notify, conf, ivy, md);
+                job = new IvyResolveJob(this, usePreviousResolveIfExist, conf, 
ivy, md);
                 job.setUser(isUser);
                 job.setRule(RESOLVE_EVENT_RULE);
                 return job;
             }
         } catch (IvyDEException e) {
-            e.print(IStatus.ERROR, "The resolve job could not be lauched: ");
-            e.log(IStatus.ERROR, "The resolve job could not be lauched: ");
-            e.show(IStatus.ERROR, "IvyDE resolve failed", "The IvyDE resolve 
job could not be lauched: ");
+            e.print(IStatus.ERROR, "The resolve job could not be launched: ");
+            e.log(IStatus.ERROR, "The resolve job could not be launched: ");
+            if (isUser) {
+                e.show(IStatus.ERROR, "IvyDE resolve failed",
+                    "The IvyDE resolve job could not be lauched: ");
+            }
             return null;
         } catch (Throwable e) {
             // IVYDE-79 : catch Throwable in order to catch 
java.lang.NoClassDefFoundError too
@@ -212,44 +215,28 @@
         }
     }
 
-    /**
-     * This method is here to available the Resolve all action to run in a 
single progress window.
-     * It is quiet ugly but it is a first way to do this quiet quickly.
-     * 
-     * @param monitor
-     */
-    public void resolve(IProgressMonitor monitor) {
-        IvyResolveJob j = computeClasspathEntries(false, true, true);
-        if (j != null) {
-            j.run(monitor);
-        }
-    }
-
-    public void scheduleResolve() {
-        IvyResolveJob j = computeClasspathEntries(false, true, true);
+    public void launchResolve(boolean usePreviousResolveIfExist, boolean 
isUser, IProgressMonitor monitor) {
+        IvyResolveJob j = computeClasspathEntries(usePreviousResolveIfExist, 
isUser);
         if (j != null) {
-            j.schedule();
-        }
-    }
-
-    public void scheduleRefresh(boolean isUser) {
-        IvyResolveJob j = computeClasspathEntries(true, true, isUser);
-        if (j != null) {
-            j.schedule();
+            if (monitor != null) {
+                j.run(monitor);
+            } else {
+                j.schedule();
+            }
         }
     }
 
-    void updateClasspathEntries(boolean notify, final IClasspathEntry[] 
newEntries) {
+    void updateClasspathEntries(final IClasspathEntry[] newEntries) {
         IClasspathEntry[] entries;
         if (newEntries != null) {
             entries = newEntries;
         } else {
             entries = new IClasspathEntry[0];
         }
-        setClasspathEntries(entries, notify);
+        setClasspathEntries(entries);
     }
 
-    private void setClasspathEntries(final IClasspathEntry[] entries, final 
boolean notify) {
+    private void setClasspathEntries(final IClasspathEntry[] entries) {
         Display.getDefault().asyncExec(new Runnable() {
             public void run() {
                 if (conf.isInheritedAlphaOrder()) {
@@ -261,9 +248,7 @@
                     });
                 }
                 classpathEntries = entries;
-                if (notify) {
-                    notifyUpdateClasspathEntries();
-                }
+                notifyUpdateClasspathEntries();
             }
         });
     }

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java
 Wed Aug 13 10:37:20 2008
@@ -68,7 +68,7 @@
                     new IClasspathContainer[] {container}, null);
 
                 // now refresh the container to be synchronized with the 
ivy.xml
-                ((IvyClasspathContainer) container).scheduleRefresh(false);
+                ((IvyClasspathContainer) container).launchResolve(false, 
false, null);
             } catch (Exception ex) {
                 IStatus status = new Status(IStatus.ERROR, IvyPlugin.ID, 
IStatus.OK,
                         "Unable to set container for " + 
containerPath.toString(), ex);
@@ -77,20 +77,10 @@
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see 
org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath,
-     *      org.eclipse.jdt.core.IJavaProject)
-     */
     public boolean canUpdateClasspathContainer(IPath containerPath, 
IJavaProject project) {
         return true;
     }
 
-    /**
-     * @see 
org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath,
-     *      org.eclipse.jdt.core.IJavaProject, 
org.eclipse.jdt.core.IClasspathContainer)
-     */
     public void requestClasspathContainerUpdate(IPath containerPath, final 
IJavaProject project,
             IClasspathContainer containerSuggestion) throws CoreException {
         if (IvyClasspathUtil.isIvyClasspathContainer(containerPath)) {
@@ -111,27 +101,17 @@
                     IvyClasspathContainer ivycp = IvyClasspathUtil
                             .getIvyClasspathContainer(project);
                     if (ivycp != null) {
-                        ivycp.scheduleRefresh(true);
+                        ivycp.launchResolve(false, true, null);
                     }
                 }
             });
         }
     }
 
-    /**
-     * @see 
org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath,
-     *      org.eclipse.jdt.core.IJavaProject)
-     */
     public String getDescription(IPath containerPath, IJavaProject project) {
         return "my description";
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see 
org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath,
-     *      org.eclipse.jdt.core.IJavaProject)
-     */
     public Object getComparisonID(IPath containerPath, IJavaProject project) {
         return project.getProject().getName() + "/" + containerPath;
     }

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
 Wed Aug 13 10:37:20 2008
@@ -92,8 +92,6 @@
 
     private int _workPerArtifact = 100;
 
-    private boolean _notify;
-
     final Ivy ivy;
 
     final IvyClasspathContainerConfiguration conf;
@@ -103,7 +101,7 @@
     final ModuleDescriptor md;
 
     public IvyResolveJob(IvyClasspathContainer container, boolean 
usePreviousResolveIfExist,
-            boolean notify, IvyClasspathContainerConfiguration conf, Ivy ivy, 
ModuleDescriptor md) {
+            IvyClasspathContainerConfiguration conf, Ivy ivy, ModuleDescriptor 
md) {
         super("Resolve "
                 + (conf.getJavaProject() == null ? "" : 
conf.getJavaProject().getProject()
                         .getName()
@@ -112,7 +110,6 @@
         this.ivy = ivy;
         this.md = md;
         _usePreviousResolveIfExist = usePreviousResolveIfExist;
-        _notify = notify;
         this.conf = conf;
     }
 
@@ -341,7 +338,7 @@
                 }
             }
             if (status[0] == Status.OK_STATUS) {
-                container.updateClasspathEntries(_notify, classpathEntries[0]);
+                container.updateClasspathEntries(classpathEntries[0]);
             }
             return status[0];
         } finally {

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java
 Wed Aug 13 10:37:20 2008
@@ -43,7 +43,7 @@
         IvyClasspathContainer cp = 
IvyClasspathUtil.getIvyClasspathContainer(IvyClasspathUtil
                 .getSelectionInJavaPackageView());
         if (cp != null) {
-            cp.scheduleRefresh(true);
+            cp.launchResolve(true, true, null);
         }
     }
 

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java
 Wed Aug 13 10:37:20 2008
@@ -43,7 +43,7 @@
         IvyClasspathContainer cp = 
IvyClasspathUtil.getIvyClasspathContainer(IvyClasspathUtil
                 .getSelectionInJavaPackageView());
         if (cp != null) {
-            cp.scheduleResolve();
+            cp.launchResolve(false, true, null);
         }
     }
 

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java
 Wed Aug 13 10:37:20 2008
@@ -77,7 +77,7 @@
                     }
                     SubProgressMonitor subMonitor = new 
SubProgressMonitor(monitor, 1);
                     IvyClasspathContainer cp = (IvyClasspathContainer) 
iter.next();
-                    cp.resolve(subMonitor);
+                    cp.launchResolve(false, true, subMonitor);
                 }
 
                 return Status.OK_STATUS;

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
 Wed Aug 13 10:37:20 2008
@@ -167,7 +167,7 @@
         IvyClasspathContainer cp = 
IvyClasspathUtil.getIvyClasspathContainer(project);
         if (cp != null
                 && 
cp.getConf().getIvyXmlPath().equals(file.getProjectRelativePath().toString())) {
-            cp.scheduleResolve();
+            cp.launchResolve(false, true, null);
         }
     }
 

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvySettingsEditor.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvySettingsEditor.java?rev=685616&r1=685615&r2=685616&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvySettingsEditor.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvySettingsEditor.java
 Wed Aug 13 10:37:20 2008
@@ -17,7 +17,6 @@
  */
 package org.apache.ivyde.eclipse.ui.editors;
 
-import org.apache.ivyde.common.ivyfile.IvyModuleDescriptorModel;
 import org.apache.ivyde.common.ivysettings.IvySettingsModel;
 import org.apache.ivyde.common.model.IvyModel;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
@@ -126,7 +125,7 @@
         if (cp != null
                 && cp.getConf().getInheritedIvySettingsPath().equals(
                     file.getProjectRelativePath().toString())) {
-            cp.scheduleResolve();
+            cp.launchResolve(false, true, null);
         }
     }
 


Reply via email to