ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r817270 - in /ant/ivy/ivyde/trunk: ./ doc/ org.apache.ivyde.eclipse/ org.apache.ivyde.eclipse/icons/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepex...
Date Mon, 21 Sep 2009 14:39:58 GMT
Author: hibou
Date: Mon Sep 21 14:39:57 2009
New Revision: 817270

URL: http://svn.apache.org/viewvc?rev=817270&view=rev
Log:
IVYDE-195 : add the new view about exploring the dependencies the reversed way (thanks to Jon Schneider)

Added:
    ant/ivy/ivyde/trunk/doc/revdepexplorer.html   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/icons/synced.gif   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java   (with props)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java   (with props)
Modified:
    ant/ivy/ivyde/trunk/CHANGES.txt
    ant/ivy/ivyde/trunk/doc/toc.json
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectAction.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectMenuAction.java

Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Mon Sep 21 14:39:57 2009
@@ -8,6 +8,7 @@
 - NEW: Add option to not launch a resolve after saving a file with the IvyEditor (IVYDE-197) (thanks to Jon Schneider)
 - NEW: File resource listener on Ivy files launches resolve when it detects modifications (IVYDE-199) (thanks to Jon Schneider)
 - NEW: Add an option in the container to automatically laucnh a resolve before each launch (IVYDE-204)
+- NEW: "Reverse Dependency Explorer" View for synchronizing revisions across multiple projects in a workspace (IVYDE-195) (thanks to Jon Schneider)
 
 - FIX: "Ivy Settings Path" Browse button results in an incorrectly formatted URL (IVYDE-191) (thanks to Jon Schneider)
 - FIX: Workspace Resolver Prevents Source Download (IVYDE-188) (thanks to Phillip Webb)

Added: ant/ivy/ivyde/trunk/doc/revdepexplorer.html
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/revdepexplorer.html?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/doc/revdepexplorer.html (added)
+++ ant/ivy/ivyde/trunk/doc/revdepexplorer.html Mon Sep 21 14:39:57 2009
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<html>
+<head>
+	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
+	<script type="text/javascript">var xookiConfig = {level: 0};</script>	
+	<script type="text/javascript" src="xooki/xooki.js"></script>
+</head>
+<body>
+	<textarea id="xooki-source">
+The reverse dependency explorer turns the dependency tree upside-down, exploring the workspace by organization, module, and revision and providing a mechanism to synchronize revisions across projects/classpath containers.</textarea>
+<script type="text/javascript">xooki.postProcess();</script>
+</body>
+</html>

