diff options
author | Matthew Piggott | 2011-06-09 20:39:33 +0000 |
---|---|---|
committer | Matthew Piggott | 2011-06-09 20:39:33 +0000 |
commit | e381fc43170aba9f3b88febea625584f720da046 (patch) | |
tree | a3466daf2074b3866121ca4e19330870cb04f7cd | |
parent | 6c140220c9f2c024e80e59af542d6d63c1a8254a (diff) | |
download | rt.equinox.p2-e381fc43170aba9f3b88febea625584f720da046.tar.gz rt.equinox.p2-e381fc43170aba9f3b88febea625584f720da046.tar.xz rt.equinox.p2-e381fc43170aba9f3b88febea625584f720da046.zip |
bug 348941 - [ui] CCE while selecting feature for uninstall
6 files changed, 40 insertions, 24 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF index 3a246a27d..34724ee22 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.tests.ui -Bundle-Version: 1.0.100.qualifier +Bundle-Version: 1.0.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.100", diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UninstallWizardTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UninstallWizardTest.java index 1aa46ab44..245fae3d4 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UninstallWizardTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UninstallWizardTest.java @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Sonatype, Inc. - ongoing development *******************************************************************************/ package org.eclipse.equinox.p2.tests.ui.dialogs; @@ -17,6 +18,7 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.operations.ProfileModificationJob; import org.eclipse.equinox.p2.operations.UninstallOperation; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.widgets.Tree; import org.eclipse.ui.statushandlers.StatusManager; /** @@ -51,6 +53,8 @@ public class UninstallWizardTest extends WizardTest { dialog.showPage(page2); assertTrue(page2.isPageComplete()); + Tree tree = findTree(page2); + tree.setSelection(tree.getTopItem()); // if another operation is scheduled for this profile, we should not be allowed to proceed longOp = getLongTestOperation(); getProvisioningUI().schedule(longOp, StatusManager.LOG); diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UpdateWizardTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UpdateWizardTest.java index 29f8b84f1..73dd6ef8d 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UpdateWizardTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/UpdateWizardTest.java @@ -21,7 +21,7 @@ import org.eclipse.equinox.p2.operations.UpdateOperation; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.*; +import org.eclipse.swt.widgets.Button; import org.eclipse.ui.statushandlers.StatusManager; /** @@ -198,24 +198,4 @@ public class UpdateWizardTest extends WizardTest { dialog.getShell().close(); } } - - protected Tree findTree(ResolutionResultsWizardPage page) { - return findTree(page.getControl()); - } - - protected Tree findTree(Control control) { - if (control instanceof Tree) - return (Tree) control; - if (control instanceof Composite) { - Control[] children = ((Composite) control).getChildren(); - for (int i = 0; i < children.length; i++) { - Tree tree = findTree(children[i]); - if (tree != null) - return tree; - } - - } - return null; - } - }
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/WizardTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/WizardTest.java index dc7934bb4..a76125adf 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/WizardTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/WizardTest.java @@ -10,11 +10,31 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.ui.dialogs; +import org.eclipse.equinox.internal.p2.ui.dialogs.ResolutionResultsWizardPage; import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest; +import org.eclipse.swt.widgets.*; /** * Generic wizard test methods */ public abstract class WizardTest extends AbstractProvisioningUITest { + protected Tree findTree(ResolutionResultsWizardPage page) { + return findTree(page.getControl()); + } + + protected Tree findTree(Control control) { + if (control instanceof Tree) + return (Tree) control; + if (control instanceof Composite) { + Control[] children = ((Composite) control).getChildren(); + for (int i = 0; i < children.length; i++) { + Tree tree = findTree(children[i]); + if (tree != null) + return tree; + } + + } + return null; + } } diff --git a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF index 87e9e3143..30caa575c 100644 --- a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.equinox.p2.ui;singleton:=true -Bundle-Version: 2.1.0.qualifier +Bundle-Version: 2.1.100.qualifier Bundle-Activator: org.eclipse.equinox.internal.p2.ui.ProvUIActivator Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java index ffb344c70..390a7feae 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * EclipseSource - ongoing development + * Sonatype, Inc. - ongoing development *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.dialogs; @@ -124,6 +125,17 @@ public abstract class ResolutionStatusPage extends ProvisioningWizardPage { return description; } + protected String getIUDescription(Object element) { + if (element instanceof AvailableIUElement) { + return getIUDescription((AvailableIUElement) element); + } + IInstallableUnit selectedIU = ElementUtils.elementToIU(element); + if (selectedIU != null) { + return getIUDescription(selectedIU); + } + return ""; //$NON-NLS-1$ + } + String getMessageText(IStatus currentStatus) { if (currentStatus == null || currentStatus.isOK()) return getDescription(); @@ -136,7 +148,7 @@ public abstract class ResolutionStatusPage extends ProvisioningWizardPage { void setDetailText(ProfileChangeOperation resolvedOperation) { String detail = null; - AvailableIUElement selectedElement = (AvailableIUElement) getSelectedElement(); + Object selectedElement = getSelectedElement(); IInstallableUnit selectedIU = ElementUtils.elementToIU(selectedElement); IUDetailsGroup detailsGroup = getDetailsGroup(); |