Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbrun2015-05-04 09:11:45 +0000
committerCedric Brun2015-05-07 08:06:28 +0000
commitced42b0e68fae6b6eea898136ca8cdafb9d75d13 (patch)
tree9215d0b045a8f54668613d8cac316337cb9ef847
parent88b13e50dca7c42bc1084ddbd475e3b22eac0f09 (diff)
downloadorg.eclipse.sirius-ced42b0e68fae6b6eea898136ca8cdafb9d75d13.tar.gz
org.eclipse.sirius-ced42b0e68fae6b6eea898136ca8cdafb9d75d13.tar.xz
org.eclipse.sirius-ced42b0e68fae6b6eea898136ca8cdafb9d75d13.zip
[464958] Make LogThroughActiveDialectEditorLogListener more robust
LogThroughActiveDialectEditorLogListener is installed by SiriusEditPlugin.start() hence is pretty much always running. Reworking the conditions when it reacts to a logged exception so that it will only call PlatformUI.getWorkbench() for exceptions which are of interests (and not call the workbench and then check if the exception is of interest). Also check for the workbench running before accessing it to avoid situations where : java.lang.IllegalStateException: Workbench has not been created yet. would be thrown. Bug: 464958 Change-Id: I1dba32be04e503ae6995665af0a28b6575ff4ab2 Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/LogThroughActiveDialectEditorLogListener.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/LogThroughActiveDialectEditorLogListener.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/LogThroughActiveDialectEditorLogListener.java
index 9e3ad7b7a9..3cd45b9424 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/LogThroughActiveDialectEditorLogListener.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/LogThroughActiveDialectEditorLogListener.java
@@ -84,14 +84,12 @@ public final class LogThroughActiveDialectEditorLogListener implements ILogListe
// requires logging, opening a pop-up
// Notice that we do not display such pop-ups while eclipse is
// starting (can be confusing for end-user)
- if (!hasBeenLoggedThroughDialect && !PlatformUI.getWorkbench().isStarting()) {
- if (shouldBeLoggedThroughPopup(exception)) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Permission Issue", getErrorMessage(exception));
- }
- });
- }
+ if (!hasBeenLoggedThroughDialect && shouldBeLoggedThroughPopup(exception) && PlatformUI.isWorkbenchRunning() && !PlatformUI.getWorkbench().isStarting()) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Permission Issue", getErrorMessage(exception));
+ }
+ });
}
}
}

Back to the top