Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-10-19 22:07:31 +0000
committerChris Goldthorpe2009-10-19 22:07:31 +0000
commit576d9c1d8f796950a7ed119f3103a1b7f0b1df6e (patch)
tree9fa16c357422926615622c0bc1599a11bb8db1cf /org.eclipse.ui.cheatsheets
parente1d8a5e5c04581f9ada67b3829ef9841669b2d0b (diff)
downloadeclipse.platform.ua-576d9c1d8f796950a7ed119f3103a1b7f0b1df6e.tar.gz
eclipse.platform.ua-576d9c1d8f796950a7ed119f3103a1b7f0b1df6e.tar.xz
eclipse.platform.ua-576d9c1d8f796950a7ed119f3103a1b7f0b1df6e.zip
Bug 291750 – changing the cheat sheet from an item link causes SWTException:
Diffstat (limited to 'org.eclipse.ui.cheatsheets')
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
index bf481083e..717e42a14 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Tom Hofmann, Perspectix AG - https://bugs.eclipse.org/bugs/show_bug.cgi?id=291750
*******************************************************************************/
package org.eclipse.ui.internal.cheatsheets.views;
@@ -1036,12 +1037,21 @@ public class CheatSheetViewer implements ICheatSheetViewer, IMenuContributor {
link.setCursor(busyCursor);
currentItem = (ViewItem) link.getData();
CoreItem coreItem = (CoreItem) currentItem;
+ Page page= currentPage;
if (coreItem != null) {
try {
hookDialogListener();
dialogReturnCode = -1;
IStatus status = coreItem.runExecutable(getManager());
+ if ( status.getSeverity() == IStatus.ERROR) {
+ CheatSheetPlugin.getPlugin().getLog().log(status);
+ org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
+ }
+ if (page != currentPage) {
+ // action closed the cheatsheet view or changed the cheatsheet
+ return;
+ }
if (status.isOK() && dialogReturnCode != Window.CANCEL) {
coreItem.setRestartImage();
if (!coreItem.hasConfirm()) {
@@ -1050,10 +1060,6 @@ public class CheatSheetViewer implements ICheatSheetViewer, IMenuContributor {
saveCurrentSheet();
}
}
- if ( status.getSeverity() == IStatus.ERROR) {
- CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
- }
}
finally {
unhookDialogListener();

Back to the top