Bug 275990 - Replace PlatformUi.getWorkbench().getDisplay() with DisplayUtils.getDisplay() where appropriate
Summary: Replace PlatformUi.getWorkbench().getDisplay() with DisplayUtils.getDisplay()...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 2.2   Edit
Assignee: Alex Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-12 20:04 EDT by Alex Boyko CLA
Modified: 2010-07-19 12:30 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (10.05 KB, patch)
2009-05-12 20:04 EDT, Alex Boyko CLA
no flags Details | Diff
patch for review (24.19 KB, patch)
2009-05-13 18:20 EDT, Alex Boyko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Boyko CLA 2009-05-12 20:04:14 EDT
Created attachment 135484 [details]
proposed patch

When diagram is rendered with no workbench running, rendering of images may fail due to calls to PlatformUi.getWorkbench().getDisplay() to grab the display object for image creation.
DisplayUtils.getDisplay() should be called in these cases.

Attached patch fixes the problem
Comment 1 Alex Boyko CLA 2009-05-13 18:20:53 EDT
Created attachment 135710 [details]
patch for review

Hi Anthony,

Apparently, I didn't do a good job on sweeping PlatformUi.getWorkbench().getDisplay() last time. Only swept places with Display.getDefault() + a fix for preferences initialization.

So this patch is replacing almost all PlatformUi.getWorkbench().getDisplay() calls with DisplayUtils.getDisplay() in most of the cases. There are a few places left where workbench display is used, however, those places assume workbench running and make subsequent calls to workbench etc.

Could you review this patch please?
Comment 2 Anthony Hunter CLA 2009-05-26 15:28:13 EDT
(In reply to comment #1)
> Could you review this patch please?

I do not see any issues with the patch.

Comment 3 Alex Boyko CLA 2009-05-26 15:48:38 EDT
Fixed for 2.2
Comment 4 Eclipse Webmaster CLA 2010-07-16 23:35:55 EDT
[target cleanup] 2.2 RC was the original target milestone for this
bug
Comment 5 Eclipse Webmaster CLA 2010-07-19 12:30:57 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug