Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2011-10-03 11:07:17 +0000
committerMartin Fluegge2011-10-03 11:07:17 +0000
commitdd7080c630d17aaf726741699b47102d7a6ddc7c (patch)
tree175699a996d7b5fc6d73ef32d9643c5f9174cd55 /plugins/org.eclipse.emf.cdo.dawn
parenta94e5b4370e43de153b70b8e9e17282751d8381b (diff)
downloadcdo-dd7080c630d17aaf726741699b47102d7a6ddc7c.tar.gz
cdo-dd7080c630d17aaf726741699b47102d7a6ddc7c.tar.xz
cdo-dd7080c630d17aaf726741699b47102d7a6ddc7c.zip
[359656] [Dawn] Provide collaborative extension for Graphiti editors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359656
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java
index 47ca1945c4..3c668db182 100644
--- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java
@@ -18,6 +18,8 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
+ * TODO move this one to the dawn.util bundle
+ *
* @author Martin Fluegge
*/
public class DawnEditorHelper
@@ -42,4 +44,21 @@ public class DawnEditorHelper
}
return editor;
}
+
+ /**
+ * This method tries to retrieve a Display. First it tries to get the current display. If this fails it will return
+ * the default display.
+ *
+ * @return the current display, if not null. If the current Display is null then the default Display.
+ * @since 2.0
+ */
+ public static Display getDisplay()
+ {
+ Display display = Display.getCurrent();
+ if (display == null)
+ {
+ display = Display.getDefault();
+ }
+ return display;
+ }
}

Back to the top