Community
Participate
Working Groups
Created attachment 231654 [details] Screenshot to show the difference between the icon displayed in the editor part versus the icon retrieved via the IEditorReference implementation Image/Icon information returned by EditorReference implementation is inconsistent with the IEditorPart implementation. Please see the detailed explanation at the following link http://www.eclipse.org/forums/index.php/t/487787/ It seems that the EditorReference implementation is returning the Image information for the editor using the "Icon" attribute in the org.eclipse.ui.editor extension of an editor. But the Image that is displayed for the editor in the workbench area does not reply on this and instead relies on the getTitleImage() implementation of IEditorPart. Anyone who relies on the EditorReference of the editor to get the image could potentially get a different image than the one displayed for the editor in the workbench area. One such consumer is the CTRL + F6 (or next editor dialog). I verified this by looking at the code of the handler class "CycleEditorHandler" which is invoked on "CTRL + F6". The method that adds the items in the dialog is as follows. I have highlighted the code that sets the image for the editor in the dialog. protected void addItems(Table table, WorkbenchPage page) { List<EditorReference> refs = page.getSortedEditorReferences(); for (EditorReference ref : refs) { TableItem item = null; item = new TableItem(table, SWT.NONE); if (ref.isDirty()) { item.setText("*" + ref.getTitle()); //$NON-NLS-1$ } else { item.setText(ref.getTitle()); } item.setImage(ref.getTitleImage()); item.setData(ref); } }
Could you attach an example plug-in that shows the bug?
*** This bug has been marked as a duplicate of bug 207443 ***
Sorry, this is not quite the same. In 3.x the EditorReference would use the part title image if the part was instantiated, or the plugin.xml one if it was not. We only use the plugin.xml one, should check the part image if the part has been instantiated. PW
Review URL: https://git.eclipse.org/r/#/c/16719/
Submitted with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=011ecdadcea6ecd655939c906d404ab5f36658db
Verified in I20131028-2000.
*** Bug 421946 has been marked as a duplicate of this bug. ***
Ctrl+Shift+E is fine but Ctrl+E is still not fixed. 1. create a Java project 2. create a new file A.java in the project root folder ==> file opens. The icon in the editor tab and the 'Package Explorer' is a blue J with white inside the J. This differs from the normal Java editor icon which is a J with blue inside the J. 3. Ctrl+E ==> wrong icon is shown.
(In reply to Dani Megert from comment #8) > Ctrl+Shift+E is fine but Ctrl+E is still not fixed. It is already reported - bug 418908. It is a different part of code.