summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorirbull2011-10-26 02:42:49 (EDT)
committerirbull2011-10-26 02:42:49 (EDT)
commita928532f4fbcc4d7bef5b8587877d30e5cab0414 (patch)
tree96f4645450a7007d187dde99c5cdeb2068ec2f41
parent2152b9f4142f961497c59111d58c1641901431d0 (diff)
downloadrt.equinox.p2-a928532f4fbcc4d7bef5b8587877d30e5cab0414.zip
rt.equinox.p2-a928532f4fbcc4d7bef5b8587877d30e5cab0414.tar.gz
rt.equinox.p2-a928532f4fbcc4d7bef5b8587877d30e5cab0414.tar.bz2
Bug 261928 : Adds a Relaxed Constraint Optionv20111026-0642
Fixed the UI so that the option is only enabled if the original provisioning operation fails.
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RelaxedUpdateInstallOperation.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java17
4 files changed, 38 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RelaxedUpdateInstallOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RelaxedUpdateInstallOperation.java
index bcf61ac..8605f0f 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RelaxedUpdateInstallOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RelaxedUpdateInstallOperation.java
@@ -96,7 +96,7 @@ public class RelaxedUpdateInstallOperation extends ProfileChangeOperation {
}
}
}
- //return planner.getProvisioningPlan(finalChangeRequest, context, null);
+ request = (ProfileChangeRequest) finalChangeRequest;
}
@Override
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
index 22dbb00..efe2f3f 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
@@ -386,4 +386,8 @@ public abstract class ProvisioningOperationWizard extends Wizard {
public void setRelaxedResolution(boolean value) {
this.resolveWithRelaxedConstraints = value;
}
+
+ public boolean getRelaxedResoltion() {
+ return this.resolveWithRelaxedConstraints;
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java
index cb51fa0..d0ffad9 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java
@@ -164,10 +164,19 @@ public abstract class ResolutionResultsWizardPage extends ResolutionStatusPage {
}
}
+ @Override
+ public void updateStatus(IUElementListRoot newRoot, ProfileChangeOperation op) {
+ super.updateStatus(newRoot, op);
+ IStatus currentStatus = getProvisioningWizard().getCurrentStatus();
+ if (relaxConstraints != null)
+ relaxConstraints.setEnabled(currentStatus != null && !currentStatus.isOK());
+ }
+
private void createViewControlsArea(Composite controlsComposite) {
relaxConstraints = new Button(controlsComposite, SWT.CHECK);
relaxConstraints.setText(ProvUIMessages.ResolutionWizardPage_RelaxedConstraints);
relaxConstraints.setToolTipText(ProvUIMessages.ResolutionWizardPage_RelaxedConstraintsTip);
+ relaxConstraints.setSelection(((ProvisioningOperationWizard) getWizard()).getRelaxedResoltion());
relaxConstraints.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -177,6 +186,13 @@ public abstract class ResolutionResultsWizardPage extends ResolutionStatusPage {
});
}
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible)
+ relaxConstraints.setSelection(((ProvisioningOperationWizard) getWizard()).getRelaxedResoltion());
+ }
+
protected void createSizingInfo(Composite parent) {
// Default is to do nothing
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
index f240f82..122e6b7 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
@@ -13,6 +13,7 @@
package org.eclipse.equinox.internal.p2.ui.dialogs;
import java.util.ArrayList;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.*;
@@ -173,10 +174,19 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
Dialog.applyDialogFont(sashForm);
}
+ @Override
+ public void updateStatus(IUElementListRoot newRoot, ProfileChangeOperation op) {
+ super.updateStatus(newRoot, op);
+ IStatus currentStatus = getProvisioningWizard().getCurrentStatus();
+ if (relaxConstraints != null)
+ relaxConstraints.setEnabled(currentStatus != null && !currentStatus.isOK());
+ }
+
private void createViewControlsArea(Composite controlsComposite) {
relaxConstraints = new Button(controlsComposite, SWT.CHECK);
relaxConstraints.setText(ProvUIMessages.ResolutionWizardPage_RelaxedConstraints);
relaxConstraints.setToolTipText(ProvUIMessages.ResolutionWizardPage_RelaxedConstraintsTip);
+ relaxConstraints.setSelection(((ProvisioningOperationWizard) getWizard()).getRelaxedResoltion());
relaxConstraints.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -186,6 +196,13 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
});
}
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible)
+ relaxConstraints.setSelection(((ProvisioningOperationWizard) getWizard()).getRelaxedResoltion());
+ }
+
private void createSelectButtons(Composite parent) {
Composite buttonParent = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout();