diff options
author | Ian Bull | 2011-09-21 21:11:07 +0000 |
---|---|---|
committer | Ian Bull | 2011-10-03 19:35:39 +0000 |
commit | 5ab961530101ed0266a077c889592845ac165cdf (patch) | |
tree | c8c5a02c96ae42bc099686d5e86904c843dfc52a | |
parent | 18eb6e1529e93f1dce2cf59eba948b54b5c138c3 (diff) | |
download | rt.equinox.p2-5ab961530101ed0266a077c889592845ac165cdf.tar.gz rt.equinox.p2-5ab961530101ed0266a077c889592845ac165cdf.tar.xz rt.equinox.p2-5ab961530101ed0266a077c889592845ac165cdf.zip |
Created an I'm Feeling Lucky Button
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); |