summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2011-09-21 17:11:07 (EDT)
committerIan Bull2011-09-21 17:11:07 (EDT)
commit0afa8283a34d478ad8fb8c9a2bf4815816df68a4 (patch)
tree6b26ff74eac88a4fff5680992200b4a392ed2ebf
parent41e215bfde9dc5d7041c963db1feb366989e34bc (diff)
downloadrt.equinox.p2-0afa8283a34d478ad8fb8c9a2bf4815816df68a4.zip
rt.equinox.p2-0afa8283a34d478ad8fb8c9a2bf4815816df68a4.tar.gz
rt.equinox.p2-0afa8283a34d478ad8fb8c9a2bf4815816df68a4.tar.bz2
Created an I'm Feeling Lucky Buttonv20110921-2111irbull/luckyButton
This is just the stub of the button that will re-run the planner. This button is always enabled (even if the plan was successful). This is for testing purposes.
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUDetailsGroup.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java2
4 files changed, 21 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java
index 84f5e93..79becbe 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java
@@ -137,7 +137,7 @@ public class AvailableIUsPage extends ProvisioningWizardPage implements ISelecta
createSelectButtons(aboveSash);
// Details area
- iuDetailsGroup = new IUDetailsGroup(sashForm, availableIUGroup.getStructuredViewer(), SWT.DEFAULT, true);
+ iuDetailsGroup = new IUDetailsGroup(sashForm, availableIUGroup.getStructuredViewer(), SWT.DEFAULT, true, (ProvisioningOperationWizard) getWizard());
sashForm.setWeights(getSashWeights());
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUDetailsGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUDetailsGroup.java
index bae73f2..4baa4a0 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUDetailsGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUDetailsGroup.java
@@ -19,6 +19,8 @@ import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.window.SameShellProvider;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
@@ -40,14 +42,18 @@ public class IUDetailsGroup {
private int widthHint;
private boolean scrollable;
private String lastText;
+ private Button retryButton = null;
+
+ private final ProvisioningOperationWizard wizard;
/**
*
*/
- public IUDetailsGroup(Composite parent, ISelectionProvider selectionProvider, int widthHint, boolean scrollable) {
+ public IUDetailsGroup(Composite parent, ISelectionProvider selectionProvider, int widthHint, boolean scrollable, ProvisioningOperationWizard wizard) {
this.selectionProvider = selectionProvider;
this.widthHint = widthHint;
this.scrollable = scrollable;
+ this.wizard = wizard;
createGroupComposite(parent);
}
@@ -88,6 +94,17 @@ public class IUDetailsGroup {
// set the initial state based on selection
propLink.setVisible(!selectionProvider.getSelection().isEmpty());
+ retryButton = new Button(detailsComposite, SWT.PUSH);
+ retryButton.setText("I'm feeling lucky...");
+ retryButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ System.out.println("Let's retry the operation");
+ // TODO, Let's do something different here.
+ wizard.recomputePlan(wizard.getContainer());
+ System.out.println("Completed... the operation");
+ }
+ });
}
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 556f299..bd37625 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
@@ -111,7 +111,7 @@ public abstract class ResolutionResultsWizardPage extends ResolutionStatusPage {
createSizingInfo(composite);
// The text area shows a description of the selected IU, or error detail if applicable.
- iuDetailsGroup = new IUDetailsGroup(sashForm, treeViewer, convertWidthInCharsToPixels(ILayoutConstants.DEFAULT_TABLE_WIDTH), true);
+ iuDetailsGroup = new IUDetailsGroup(sashForm, treeViewer, convertWidthInCharsToPixels(ILayoutConstants.DEFAULT_TABLE_WIDTH), true, (ProvisioningOperationWizard) getWizard());
setControl(sashForm);
sashForm.setWeights(getSashWeights());
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 16dfec2..44708e6 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
@@ -148,7 +148,7 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
createSelectButtons(composite);
// The text area shows a description of the selected IU, or error detail if applicable.
- iuDetailsGroup = new IUDetailsGroup(sashForm, tableViewer, convertWidthInCharsToPixels(ILayoutConstants.DEFAULT_TABLE_WIDTH), true);
+ iuDetailsGroup = new IUDetailsGroup(sashForm, tableViewer, convertWidthInCharsToPixels(ILayoutConstants.DEFAULT_TABLE_WIDTH), true, (ProvisioningOperationWizard) getWizard());
updateStatus(root, resolvedOperation);
setControl(sashForm);