Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2009-03-09 21:49:10 +0000
committerJohn Arthorne2009-03-09 21:49:10 +0000
commitf5e186871c762ed1760f225ea462cc37699087cb (patch)
tree5713e75f6a99a948065e5f2c3a2d9221ec9e8883 /bundles/org.eclipse.equinox.p2.director/src
parent516b090efce052fe94ae66a4795fabf8f44a2491 (diff)
downloadrt.equinox.p2-f5e186871c762ed1760f225ea462cc37699087cb.tar.gz
rt.equinox.p2-f5e186871c762ed1760f225ea462cc37699087cb.tar.xz
rt.equinox.p2-f5e186871c762ed1760f225ea462cc37699087cb.zip
Bug 266760 Render explanation as a status treev20090309-1800
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties4
3 files changed, 21 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
index 6a364fe98..8b3d1fcb4 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
@@ -36,6 +36,8 @@ public class Messages extends NLS {
public static String Explanation_hardDependency;
public static String Explanation_missingRequired;
public static String Explanation_optionalDependency;
+ public static String Explanation_rootMissing;
+ public static String Explanation_rootSingleton;
public static String Explanation_singleton;
public static String Explanation_to;
public static String Explanation_toInstall;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
index 900ceda17..b4f1dbf04 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
@@ -105,13 +105,26 @@ public class SimplePlanner implements IPlanner {
if (explanations == null)
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_Unsatisfied_Dependencies);
MultiStatus root = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Director_Unsatisfied_Dependencies, null);
+ //try to find a more specific root message if possible
+ String specificMessage = null;
for (Iterator it = explanations.iterator(); it.hasNext();) {
final Object next = it.next();
- if (next instanceof Explanation)
+ if (next instanceof Explanation) {
root.add(((Explanation) next).toStatus());
- else
+ if (specificMessage == null && next instanceof Explanation.MissingIU)
+ specificMessage = Messages.Explanation_rootMissing;
+ else if (specificMessage == null && next instanceof Explanation.Singleton) {
+ specificMessage = Messages.Explanation_rootSingleton;
+ }
+ } else
root.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, next.toString()));
}
+ //use a more specific root message if available
+ if (specificMessage != null) {
+ MultiStatus newRoot = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, specificMessage, null);
+ newRoot.merge(root);
+ root = newRoot;
+ }
return root;
}
@@ -299,12 +312,11 @@ public class SimplePlanner implements IPlanner {
return new ProvisioningPlan(s);
if (s.getSeverity() == IStatus.ERROR) {
sub.setTaskName(Messages.Planner_NoSolution);
- LogHelper.log(s);
if (context != null && !(context.getProperty(EXPLANATION) == null || Boolean.TRUE.toString().equalsIgnoreCase(context.getProperty(EXPLANATION))))
return new ProvisioningPlan(s);
boolean newExplanation = true;
- if (System.getProperty("p2.new.explanation") != null && Boolean.getBoolean("p2.new.explanation") == false)
+ if (System.getProperty("p2.new.explanation") != null && Boolean.getBoolean("p2.new.explanation") == false) //$NON-NLS-1$ //$NON-NLS-2$
newExplanation = false;
if (!newExplanation) {
//We invoke the old resolver to get explanations for now
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
index 6a17184b9..916be28c3 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
@@ -23,8 +23,10 @@ Director_Unsatisfied_Dependency=\
Explanation_alreadyInstalled=Software currently installed: {0}
Explanation_from=From: {0}
Explanation_hardDependency=Cannot satisfy dependency: {0} depends on: {1}
-Explanation_missingRequired=Missing requirement: {0} missing required {1}
+Explanation_missingRequired=Missing requirement: {0} requires ''{1}'' but it could not be found
Explanation_optionalDependency=Optional dependency
+Explanation_rootMissing=Cannot complete the install because one or more required items could not be found.
+Explanation_rootSingleton=Cannot complete the install because of a conflicting dependency.
Explanation_singleton=Only one of the following can be installed at once: {0}
Explanation_to=To: {0}
Explanation_toInstall=Software being installed: {0}

Back to the top