diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java index 142b78875..57949d802 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Sonatype, Inc. - ongoing development + * Red Hat, Inc. - support for remediation page *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.dialogs; @@ -18,8 +19,7 @@ import org.eclipse.equinox.internal.p2.ui.*; import org.eclipse.equinox.internal.p2.ui.model.*; import org.eclipse.equinox.p2.engine.ProvisioningContext; import org.eclipse.equinox.p2.metadata.IInstallableUnit; -import org.eclipse.equinox.p2.operations.InstallOperation; -import org.eclipse.equinox.p2.operations.ProfileChangeOperation; +import org.eclipse.equinox.p2.operations.*; import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob; import org.eclipse.equinox.p2.ui.ProvisioningUI; import org.eclipse.jface.dialogs.IDialogConstants; @@ -64,18 +64,24 @@ public class InstallWizard extends WizardWithLicenses { if (selectedElements == null) return; root = new IUElementListRoot(); - ArrayList<AvailableIUElement> list = new ArrayList<AvailableIUElement>(selectedElements.length); - ArrayList<AvailableIUElement> selections = new ArrayList<AvailableIUElement>(selectedElements.length); - for (int i = 0; i < selectedElements.length; i++) { - IInstallableUnit iu = ElementUtils.getIU(selectedElements[i]); - if (iu != null) { - AvailableIUElement element = new AvailableIUElement(root, iu, getProfileId(), shouldShowProvisioningPlanChildren()); - list.add(element); - selections.add(element); + if (operation instanceof RemediationOperation) { + ArrayList<AvailableIUElement> list = remediationPage.transformIUstoIUElements(); + root.setChildren(list.toArray()); + planSelections = list.toArray(); + } else { + ArrayList<AvailableIUElement> list = new ArrayList<AvailableIUElement>(selectedElements.length); + ArrayList<AvailableIUElement> selections = new ArrayList<AvailableIUElement>(selectedElements.length); + for (int i = 0; i < selectedElements.length; i++) { + IInstallableUnit iu = ElementUtils.getIU(selectedElements[i]); + if (iu != null) { + AvailableIUElement element = new AvailableIUElement(root, iu, getProfileId(), shouldShowProvisioningPlanChildren()); + list.add(element); + selections.add(element); + } } + root.setChildren(list.toArray()); + planSelections = selections.toArray(); } - root.setChildren(list.toArray()); - planSelections = selections.toArray(); } /* @@ -116,6 +122,11 @@ public class InstallWizard extends WizardWithLicenses { return errorReportingPage; } + protected RemediationPage createRemediationPage() { + remediationPage = new RemediationPage(ui, this, root, operation); + return remediationPage; + } + /* (non-Javadoc) * @see org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard#getProfileChangeOperation(java.lang.Object[]) */ |