Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337380

Summary: E4Application does not configure Display.setAppName()
Product: [Eclipse Project] e4 Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch to configure the app name in E4Application#getApplicationDisplay()
none
v02 none

Description Brian de Alwis CLA 2011-02-16 18:14:06 EST
Created attachment 189142 [details]
patch to configure the app name in E4Application#getApplicationDisplay()

E3.x's org.eclipse.ui.internal.Workbench#createDisplay() calls o.e.swt.widgets.Display.setAppName() with the product's app name.  E4Application (or something) should too.

The attached patch sets the display name as part of E4Application#getApplicationDisplay().
Comment 1 Brian de Alwis CLA 2011-02-16 19:09:35 EST
I should add: the justification for this comes from the recent patches to the CocoaUIHandler which needs access to the application name.  Unfortunately the CocoaUIHandler can't actually access Platform.getProduct() nor pull in the IProduct type due to OSGi constraint violations, and this seems the best solution.

The CocoaUIHandler is defined in fragment org.eclipse.e4.ui.workbench.renderers.swt.cocoa, which is a fragment of o.e.e4.ui.w.r.swt.  w.r.swt doesn't actually depend on org.eclipse.core.runtime, and so w.r.swt.cocoa can't actually pull in a dependency on org.eclipse.core.runtime: I get constraint violations regardless of whether I do a 

   Require-Bundle: org.eclipse.core.runtime 

or 

   Import-Package: org.eclipse.core.runtime;bundle-symbolic-name="org.eclipse.core.runtime"
Comment 2 Brian de Alwis CLA 2011-02-17 15:24:36 EST
Created attachment 189227 [details]
v02

Display#setAppName() is static.  As per bug 329456#c14 the app name should be set before the Display is created to ensure the app menus are correctly-populated with the application name.
Comment 3 Brian de Alwis CLA 2011-03-29 08:52:14 EDT
Applied to HEAD.