Propchange: ant/ivy/ivyde/trunk/doc/revdepexplorer.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/doc/revdepexplorer.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/doc/revdepexplorer.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: ant/ivy/ivyde/trunk/doc/toc.json
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/toc.json?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/doc/toc.json (original)
+++ ant/ivy/ivyde/trunk/doc/toc.json Mon Sep 21 14:39:57 2009
@@ -123,6 +123,13 @@
                 ]
             },
             {
+              "id":"revdepexplorer",
+              "title":"Reverse Dependency Explorer",
+              "children": [
+
+                ]
+            },
+            {
               "id":"dev",
               "title":"Developer doc",
               "children": [

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/icons/synced.gif
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/icons/synced.gif?rev=817270&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/icons/synced.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml Mon Sep 21 14:39:57 2009
@@ -102,6 +102,7 @@
                id="org.apache.ivyde.eclipse.ui.actions.IvyDEProjectMenuAction"
                label="Ivy"
                menubarPath="additions"
+               style="pulldown"
                tooltip="Ivy Dependency Manager">
          </action>
       </objectContribution> 
@@ -224,6 +225,14 @@
 		   category="org.apache.ivyde.eclipse.ui.views"
 		   class="org.apache.ivyde.eclipse.ui.views.ReportView">
 		</view>
+  <view
+        category="org.apache.ivyde.eclipse.ui.views"
+        class="org.apache.ivyde.eclipse.ui.views.ReverseDependencyExplorerView"
+        icon="icons/logo16x16.gif"
+        id="org.apache.ivyde.eclipse.ui.views.ReverseDependencyExplorer"
+        name="Reverse Dependency Explorer"
+        restorable="true">
+  </view>
 	</extension>
 
    <extension point = "org.eclipse.ui.actionSets">

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java Mon Sep 21 14:39:57 2009
@@ -17,17 +17,24 @@
  */
 package org.apache.ivyde.eclipse.cpcontainer;
 
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivyde.eclipse.FakeProjectManager;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jdt.core.IClasspathAttribute;
 import org.eclipse.jdt.core.IClasspathContainer;
 import org.eclipse.jdt.core.IClasspathEntry;
@@ -278,4 +285,30 @@
         return null;
     }
 
+    public static List/* <IvyClasspathContainer> */getIvyClasspathContainers(IProject project) {
+        IJavaProject javaProject = JavaCore.create(project);
+        if (javaProject.exists()) {
+            return getIvyClasspathContainers(javaProject);
+        }
+        return Arrays.asList(new IvyClasspathContainer[] {});
+    }
+
+    /**
+     * Rewrites the module descriptor back to project's ivy file.
+     * 
+     * @throws IOException
+     * @throws ParseException
+     */
+    public static void toIvyFile(ModuleDescriptor descriptor, IvyClasspathContainer container)
+            throws ParseException, IOException {
+        IvyClasspathContainerConfiguration conf = container.getConf();
+        // TODO the ivy file might not be in the workspace or may be an absolute path
+        // in a such case the Eclipse API will state the file a read only
+        IFile ivyFile = conf.getJavaProject().getProject().getFile(conf.getIvyXmlPath());
+        IStatus writable = ivyFile.getWorkspace().validateEdit(new IFile[] {ivyFile},
+            IWorkspace.VALIDATE_PROMPT);
+        if (writable.isOK()) {
+            descriptor.toIvyFile(container.getState().getIvyFile());
+        }
+    }
 }

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,169 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.revdepexplorer;
+
+import java.util.Map;
+
+import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor;
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ExcludeRule;
+import org.apache.ivy.core.module.descriptor.IncludeRule;
+import org.apache.ivy.core.module.id.ArtifactId;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.plugins.namespace.Namespace;
+
+/**
+ * Delegate dependency descriptor that makes the descriptor mutable. <br>
+ */
+public class EditableDependencyDescriptor implements DependencyDescriptor {
+
+    private DependencyDescriptor descriptor;
+
+    private ModuleRevisionId revisionId;
+
+    public EditableDependencyDescriptor(DependencyDescriptor dd) {
+        descriptor = dd;
+        revisionId = dd.getDependencyRevisionId();
+    }
+
+    public void setRevision(String revision) {
+        revisionId = new ModuleRevisionId(getDependencyId(), revision);
+    }
+
+    public ModuleRevisionId getDynamicConstraintDependencyRevisionId() {
+        return revisionId;
+    }
+
+    public ModuleRevisionId getDependencyRevisionId() {
+        return revisionId;
+    }
+
+    public DependencyDescriptor asSystem() {
+        return descriptor.asSystem();
+    }
+
+    public boolean canExclude() {
+        return descriptor.canExclude();
+    }
+
+    public DependencyDescriptor clone(ModuleRevisionId revision) {
+        return descriptor.clone(revision);
+    }
+
+    public boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId) {
+        return descriptor.doesExclude(moduleConfigurations, artifactId);
+    }
+
+    public DependencyArtifactDescriptor[] getAllDependencyArtifacts() {
+        return descriptor.getAllDependencyArtifacts();
+    }
+
+    public ExcludeRule[] getAllExcludeRules() {
+        return descriptor.getAllExcludeRules();
+    }
+
+    public IncludeRule[] getAllIncludeRules() {
+        return descriptor.getAllIncludeRules();
+    }
+
+    public String getAttribute(String attName) {
+        return descriptor.getAttribute(attName);
+    }
+
+    public Map getAttributes() {
+        return descriptor.getAttributes();
+    }
+
+    public DependencyArtifactDescriptor[] getDependencyArtifacts(String moduleConfigurations) {
+        return descriptor.getDependencyArtifacts(moduleConfigurations);
+    }
+
+    public DependencyArtifactDescriptor[] getDependencyArtifacts(String[] moduleConfigurations) {
+        return descriptor.getDependencyArtifacts(moduleConfigurations);
+    }
+
+    public String[] getDependencyConfigurations(String moduleConfiguration,
+            String requestedConfiguration) {
+        return descriptor.getDependencyConfigurations(moduleConfiguration, requestedConfiguration);
+    }
+
+    public String[] getDependencyConfigurations(String moduleConfiguration) {
+        return descriptor.getDependencyConfigurations(moduleConfiguration);
+    }
+
+    public String[] getDependencyConfigurations(String[] moduleConfigurations) {
+        return descriptor.getDependencyConfigurations(moduleConfigurations);
+    }
+
+    public ModuleId getDependencyId() {
+        return descriptor.getDependencyId();
+    }
+
+    public ExcludeRule[] getExcludeRules(String moduleConfigurations) {
+        return descriptor.getExcludeRules(moduleConfigurations);
+    }
+
+    public ExcludeRule[] getExcludeRules(String[] moduleConfigurations) {
+        return descriptor.getExcludeRules(moduleConfigurations);
+    }
+
+    public String getExtraAttribute(String attName) {
+        return descriptor.getExtraAttribute(attName);
+    }
+
+    public Map getExtraAttributes() {
+        return descriptor.getExtraAttributes();
+    }
+
+    public IncludeRule[] getIncludeRules(String moduleConfigurations) {
+        return descriptor.getIncludeRules(moduleConfigurations);
+    }
+
+    public IncludeRule[] getIncludeRules(String[] moduleConfigurations) {
+        return descriptor.getIncludeRules(moduleConfigurations);
+    }
+
+    public String[] getModuleConfigurations() {
+        return descriptor.getModuleConfigurations();
+    }
+
+    public Namespace getNamespace() {
+        return descriptor.getNamespace();
+    }
+
+    public ModuleRevisionId getParentRevisionId() {
+        return descriptor.getParentRevisionId();
+    }
+
+    public Map getQualifiedExtraAttributes() {
+        return descriptor.getQualifiedExtraAttributes();
+    }
+
+    public boolean isChanging() {
+        return descriptor.isChanging();
+    }
+
+    public boolean isForce() {
+        return descriptor.isForce();
+    }
+
+    public boolean isTransitive() {
+        return descriptor.isTransitive();
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,354 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.revdepexplorer;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.ivy.core.module.descriptor.Artifact;
+import org.apache.ivy.core.module.descriptor.Configuration;
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ExcludeRule;
+import org.apache.ivy.core.module.descriptor.License;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ArtifactId;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.module.id.ModuleRules;
+import org.apache.ivy.plugins.conflict.ConflictManager;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
+import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
+import org.apache.ivy.plugins.repository.Resource;
+import org.apache.ivy.plugins.version.VersionMatcher;
+
+/**
+ * This is a editable implementation of a module descriptor; this was created so a module descriptor
+ * could be modified. This could go away if ivy ever exposes a descriptor where dependencies can be
+ * added/removed. <br>
+ */
+public class EditableModuleDescriptor implements ModuleDescriptor {
+    private ModuleDescriptor descriptor;
+
+    private Set/* <DependencyDescriptor> */dependencies;
+
+    private DependencyDescriptorDelta delta = new DependencyDescriptorDelta();
+
+    private static final Comparator/* <DependencyDescriptor> */DEFAULT_DEPENDENCY_COMPARATOR = new Comparator() {
+        public int compare(Object o1, Object o2) {
+            int result = 0;
+
+            DependencyDescriptor desc1 = (DependencyDescriptor) o1;
+            DependencyDescriptor desc2 = (DependencyDescriptor) o2;
+
+            result = desc1.getDependencyId().getOrganisation().compareTo(
+                desc2.getDependencyId().getOrganisation());
+
+            if (result == 0) {
+                result = desc1.getDependencyId().getName().compareTo(
+                    desc2.getDependencyId().getName());
+            }
+
+            return result;
+        }
+    };
+
+    public EditableModuleDescriptor(ModuleDescriptor descriptor) {
+        this.descriptor = descriptor;
+        dependencies = new TreeSet/* <DependencyDescriptor> */(DEFAULT_DEPENDENCY_COMPARATOR);
+        dependencies.addAll(Arrays.asList(descriptor.getDependencies()));
+    }
+
+    public void removeDependency(DependencyDescriptor remove) {
+        DependencyDescriptor ddToRemove;
+        if ((ddToRemove = findDependencyDescriptor(dependencies, remove)) != null) {
+            delta.remove(ddToRemove);
+            dependencies.remove(ddToRemove);
+        }
+    }
+
+    public void addDependency(DependencyDescriptor add) {
+        add.getDependencyConfigurations(add.getModuleConfigurations());
+
+        if (findDependencyDescriptor(dependencies, add) == null) {
+            delta.add(add);
+            dependencies.add(add);
+        }
+    }
+
+    public void removeDependencies(DependencyDescriptor[] removes) {
+        for (int i = 0; i < removes.length; i++) {
+            removeDependency(removes[i]);
+        }
+    }
+
+    public void removeDependencies(Collection/* <DependencyDescriptor> */removes) {
+        removeDependencies((DependencyDescriptor[]) removes
+                .toArray(new DependencyDescriptor[removes.size()]));
+    }
+
+    public void addDependencies(DependencyDescriptor[] additions) {
+        for (int i = 0; i < additions.length; i++)
+            addDependency(additions[i]);
+    }
+
+    public void addDependencies(Collection/* <DependencyDescriptor> */additions) {
+        addDependencies((DependencyDescriptor[]) additions
+                .toArray(new DependencyDescriptor[additions.size()]));
+    }
+
+    public DependencyDescriptor[] getDependencies() {
+        return (DependencyDescriptor[]) dependencies.toArray(new DependencyDescriptor[dependencies
+                .size()]);
+    }
+
+    public boolean isEdited() {
+        return !delta.isEmpty();
+    }
+
+    public boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md) {
+        for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
+            DependencyDescriptor dd = (DependencyDescriptor) iter.next();
+            if (dd.getDependencyId().equals(md.getModuleRevisionId().getModuleId())) {
+                if (md.getResolvedModuleRevisionId().getRevision() == null) {
+                    return true;
+                }
+                if (matcher.accept(dd.getDependencyRevisionId(), md)) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Careful - This method bypasses the module descriptor Parser and Resource and delegates
+     * directly to XmlModuleDescriptorWriter.
+     * 
+     * @see org.apache.ivy.core.module.descriptor.ModuleDescriptor#toIvyFile(java.io.File)
+     */
+    public void toIvyFile(File destFile) throws ParseException, IOException {
+        XmlModuleDescriptorWriter.write(this, destFile);
+    }
+
+    private DependencyDescriptor findDependencyDescriptor(
+            Collection/* <DependencyDescriptor> */findIn, DependencyDescriptor find) {
+        Iterator iter = findIn.iterator();
+        while (iter.hasNext()) {
+            DependencyDescriptor dependency = (DependencyDescriptor) iter.next();
+            if (dependency.getDependencyRevisionId().equals(find.getDependencyRevisionId())) {
+                return dependency;
+            }
+        }
+
+        return null;
+    }
+
+    // Delegate all of the interface methods ---------------------------------
+
+    public Artifact[] getAllArtifacts() {
+        return descriptor.getAllArtifacts();
+    }
+
+    public Artifact[] getArtifacts(String s) {
+        return descriptor.getArtifacts(s);
+    }
+
+    public String getAttribute(String s) {
+        return descriptor.getAttribute(s);
+    }
+
+    public Map getAttributes() {
+        return descriptor.getAttributes();
+    }
+
+    public Configuration getConfiguration(String s) {
+        return descriptor.getConfiguration(s);
+    }
+
+    public Configuration[] getConfigurations() {
+        return descriptor.getConfigurations();
+    }
+
+    public String[] getConfigurationsNames() {
+        return descriptor.getConfigurationsNames();
+    }
+
+    public ConflictManager getConflictManager(ModuleId moduleid) {
+        return descriptor.getConflictManager(moduleid);
+    }
+
+    public String getExtraAttribute(String s) {
+        return descriptor.getExtraAttribute(s);
+    }
+
+    public Map getExtraAttributes() {
+        return descriptor.getExtraAttributes();
+    }
+
+    public String getHomePage() {
+        return descriptor.getHomePage();
+    }
+
+    public long getLastModified() {
+        return descriptor.getLastModified();
+    }
+
+    public License[] getLicenses() {
+        return descriptor.getLicenses();
+    }
+
+    public ModuleRevisionId getModuleRevisionId() {
+        return descriptor.getModuleRevisionId();
+    }
+
+    public ModuleDescriptorParser getParser() {
+        return descriptor.getParser();
+    }
+
+    public Date getPublicationDate() {
+        return descriptor.getPublicationDate();
+    }
+
+    public String[] getPublicConfigurationsNames() {
+        return descriptor.getPublicConfigurationsNames();
+    }
+
+    public ModuleRevisionId getResolvedModuleRevisionId() {
+        return ModuleRevisionId.newInstance(descriptor.getResolvedModuleRevisionId()
+                .getOrganisation(), descriptor.getResolvedModuleRevisionId().getName(), "revision");
+    }
+
+    public Date getResolvedPublicationDate() {
+        return descriptor.getResolvedPublicationDate();
+    }
+
+    public Resource getResource() {
+        return descriptor.getResource();
+    }
+
+    public String getStatus() {
+        return descriptor.getStatus();
+    }
+
+    public boolean isDefault() {
+        return descriptor.isDefault();
+    }
+
+    public boolean canExclude() {
+        return descriptor.canExclude();
+    }
+
+    public boolean doesExclude(String[] as, ArtifactId artifactid) {
+        return descriptor.doesExclude(as, artifactid);
+    }
+
+    public ExcludeRule[] getAllExcludeRules() {
+        return descriptor.getAllExcludeRules();
+    }
+
+    public void setResolvedModuleRevisionId(ModuleRevisionId modulerevisionid) {
+        descriptor.setResolvedModuleRevisionId(modulerevisionid);
+    }
+
+    public void setResolvedPublicationDate(Date date) {
+        descriptor.setResolvedPublicationDate(date);
+    }
+
+    protected class DependencyDescriptorDelta {
+        private Set/* <DependencyDescriptor> */added = new HashSet();
+
+        private Set/* <DependencyDescriptor> */deleted = new HashSet();
+
+        public void add(DependencyDescriptor dependency) {
+            DependencyDescriptor ddToRemove;
+            if ((ddToRemove = findDependencyDescriptor(deleted, dependency)) != null) {
+                deleted.remove(ddToRemove);
+            } else {
+                added.add(dependency);
+            }
+        }
+
+        public void remove(DependencyDescriptor dependency) {
+            DependencyDescriptor ddToRemove;
+            if ((ddToRemove = findDependencyDescriptor(added, dependency)) != null) {
+                added.remove(ddToRemove);
+            } else {
+                deleted.add(dependency);
+            }
+        }
+
+        public void clear() {
+            added = new HashSet/* <DependencyDescriptor> */();
+            deleted = new HashSet/* <DependencyDescriptor> */();
+        }
+
+        public boolean isEmpty() {
+            return added.size() == 0 && deleted.size() == 0;
+        }
+
+        public Collection/* <DependencyDescriptor> */getDeletedDeltas() {
+            return deleted;
+        }
+
+        public Collection/* <DependencyDescriptor> */getAddedDeltas() {
+            return added;
+        }
+    }
+
+    public Map getExtraAttributesNamespaces() {
+        return descriptor.getExtraAttributesNamespaces();
+    }
+
+    public Map getExtraInfo() {
+        return descriptor.getExtraInfo();
+    }
+
+    public Artifact getMetadataArtifact() {
+        return descriptor.getMetadataArtifact();
+    }
+
+    public Map getQualifiedExtraAttributes() {
+        return descriptor.getQualifiedExtraAttributes();
+    }
+
+    public String getRevision() {
+        return descriptor.getRevision();
+    }
+
+    public ModuleRules getAllDependencyDescriptorMediators() {
+        return descriptor.getAllDependencyDescriptorMediators();
+    }
+    public String getDescription() {
+        return descriptor.getDescription();
+    }
+
+    public DependencyDescriptor mediate(DependencyDescriptor arg0) {
+        return descriptor.mediate(arg0);
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/EditableModuleDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,129 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.revdepexplorer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivyde.eclipse.IvyDEException;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+
+public class IvyUtil {
+
+    /**
+     * This will return all ivy projects in the workspace <br>
+     * 
+     * @return collection of ivy projects
+     */
+    public static IProject[] getIvyProjectsInWorkspace() {
+        Collection/* <IProject> */ivyProjects = new HashSet();
+
+        IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+
+        for (int i = 0; i < projects.length; i++) {
+            if (projects[i].isOpen()
+                    && IvyClasspathUtil.getIvyClasspathContainers(projects[i]).size() > 0) {
+                ivyProjects.add(projects[i]);
+            }
+        }
+
+        return (IProject[]) ivyProjects.toArray(new IProject[ivyProjects.size()]);
+    }
+
+    public static MultiRevisionDependencyDescriptor[] getDependencyDescriptorsByProjects(
+            IProject[] projects) {
+        // a temporary cache of multi-revision dependency descriptors
+        Map/* <ModuleId, MultiRevisionDependencyDescriptor> */moduleDescriptorMap = new HashMap();
+
+        for (int i = 0; i < projects.length; i++) {
+            List containers = IvyClasspathUtil.getIvyClasspathContainers(projects[i]);
+            Iterator containerIter = containers.iterator();
+
+            while (containerIter.hasNext()) {
+                IvyClasspathContainer container = (IvyClasspathContainer) containerIter.next();
+                try {
+                    DependencyDescriptor[] descriptors = container.getState().getModuleDescriptor()
+                            .getDependencies();
+                    for (int j = 0; j < descriptors.length; j++) {
+                        DependencyDescriptor descriptor = descriptors[j];
+                        MultiRevisionDependencyDescriptor syncableDependencyDescriptor = (MultiRevisionDependencyDescriptor) moduleDescriptorMap
+                                .get(descriptor.getDependencyId());
+
+                        if (syncableDependencyDescriptor == null) {
+                            syncableDependencyDescriptor = new MultiRevisionDependencyDescriptor(
+                                    descriptor.getDependencyId());
+
+                            moduleDescriptorMap.put(descriptor.getDependencyId(),
+                                syncableDependencyDescriptor);
+                        }
+
+                        syncableDependencyDescriptor.addDependencyDescriptor(container, descriptor);
+                    }
+                } catch (IvyDEException e) {
+                    e.show(IStatus.ERROR, "Inconsistent Ivy Classpath Container",
+                        "Unable to find a module descriptor associated with"
+                                + container.getState().getIvyFile().getPath());
+                    continue;
+                }
+            }
+        }
+
+        List/* <MultiRevisionDependencyDescriptor> */sorted = new ArrayList(moduleDescriptorMap
+                .values());
+
+        Collections.sort(sorted, new Comparator/* <MultiRevisionDependencyDescriptor> */() {
+            public int compare(Object o1, Object o2) {
+                MultiRevisionDependencyDescriptor desc1 = (MultiRevisionDependencyDescriptor) o1;
+                MultiRevisionDependencyDescriptor desc2 = (MultiRevisionDependencyDescriptor) o2;
+
+                int equal = desc1.getOrganization().compareTo(desc2.getOrganization());
+                if (equal == 0) {
+                    equal = desc1.getModule().compareTo(desc2.getModule());
+                }
+
+                return equal;
+
+            }
+        });
+
+        return (MultiRevisionDependencyDescriptor[]) sorted
+                .toArray(new MultiRevisionDependencyDescriptor[sorted.size()]);
+    }
+
+    /**
+     * This returns a list of multi-revision dependency descriptors which is a grouping of the
+     * revisions under and organization and module <br>
+     * 
+     * @return multi-revision dependency descriptors
+     */
+    public static MultiRevisionDependencyDescriptor[] getAllDependencyDescriptorsInWorkspace() {
+        return getDependencyDescriptorsByProjects(getIvyProjectsInWorkspace());
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/IvyUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,205 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.revdepexplorer;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+
+public class MultiRevisionDependencyDescriptor {
+    private final ModuleId moduleId;
+
+    private final Map/* <IvyClasspathContainer, Collection<DependencyDescriptor>> */dependenciesByContainer = new HashMap();
+
+    private String newRevision;
+
+    public MultiRevisionDependencyDescriptor(ModuleId moduleId) {
+        this.moduleId = moduleId;
+    }
+
+    public int hashCode() {
+        return getOrganization().hashCode() + getModule().hashCode()
+                + dependenciesByContainer.hashCode();
+    }
+
+    public boolean equals(Object o) {
+        if (o instanceof MultiRevisionDependencyDescriptor) {
+            MultiRevisionDependencyDescriptor dependencyDescriptor = (MultiRevisionDependencyDescriptor) o;
+
+            if (getOrganization().equals(dependencyDescriptor.getOrganization())
+                    && getModule().equals(dependencyDescriptor.getModule())
+                    && dependenciesByContainer.equals(dependencyDescriptor.dependenciesByContainer)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public boolean hasMultipleRevisons() {
+        return getRevisions().length > 1;
+    }
+
+    /**
+     * @param project
+     *            revision
+     * @param dependencyDescriptor
+     *            current descriptor
+     */
+    public void addDependencyDescriptor(IvyClasspathContainer container,
+            DependencyDescriptor dependencyDescriptor) {
+        Collection/* <DependencyDescriptor> */dependencies = (Collection) dependenciesByContainer
+                .get(container);
+
+        if (dependencies == null) {
+            dependencies = new HashSet/* <DependencyDescriptor> */();
+            dependenciesByContainer.put(container, dependencies);
+        }
+
+        dependencies.add(dependencyDescriptor);
+    }
+
+    /**
+     * @return module name
+     */
+    public String getModule() {
+        return moduleId.getName();
+    }
+
+    /**
+     * @return organization name
+     */
+    public String getOrganization() {
+        return moduleId.getOrganisation();
+    }
+
+    /**
+     * @return all revisions
+     */
+    public String[] getRevisions() {
+        Set/* <String> */revisions = new HashSet/* <String> */();
+
+        Collection/* <Collection<DependencyDescriptor>> */projectDependencyDescriptors = dependenciesByContainer
+                .values();
+
+        Iterator projectCollectionIter = projectDependencyDescriptors.iterator();
+        while (projectCollectionIter.hasNext()) {
+            Collection/* <DependencyDescriptor> */projectCollection = (Collection) projectCollectionIter
+                    .next();
+            Iterator descriptorIter = projectCollection.iterator();
+            while (descriptorIter.hasNext()) {
+                DependencyDescriptor descriptor = (DependencyDescriptor) descriptorIter.next();
+                revisions.add(descriptor.getDependencyRevisionId().getRevision());
+            }
+        }
+
+        return (String[]) revisions.toArray(new String[revisions.size()]);
+    }
+
+    /**
+     * @return true if a new revision has been applied
+     */
+    public boolean hasNewRevision() {
+        if (newRevision == null || "".equals(newRevision.trim())) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * @param newRevision
+     *            new revision
+     */
+    public void setNewRevision(String newRevision) {
+        this.newRevision = newRevision;
+    }
+
+    /**
+     * @return new revision
+     */
+    public String getNewRevision() {
+        return newRevision;
+    }
+
+    /**
+     * @return all projects
+     */
+    public IvyClasspathContainer[] getIvyClasspathContainers() {
+        Collection containers = dependenciesByContainer.keySet();
+        return (IvyClasspathContainer[]) containers.toArray(new IvyClasspathContainer[containers
+                .size()]);
+    }
+
+    /**
+     * @param project
+     *            project
+     * @return true if there is a project match
+     */
+    public boolean isForContainer(IvyClasspathContainer container) {
+        IvyClasspathContainer[] containers = getIvyClasspathContainers();
+        for (int i = 0; i < containers.length; i++) {
+            IvyClasspathContainer currentContainer = containers[i];
+            if (currentContainer.equals(container)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @return
+     */
+    public ModuleId getModuleId() {
+        return moduleId;
+    }
+
+    /**
+     * This returns the current revisions for a project <br>
+     * 
+     * @param project
+     *            project
+     * @return revision
+     */
+    public String[] getRevisions(IvyClasspathContainer container) {
+        Collection/* <DependencyDescriptor> */containerDependencyDescriptors = (Collection) dependenciesByContainer
+                .get(container);
+
+        if (containerDependencyDescriptors == null) {
+            return new String[0];
+        }
+
+        Set/* <String> */revisions = new HashSet/* <String> */();
+
+        Iterator iter = containerDependencyDescriptors.iterator();
+        while (iter.hasNext()) {
+            DependencyDescriptor descriptor = (DependencyDescriptor) iter.next();
+            revisions.add(descriptor.getDependencyRevisionId().getRevision());
+        }
+
+        return (String[]) revisions.toArray(new String[revisions.size()]);
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/MultiRevisionDependencyDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,158 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.revdepexplorer;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivyde.eclipse.IvyDEException;
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * This job synchronizes all ivy files in a workspace according to the new revisions specified in
+ * the ivy explorer.
+ */
+public class SyncIvyFilesJob extends WorkspaceJob {
+
+    private MultiRevisionDependencyDescriptor[] multiRevisionDependencies;
+
+    public SyncIvyFilesJob(MultiRevisionDependencyDescriptor[] multiRevisionDependencies) {
+        super("Synchronizing Ivy Files");
+        this.multiRevisionDependencies = multiRevisionDependencies;
+    }
+
+    protected IStatus executeJob(IProgressMonitor monitor) {
+        MultiStatus errorStatuses = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
+                "Failed to update one or more Ivy files.  See details.", null);
+
+        IvyClasspathContainer[] containers = getIvyClasspathContainers();
+        for (int i = 0; i < containers.length; i++) {
+            IvyClasspathContainer container = containers[i];
+
+            EditableModuleDescriptor moduleDescriptor;
+            try {
+                moduleDescriptor = new EditableModuleDescriptor(container.getState()
+                        .getModuleDescriptor());
+            } catch (IvyDEException e) {
+                errorStatuses
+                        .add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
+                                "Failed to get module descriptor at "
+                                        + container.getConf().getIvyXmlPath(), e));
+                continue;
+            }
+            Collection/* <MultiRevisionDependencyDescriptor> */newRevisions = getNewRevisions(container);
+
+            Iterator multiRevisionIter = newRevisions.iterator();
+            while (multiRevisionIter.hasNext()) {
+                MultiRevisionDependencyDescriptor newRevision = (MultiRevisionDependencyDescriptor) multiRevisionIter
+                        .next();
+
+                DependencyDescriptor dependencyDescriptors[] = moduleDescriptor.getDependencies();
+                for (int j = 0; j < dependencyDescriptors.length; j++) {
+                    DependencyDescriptor dependencyDescriptor = dependencyDescriptors[j];
+                    if (newRevision.getModuleId().equals(dependencyDescriptor.getDependencyId())) {
+                        EditableDependencyDescriptor editableDependencyDescriptor = new EditableDependencyDescriptor(
+                                dependencyDescriptor);
+                        editableDependencyDescriptor.setRevision(newRevision.getNewRevision());
+                        moduleDescriptor.removeDependency(dependencyDescriptor);
+                        moduleDescriptor.addDependency(editableDependencyDescriptor);
+                    }
+                }
+            }
+
+            try {
+                IvyClasspathUtil.toIvyFile(moduleDescriptor, container);
+            } catch (ParseException e) {
+                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
+                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
+                        e));
+            } catch (IOException e) {
+                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
+                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
+                        e));
+            }
+        }
+
+        if (errorStatuses.getChildren().length > 0) {
+            return errorStatuses;
+        }
+        return Status.OK_STATUS;
+    }
+
+    public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+        IStatus status = Status.OK_STATUS;
+
+        try {
+            status = executeJob(monitor);
+        } catch (OperationCanceledException ignore) {
+            return Status.CANCEL_STATUS;
+        }
+
+        return status;
+    }
+
+    private IvyClasspathContainer[] getIvyClasspathContainers() {
+        Collection/* <IvyClasspathContainer> */containers = new HashSet();
+
+        for (int i = 0; i < multiRevisionDependencies.length; i++) {
+            MultiRevisionDependencyDescriptor multiRevision = multiRevisionDependencies[i];
+            if (multiRevision.hasNewRevision()) {
+                containers.addAll(Arrays.asList(multiRevision.getIvyClasspathContainers()));
+            }
+        }
+
+        return (IvyClasspathContainer[]) containers.toArray(new IvyClasspathContainer[containers
+                .size()]);
+    }
+
+    /**
+     * Return the new revision changes for a given project <br>
+     * 
+     * @param project
+     *            project
+     * @return multiRevision descriptors
+     */
+    private Collection/* <MultiRevisionDependencyDescriptor> */getNewRevisions(
+            IvyClasspathContainer container) {
+        Collection/* <MultiRevisionDependencyDescriptor> */list = new ArrayList();
+
+        for (int i = 0; i < multiRevisionDependencies.length; i++) {
+            MultiRevisionDependencyDescriptor multiRevision = multiRevisionDependencies[i];
+            if (multiRevision.hasNewRevision() && multiRevision.isForContainer(container)) {
+                list.add(multiRevision);
+            }
+        }
+
+        return list;
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/revdepexplorer/SyncIvyFilesJob.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectAction.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectAction.java?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectAction.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectAction.java Mon Sep 21 14:39:57 2009
@@ -26,21 +26,25 @@
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
 
 /**
  * Abstract class for helping with project delegation of actions <br>
  */
-public abstract class IvyDEProjectAction implements IActionDelegate {
+public abstract class IvyDEProjectAction implements IObjectActionDelegate {
     protected abstract void selectionChanged(IAction action, IProject[] projects);
-    
-    /**
-     * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
-     *      org.eclipse.jface.viewers.ISelection)
-     */
+
+    protected IWorkbenchPage page;
+
+    public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+        this.page = targetPart.getSite().getPage();
+    }
+
     public final void selectionChanged(IAction action, ISelection selection) {
         if (selection instanceof IStructuredSelection) {
-            Collection/*<IProject>*/ projects = new ArrayList/*<IProject>*/();
+            Collection/* <IProject> */projects = new ArrayList/* <IProject> */();
 
             for (Iterator it = ((IStructuredSelection) selection).iterator(); it.hasNext();) {
                 Object element = it.next();
@@ -52,18 +56,23 @@
                 }
 
                 if (project != null) {
-                    // TODO validate a project's "Ivy nature" here (has an ivy.xml or an ivy classpath container)
+                    // TODO validate a project's "Ivy nature" here (has an ivy.xml or an ivy
+                    // classpath container)
                     projects.add(project);
                 }
             }
-            
-            if(projects.size() > 0) {
+
+            if (projects.size() > 0) {
                 action.setEnabled(true);
-                selectionChanged(action, (IProject[]) projects.toArray(new IProject[projects.size()]));
-            }
-            else {
+                selectionChanged(action, (IProject[]) projects
+                        .toArray(new IProject[projects.size()]));
+            } else {
                 action.setEnabled(false);
             }
         }
     }
+
+    protected IWorkbenchPage getPage() {
+        return page;
+    }
 }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectMenuAction.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectMenuAction.java?rev=817270&r1=817269&r2=817270&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectMenuAction.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/IvyDEProjectMenuAction.java Mon Sep 21 14:39:57 2009
@@ -21,6 +21,7 @@
 import org.eclipse.jface.action.ActionContributionItem;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.Separator;
 import org.eclipse.swt.events.MenuAdapter;
 import org.eclipse.swt.events.MenuEvent;
 import org.eclipse.swt.events.MenuListener;
@@ -30,7 +31,9 @@
 
 public class IvyDEProjectMenuAction extends IvyDEProjectAction implements IMenuCreator {
     private boolean selectionChanged;
+
     private IAction proxyAction;
+
     private IProject[] projects;
 
     private MenuListener menuListener = new MenuAdapter() {
@@ -49,7 +52,12 @@
 
     protected void fill(Menu menu, IProject[] projects) {
         ProjectResolveAction resolveAction = new ProjectResolveAction(projects);
+        ProjectViewReverseDependenciesAction viewReverseAction = new ProjectViewReverseDependenciesAction(
+                projects, getPage());
+
         new ActionContributionItem(resolveAction).fill(menu, -1);
+        new Separator().fill(menu, -1);
+        new ActionContributionItem(viewReverseAction).fill(menu, -1);
     }
 
     public Menu getMenu(Control parent) {
@@ -74,10 +82,10 @@
             proxyAction.setMenuCreator(this);
         }
     }
-    
+
     public void run(IAction action) {
         // nothing to run
-    }    
+    }
 
     public void dispose() {
         // nothing to dispose

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.ui.actions;
+
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.ui.views.ReverseDependencyExplorerView;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+public class ProjectViewReverseDependenciesAction extends Action {
+
+    private IProject[] projects;
+
+    private IWorkbenchPage page;
+
+    public ProjectViewReverseDependenciesAction(IProject[] projects, IWorkbenchPage workbenchPage) {
+        this.projects = projects;
+        this.page = workbenchPage;
+        this.setText("Show in Reverse Dependency Explorer");
+    }
+
+    public void run() {
+        try {
+            ReverseDependencyExplorerView.setSelectedProjects(projects);
+            page.showView("org.apache.ivyde.eclipse.ui.views.ReverseDependencyExplorer");
+            ReverseDependencyExplorerView.refresh(true);
+        } catch (PartInitException e) {
+            IvyPlugin.log(IStatus.ERROR, "Error creating Reverse Dependency Explorer", e);
+        }
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ProjectViewReverseDependenciesAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java?rev=817270&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java Mon Sep 21 14:39:57 2009
@@ -0,0 +1,407 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.ui.views;
+
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.revdepexplorer.IvyUtil;
+import org.apache.ivyde.eclipse.revdepexplorer.MultiRevisionDependencyDescriptor;
+import org.apache.ivyde.eclipse.revdepexplorer.SyncIvyFilesJob;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * This is a view to manage synchronizing ivy files in a workspace
+ */
+public class ReverseDependencyExplorerView extends ViewPart {
+    private static TreeViewer viewer;
+
+    private static MultiRevisionDependencyDescriptor[] dependencies;
+
+    private static Display display;
+
+    private static IProject[] selectedProjects;
+
+    private static final String NEW_REVISION = "New Revision";
+
+    private static final String[] PROPS = new String[] {"Organization", "Module", "Revision",
+            NEW_REVISION};
+
+    /**
+     * This is a callback that will allow us to create the viewer and initialize it.
+     */
+    public void createPartControl(Composite parent) {
+        display = parent.getDisplay();
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout(1, false));
+
+        ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+
+        Action syncAction = new Action() {
+            public void run() {
+                if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),
+                    "Fix dependencies",
+                    "Alter dependencies?\n\nAnything marked in green will be synchronized.")) {
+                    Job job = new SyncIvyFilesJob(dependencies);
+                    job.addJobChangeListener(new JobChangeAdapter() {
+                        public void done(IJobChangeEvent arg0) {
+                            refresh(true);
+                        }
+                    });
+                    job.schedule();
+                }
+            }
+        };
+        syncAction.setToolTipText("Synchronize ivy dependencies");
+        syncAction.setImageDescriptor(IvyPlugin.getImageDescriptor("icons/synced.gif"));
+
+        Action refreshAction = new Action() {
+            public void run() {
+                refresh(true);
+            }
+        };
+        refreshAction.setToolTipText("Refresh");
+        refreshAction.setImageDescriptor(IvyPlugin.getImageDescriptor("icons/refresh.gif"));
+
+        Action refreshAllAction = new Action() {
+            public void run() {
+                ReverseDependencyExplorerView.setSelectedProjects(null);
+                refresh(true);
+            }
+        };
+        refreshAllAction.setToolTipText("Show all projects in workspace");
+        refreshAllAction.setImageDescriptor(sharedImages
+                .getImageDescriptor(ISharedImages.IMG_TOOL_UP));
+
+        IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
+        toolbar.add(syncAction);
+        toolbar.add(refreshAction);
+        toolbar.add(refreshAllAction);
+
+        newTreeViewer(composite);
+        refresh(true);
+    }
+
+    private void newTreeViewer(Composite composite) {
+        viewer = new TreeViewer(composite, SWT.FULL_SELECTION);
+        IvyRevisionProvider ivyRevisionProvider = new IvyRevisionProvider();
+
+        viewer.setContentProvider(ivyRevisionProvider);
+        viewer.setLabelProvider(ivyRevisionProvider);
+        viewer.setColumnProperties(PROPS);
+
+        Tree tree = viewer.getTree();
+        tree.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+        TableLayout layout = new TableLayout();
+        layout.addColumnData(new ColumnWeightData(50, 75, true));
+        layout.addColumnData(new ColumnWeightData(50, 75, true));
+        layout.addColumnData(new ColumnWeightData(25, 75, true));
+        layout.addColumnData(new ColumnWeightData(50, 75, true));
+        tree.setLayout(layout);
+
+        new TreeColumn(tree, SWT.LEFT).setText("Organization");
+        new TreeColumn(tree, SWT.LEFT).setText("Module");
+        new TreeColumn(tree, SWT.LEFT).setText("Revision");
+        new TreeColumn(tree, SWT.LEFT).setText("New Revision");
+
+        for (int i = 0, n = tree.getColumnCount(); i < n; i++) {
+            tree.getColumn(i).pack();
+        }
+
+        tree.setHeaderVisible(true);
+        tree.setLinesVisible(false);
+
+        CellEditor[] editors = new CellEditor[PROPS.length];
+        editors[0] = new TextCellEditor(tree);
+        editors[1] = new TextCellEditor(tree);
+        editors[2] = new TextCellEditor(tree);
+        editors[3] = new TextCellEditor(tree);
+
+        viewer.setCellModifier(new CellModifier());
+        viewer.setCellEditors(editors);
+    }
+
+    public static void refresh(final boolean reloadData) {
+        display.syncExec(new Runnable() {
+            public void run() {
+                if (reloadData) {
+                    if (selectedProjects == null) {
+                        dependencies = IvyUtil.getAllDependencyDescriptorsInWorkspace();
+                    } else {
+                        dependencies = IvyUtil.getDependencyDescriptorsByProjects(selectedProjects);
+                    }
+                    viewer.setInput(dependencies);
+                }
+
+                viewer.refresh();
+
+                TreeItem[] items = viewer.getTree().getItems();
+
+                for (int i = 0; i < items.length; i++) {
+                    TreeItem item = items[i];
+                    MultiRevisionDependencyDescriptor multiRevisionDescriptor = (MultiRevisionDependencyDescriptor) item
+                            .getData();
+
+                    if (multiRevisionDescriptor.hasMultipleRevisons()
+                            && !multiRevisionDescriptor.hasNewRevision()) {
+                        item.setForeground(display.getSystemColor(SWT.COLOR_RED));
+                    } else if (multiRevisionDescriptor.hasNewRevision()) {
+                        item.setForeground(new Color(Display.getDefault(), new RGB(50, 150, 50)));
+                    } else {
+                        item.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
+                    }
+                }
+            }
+        });
+    }
+
+    /**
+     * Passing the focus request to the viewer's control.
+     */
+    public void setFocus() {
+        viewer.getControl().setFocus();
+    }
+
+    class IvyRevisionProvider extends LabelProvider implements ITableLabelProvider,
+            ITreeContentProvider {
+
+        public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+            // nothing to do
+        }
+
+        public Object[] getElements(Object parent) {
+            return dependencies;
+        }
+
+        public String getColumnText(Object obj, int index) {
+            if (obj instanceof MultiRevisionDependencyDescriptor) {
+                MultiRevisionDependencyDescriptor dependencyDescriptor = (MultiRevisionDependencyDescriptor) obj;
+
+                switch (index) {
+                    case 0:
+                        return dependencyDescriptor.getOrganization();
+                    case 1:
+                        return dependencyDescriptor.getModule();
+                    case 2:
+                        return toRevisionList(dependencyDescriptor.getRevisions());
+                    case 3:
+                        return dependencyDescriptor.getNewRevision();
+                    default:
+                        break;
+                }
+            } else if (obj instanceof ClasspathContainerDependencyDescriptorComposite) {
+                ClasspathContainerDependencyDescriptorComposite containerDescriptorComposite = (ClasspathContainerDependencyDescriptorComposite) obj;
+                switch (index) {
+                    case 0:
+                        return containerDescriptorComposite.getIvyClasspathContainer()
+                                .getDescription()
+                                + " in \""
+                                + containerDescriptorComposite.getIvyClasspathContainer().getConf()
+                                        .getJavaProject().getProject().getName() + "\"";
+                    case 2:
+                        return toRevisionList(containerDescriptorComposite.getRevisions());
+                    default:
+                        break;
+                }
+
+                return null;
+            }
+
+            return null;
+        }
+
+        private String toRevisionList(String[] revisions) {
+            StringBuffer buffer = new StringBuffer();
+
+            for (int i = 0; i < revisions.length; i++) {
+                buffer.append(revisions[i]);
+
+                if (i + 1 < revisions.length) {
+                    buffer.append(", ");
+                }
+            }
+
+            return buffer.toString();
+        }
+
+        public Image getColumnImage(Object obj, int index) {
+            if (index == 0) {
+                return getImage(obj);
+            }
+
+            return null;
+        }
+
+        public Image getImage(Object obj) {
+            ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+            if (obj instanceof MultiRevisionDependencyDescriptor) {
+                MultiRevisionDependencyDescriptor multiRevisionDescriptor = (MultiRevisionDependencyDescriptor) obj;
+
+                if (multiRevisionDescriptor.hasMultipleRevisons()
+                        && !multiRevisionDescriptor.hasNewRevision()) {
+                    return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+                } else {
+                    return IvyPlugin.getImageDescriptor("icons/synced.gif").createImage();
+                }
+            } else if (obj instanceof ClasspathContainerDependencyDescriptorComposite) {
+                return JavaUI.getSharedImages().getImage(
+                    org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_LIBRARY);
+            }
+
+            return null;
+        }
+
+        public Object[] getChildren(Object parent) {
+            if (parent instanceof MultiRevisionDependencyDescriptor) {
+                MultiRevisionDependencyDescriptor multiRevisionDescriptor = (MultiRevisionDependencyDescriptor) parent;
+                IvyClasspathContainer[] containers = multiRevisionDescriptor
+                        .getIvyClasspathContainers();
+
+                Object[] wrappedProjects = new Object[containers.length];
+                for (int i = 0; i < containers.length; i++) {
+                    wrappedProjects[i] = new ClasspathContainerDependencyDescriptorComposite(
+                            containers[i], multiRevisionDescriptor);
+                }
+
+                return wrappedProjects;
+            }
+
+            return new Object[0];
+        }
+
+        public Object getParent(Object parent) {
+            return null;
+        }
+
+        public boolean hasChildren(Object parent) {
+            if (parent instanceof MultiRevisionDependencyDescriptor) {
+                MultiRevisionDependencyDescriptor multiRevisionDescriptor = (MultiRevisionDependencyDescriptor) parent;
+
+                if (multiRevisionDescriptor.getIvyClasspathContainers().length > 0) {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+    }
+
+    class ClasspathContainerDependencyDescriptorComposite {
+        private IvyClasspathContainer container;
+
+        private MultiRevisionDependencyDescriptor multiRevisionDescriptor;
+
+        public ClasspathContainerDependencyDescriptorComposite(IvyClasspathContainer container,
+                MultiRevisionDependencyDescriptor multiRevisionDescriptor) {
+            this.container = container;
+            this.multiRevisionDescriptor = multiRevisionDescriptor;
+        }
+
+        /**
+         * @return revisions for a container
+         */
+        public String[] getRevisions() {
+            return multiRevisionDescriptor.getRevisions(container);
+        }
+
+        public IvyClasspathContainer getIvyClasspathContainer() {
+            return container;
+        }
+
+        public MultiRevisionDependencyDescriptor getMultiRevisionDescriptor() {
+            return multiRevisionDescriptor;
+        }
+    }
+
+    class CellModifier implements ICellModifier {
+
+        public boolean canModify(Object element, String property) {
+            if (property.equals(NEW_REVISION)) {
+                return true;
+            }
+            return false;
+        }
+
+        public Object getValue(Object element, String property) {
+            if (property.equals(NEW_REVISION)) {
+                if (element instanceof MultiRevisionDependencyDescriptor) {
+                    MultiRevisionDependencyDescriptor dependencyDescriptor = (MultiRevisionDependencyDescriptor) element;
+                    String revision = dependencyDescriptor.getNewRevision();
+
+                    if (revision == null) {
+                        return "";
+                    } else {
+                        return revision;
+                    }
+                }
+            }
+
+            return null;
+        }
+
+        public void modify(Object element, String property, Object value) {
+            if (element instanceof Item) {
+                element = ((Item) element).getData();
+            }
+
+            if (element instanceof MultiRevisionDependencyDescriptor
+                    && property.equals(NEW_REVISION)) {
+                MultiRevisionDependencyDescriptor multiRevisionDescriptor = (MultiRevisionDependencyDescriptor) element;
+                multiRevisionDescriptor.setNewRevision((String) value);
+
+                refresh(false);
+            }
+        }
+    }
+
+    public static void setSelectedProjects(IProject[] projects) {
+        selectedProjects = projects;
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/views/ReverseDependencyExplorerView.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message