DESCRIPTION

Bug 409332 - Image/Icon information returned by EditorReference
implementation is inconsistent with the IEditorPart implementation

Change-Id: Ib47ac90b3d4fcd899de62ff21195780aa920367c
Signed-off-by: Amiyah Parrish xxx@xxx.xxx


COMMENTS

author: Amiyah Parrish
date: 2013-10-08 11:59:13.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-10-08 11:59:18.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/92/

-------------------------------------
author: Amiyah Parrish
date: 2013-10-08 12:08:42.000000000

Patch Set 3:

The latest patch contains a new fix proposition. The editor switcher was tested in 3 scenarios:
1. Run "clean" instance of eclipse and open several editors (including custom editor)
2. Run eclipse instance with custom editor open but not active (not on top)
3. Run eclipse instance with custom editor open and active (on top)

This patch does not fix the editor drop-down problem (Ctrl + E) because it is separate code. I have opened a new bug for it - https://bugs.eclipse.org/bugs/show_bug.cgi?id=418908 .

-------------------------------------
author: Brenden Conley
date: 2013-10-08 12:09:52.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/92/ : SUCCESS

-------------------------------------
author: Sebastian Porter
date: 2013-10-08 13:18:31.000000000

Patch Set 3: Verified-1 Code-Review-2

The fix looks wrong since the title (image) of the part is already correct, so no need to set it again. It also doesn't work for me i.e. when I use Ctrl+F6 I still see the wrong image.

-------------------------------------
author: Amiyah Parrish
date: 2013-10-08 13:24:32.000000000

Patch Set 3:

Hi Dani,
Could you attach a sample plugin that does not work with this patch?

-------------------------------------
author: Sebastian Porter
date: 2013-10-08 13:29:49.000000000

Patch Set 3:

1. create a Java project (with 'src' as source folder)
2. add Foo.java to the project as sibling to 'src'
   ==> the file opens in the editor with a different 
3. Ctrl+F6
   ==> BUG: wrong icon

-------------------------------------
author: Amiyah Parrish
date: 2013-10-08 14:01:55.000000000

Patch Set 3:

Thanks. I was not aware that this bug occurs also in such scenario. I will try to fix it.
BTW. I am not sure I understand your previous comment:
"The fix looks wrong since the title (image) of the part is already correct, so no need to set it again."
The code I added is invoked only when the title (including icon) of the related EditorPart changed. This is the cleanest way (at least I don't see any cleaner) to notify the related EditorReference that it should reload the icon it holds. That was the main problem of the bug, that the icon kept by EditorRefenrence was obsolete. Am I wrong?

-------------------------------------
author: Sebastian Porter
date: 2013-10-08 14:05:53.000000000

Patch Set 3:

I see your point but the problem with your fix is that it does not work ;-).

I suspect that the listener you use, is not yet registered when the editor is opened and hence the image is not updated.

-------------------------------------
author: Amiyah Parrish
date: 2013-10-08 14:24:38.000000000

Patch Set 3:

It fixes several other scenarios :) Your scenario is slightly different. I had partial fixes by refreshing the icon in different places (e.g. in getPart()) but I did not manage to make them working in all scenarios I tested. Finally I decided to use the notification mechanism. Maybe combination of both approaches is necessary. Anyway I am debugging your scenario now. I'm receptive to any advice/suggestions.

-------------------------------------
author: Sebastian Porter
date: 2013-10-08 15:30:53.000000000

Patch Set 3:

As said, I suspect you need to make sure that the property listener is installed earlier, so that it gets notified when the part changes the title during creation.

-------------------------------------
