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

Bug 421946

Summary: Incorrect editor icons in Eclipse
Product: [Eclipse Project] Platform Reporter: Axelsson Martin <martin.axelsson>
Component: IDEAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 4.2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Axelsson Martin CLA 2013-11-18 04:36:03 EST
In our tool we define custom editors by means of the org.eclipse.ui.editors extension point and provide default icon for it.
However, we are customizing the icon dynamically based on the editor content by means of the WorkbenchPart.setTitleImage method.
The icon is displayed correctly in the editor stack but when pressing CTRL+E(or SHIFT+CTRL+E) all editors are displayed with incorrect(default) icons.
I have discovered that the reason is org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl obtains an icon from the editor descriptor instead of getting it from the edit part itself.

The problem can be reproduced with CDT.
There are two different icons used for C/C++ header(.h) and implementation(.c) source files.
Open one editor for a header file and one editor for implementation file, notice it has a different icons.
Now press CTRL+E, all editors are displayed with the same icon.
It worked fine in Eclipse 3.* so it is a regression.
Comment 1 Dani Megert CLA 2013-11-18 07:19:51 EST

*** This bug has been marked as a duplicate of bug 409332 ***