Lines 17-22
Link Here
|
17 |
import org.eclipse.core.runtime.*; |
17 |
import org.eclipse.core.runtime.*; |
18 |
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; |
18 |
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; |
19 |
import org.eclipse.equinox.internal.p2.core.helpers.Tracing; |
19 |
import org.eclipse.equinox.internal.p2.core.helpers.Tracing; |
|
|
20 |
import org.eclipse.equinox.internal.p2.director.Explanation.MissingIU; |
21 |
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; |
20 |
import org.eclipse.equinox.internal.p2.metadata.query.UpdateQuery; |
22 |
import org.eclipse.equinox.internal.p2.metadata.query.UpdateQuery; |
21 |
import org.eclipse.equinox.internal.p2.rollback.FormerState; |
23 |
import org.eclipse.equinox.internal.p2.rollback.FormerState; |
22 |
import org.eclipse.equinox.internal.provisional.p2.director.*; |
24 |
import org.eclipse.equinox.internal.provisional.p2.director.*; |
Lines 124-129
Link Here
|
124 |
private IStatus convertExplanationToStatus(Set<Explanation> explanations) { |
126 |
private IStatus convertExplanationToStatus(Set<Explanation> explanations) { |
125 |
if (explanations == null) |
127 |
if (explanations == null) |
126 |
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_Unsatisfied_Dependencies); |
128 |
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_Unsatisfied_Dependencies); |
|
|
129 |
|
130 |
// hack to create a useful message when a user installs something intended for a target platform into the IDE |
131 |
ArrayList<IStatus> forTargets = new ArrayList<IStatus>(0); |
132 |
for (Explanation next : explanations) { |
133 |
if (next instanceof Explanation.MissingIU) { |
134 |
Explanation.MissingIU missingIU = (MissingIU) next; |
135 |
if (missingIU.req instanceof IRequiredCapability && "A.PDE.Target.Platform".equals(((IRequiredCapability) missingIU.req).getNamespace())) //$NON-NLS-1$ |
136 |
forTargets.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, missingIU.getUserReadableName(missingIU.iu))); |
137 |
} |
138 |
} |
139 |
if (forTargets.size() > 0) { |
140 |
// add a blurb about disabling 'include required software'. The following line could be removed if bug 309863 is fixed |
141 |
forTargets.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_For_Target_Unselect_Required)); |
142 |
// return a multi status with all the IUs that require A.PDE.Target.Platform |
143 |
return new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, forTargets.toArray(new IStatus[forTargets.size()]), Messages.Director_For_Target, null); |
144 |
} |
127 |
MultiStatus root = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Director_Unsatisfied_Dependencies, null); |
145 |
MultiStatus root = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Director_Unsatisfied_Dependencies, null); |
128 |
//try to find a more specific root message if possible |
146 |
//try to find a more specific root message if possible |
129 |
String specificMessage = null; |
147 |
String specificMessage = null; |