Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (JBoss)2013-04-29 19:24:06 +0000
committerPascal Rapicault2013-04-29 20:55:35 +0000
commitdf57b8a2a5eb635cf3eddd4617dbeee19e213669 (patch)
tree0ed6b4273cffed0a2e765e9777246e9d08c9b15d /bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox
parentd287d7ac898af36e2e4aba587218528b5956ca80 (diff)
downloadrt.equinox.p2-df57b8a2a5eb635cf3eddd4617dbeee19e213669.tar.gz
rt.equinox.p2-df57b8a2a5eb635cf3eddd4617dbeee19e213669.tar.xz
rt.equinox.p2-df57b8a2a5eb635cf3eddd4617dbeee19e213669.zip
Add remediation support to Discovery UII20130430-0800I20130430-0031I20130429-2000
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java18
2 files changed, 29 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
index 7d4518823..10a548c40 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
@@ -21,6 +21,7 @@ import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.wizard.IWizardPage;
/**
* An Install wizard that is invoked when the user has already selected which
@@ -38,6 +39,14 @@ public class PreselectedIUInstallWizard extends WizardWithLicenses {
setDefaultPageImageDescriptor(ProvUIImages.getImageDescriptor(ProvUIImages.WIZARD_BANNER_INSTALL));
}
+ @Override
+ public IWizardPage getStartingPage() {
+ if (remediationOperation != null && remediationOperation.hasRemedies()) {
+ return getNextPage(mainPage);
+ }
+ return super.getStartingPage();
+ }
+
protected ISelectableIUsPage createMainPage(IUElementListRoot input, Object[] selections) {
mainPage = new SelectableIUsPage(ui, this, input, selections);
mainPage.setTitle(ProvUIMessages.PreselectedIUInstallWizard_Title);
@@ -88,8 +97,8 @@ public class PreselectedIUInstallWizard extends WizardWithLicenses {
@Override
protected RemediationPage createRemediationPage() {
- // TODO Auto-generated method stub
- return null;
+ remediationPage = new RemediationPage(ui, this, root, operation);
+ return remediationPage;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
index 670b753e7..38b45efa0 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
@@ -200,6 +200,23 @@ public class ProvisioningUI {
* @return the wizard return code
*/
public int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, LoadMetadataRepositoryJob job) {
+ return openInstallWizard(initialSelections, operation, null, job);
+ }
+
+ /**
+ * Open an install wizard for installing the specified IInstallableUnits and remediationOperation.
+ *
+ * @param initialSelections the IInstallableUnits that should be selected when the wizard opens. May be <code>null</code>.
+ * @param operation the operation describing the proposed install. If this operation is not <code>null</code>, then a wizard showing
+ * only the IInstallableUnits described in the operation will be shown. If the operation is <code>null</code>, then a
+ * wizard allowing the user to browse the repositories will be opened.
+ * @param remediationOperation the alternate operations if the proposed update failed. May be <code>null</code>.
+ * @param job a repository load job that is loading or has already loaded the repositories. Can be used to pass along
+ * an in-memory repository reference to the wizard.
+ *
+ * @return the wizard return code
+ */
+ public int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, RemediationOperation remediationOperation, LoadMetadataRepositoryJob job) {
if (operation == null) {
InstallWizard wizard = new InstallWizard(this, operation, initialSelections, job);
WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard);
@@ -208,6 +225,7 @@ public class ProvisioningUI {
return dialog.open();
}
PreselectedIUInstallWizard wizard = new PreselectedIUInstallWizard(this, operation, initialSelections, job);
+ wizard.setRemediationOperation(remediationOperation);
WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard);
dialog.create();
PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IProvHelpContextIds.INSTALL_WIZARD);

Back to the top