diff options
author | Martin Fluegge | 2011-10-03 11:07:17 +0000 |
---|---|---|
committer | Martin Fluegge | 2011-10-03 11:07:17 +0000 |
commit | dd7080c630d17aaf726741699b47102d7a6ddc7c (patch) | |
tree | 175699a996d7b5fc6d73ef32d9643c5f9174cd55 /plugins/org.eclipse.emf.cdo.dawn | |
parent | a94e5b4370e43de153b70b8e9e17282751d8381b (diff) | |
download | cdo-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.java | 19 |
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; + } } |