Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-06-07 21:09:38 -0400
committerIgor Fedorenko2011-06-07 21:15:32 -0400
commitf6219af005c0b98ca8a221db62d9cc209fd4687c (patch)
tree1c76965e295134cca70257b6be77785587e9d038 /org.eclipse.m2e.discovery
parent63b512743c9a442ae2f0a4a83b8fea071ce9e874 (diff)
downloadm2e-core-f6219af005c0b98ca8a221db62d9cc209fd4687c.tar.gz
m2e-core-f6219af005c0b98ca8a221db62d9cc209fd4687c.tar.xz
m2e-core-f6219af005c0b98ca8a221db62d9cc209fd4687c.zip
348660 - PreselectedIUInstallWizard does not present license info
Give license page a chance to do it's thing even if original pre-selection has not changed. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.discovery')
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
index 1ce2616b..1c9f5c04 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java
@@ -8,6 +8,7 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
+
package org.eclipse.m2e.internal.discovery.wizards;
import java.util.Collection;
@@ -19,10 +20,13 @@ import org.eclipse.equinox.internal.p2.ui.dialogs.ResolutionResultsWizardPage;
import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
+import org.eclipse.equinox.p2.ui.AcceptLicensesWizardPage;
import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.m2e.internal.discovery.operation.RestartInstallOperation;
+
/*
* This exists to allow us to return a ProfileChangeOperation which changes the restart policy for provisioning jobs.
*/
@@ -36,9 +40,6 @@ public class MavenDiscoveryInstallWizard extends PreselectedIUInstallWizard {
super(ui, operation, initialSelections, job);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard#getProfileChangeOperation(java.lang.Object[])
- */
@Override
protected ProfileChangeOperation getProfileChangeOperation(Object[] elements) {
RestartInstallOperation op = ((RestartInstallOperation) operation).copy(ElementUtils.elementsToIUs(elements));
@@ -60,4 +61,24 @@ public class MavenDiscoveryInstallWizard extends PreselectedIUInstallWizard {
public void setResolutionResultsPage(ResolutionResultsWizardPage page) {
resolutionPage = page;
}
+
+ @Override
+ protected void initializeResolutionModelElements(Object[] selectedElements) {
+ super.initializeResolutionModelElements(selectedElements);
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=348660
+ // PreselectedIUInstallWizard does not ask to approve licenses if original selection has not changed
+ // give license page analyse preselected and do it's thing if necessary
+ // TODO remove when Bug348660 is fixed in p2
+ workaroundBug348660();
+ }
+
+ private void workaroundBug348660() {
+ for(IWizardPage page : getPages()) {
+ if(page instanceof AcceptLicensesWizardPage) {
+ AcceptLicensesWizardPage licensePage = (AcceptLicensesWizardPage) page;
+ licensePage.update(ElementUtils.elementsToIUs(planSelections).toArray(new IInstallableUnit[0]), operation);
+ }
+ }
+ }
+
}

Back to the top