Bug 397346 - Digram Editor loses focus on closing of MessageDialog
*Explicitly set the focus back to diagram editor after closing the
message dialog
Change-Id: Ic04eaebd99d6590d68c6fac07a1179eb6577e1f5
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultDirectEditPolicy.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultDirectEditPolicy.java
index 032bd19..857ae1a 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultDirectEditPolicy.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/policy/DefaultDirectEditPolicy.java
@@ -1,7 +1,7 @@
/*******************************************************************************
* <copyright>
*
- * Copyright (c) 2005, 2012 SAP AG.
+ * Copyright (c) 2005, 2013 SAP AG.
* 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
@@ -11,6 +11,7 @@
* SAP AG - initial API, implementation and documentation
* Bug 336488 - DiagramEditor API
* mgorning - Bug 347262 - DirectEditingFeature with TYPE_DIALOG type
+ * mwenz - Bug 397346 - Digram Editor loses focus on closing of MessageDialog in Graphiti
*
* </copyright>
*
@@ -82,6 +83,9 @@
if (message != null && message.length() != 0) {
MessageDialog.openError(GraphitiUiInternal.getWorkbenchService().getShell(),
Messages.DefaultDirectEditPolicy_0_xmsg, message);
+ if (configurationProvider.getDiagramEditor() != null) {
+ configurationProvider.getDiagramEditor().setFocus();
+ }
return null;
}