diff options
author | Ian Bull | 2011-09-21 21:11:07 +0000 |
---|---|---|
committer | Ian Bull | 2011-09-21 21:11:07 +0000 |
commit | 0afa8283a34d478ad8fb8c9a2bf4815816df68a4 (patch) | |
tree | 6b26ff74eac88a4fff5680992200b4a392ed2ebf | |
parent | 41e215bfde9dc5d7041c963db1feb366989e34bc (diff) | |
download | rt.equinox.p2-irbull/luckyButton.tar.gz rt.equinox.p2-irbull/luckyButton.tar.xz rt.equinox.p2-irbull/luckyButton.zip |
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.
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 84f5e932c..79becbe7e 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 bae73f238..4baa4a067 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 556f2999f..bd3762550 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 16dfec241..44708e638 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); |