Community
Participate
Working Groups
After fixing the Bug 513034, Using the "org.eclipse.ui.genericeditor.icons" extension point the generic editor will support content specific icons on editor tabs. But, files on "Package Explorer" still shows the default icon. It should show the contributed icons based on content types.
Note that the Package Explorer is a JDT only view, so we should focus on Project Explorer which is generic. I think what you basically want is more a way to associate an icon with a content-type in general more than a way to associate an icon for the generic editor. From there, it would be possible to tweak the default content provider so that it reuses the content type icon instead of the associated editor icon in some cases. Since the Project Explorer is not aware of the Generic Editor, there is no easy way to reuse the generic editor extension in Project Explorer to build the icon. What seems requires is a way for an editor description to provide a getEditorIcon(IEditorInput) method (or a Function<IEditorInput, ImageDescriptor>) to dynamically resolve the icon. Such generic method should be defined in the editor APO, used inside the editor itself and could be used by the Project Explorer.
New Gerrit change created: https://git.eclipse.org/r/146904
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/146904 Mickael, Can you check this patch? These are the SS https://gyazo.com/9b96430051ea9386ba8e82c74efcb37c
(In reply to Lakshminarayana from comment #3) > (In reply to Eclipse Genie from comment #2) > > New Gerrit change created: https://git.eclipse.org/r/146904 > > Mickael, Can you check this patch? > > These are the SS > https://gyazo.com/9b96430051ea9386ba8e82c74efcb37c Screenshots look promising, good job!
Wow, great "hack", I never would have thought of leveraging the override for that! I'll have a more focused review on Monday but both screenshots and patch seem really cool.
Gerrit change https://git.eclipse.org/r/146904 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=607288719f0b9ee2a5a9383dc71663a83d1d9c07
Thanks a lot Lakshminarayana, that's a very good patch!
Thanks :)
This caused test fails on all platforms, see https://download.eclipse.org/eclipse/downloads/drops4/I20190805-1800/testresults/html/org.eclipse.ui.tests_ep413I-unit-cen64-gtk3-java11_linux.gtk.x86_64_11.html java.lang.NullPointerException at org.eclipse.ui.internal.genericeditor.GenericEditorAssociationOverride.overrideEditors(GenericEditorAssociationOverride.java:31) at org.eclipse.ui.ide.IDE.overrideEditorAssociations(IDE.java:927) at org.eclipse.ui.tests.ide.api.IDETest.testOverrideEditorAssociations(IDETest.java:42) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) Please also if you fix this, do following in addition: - add javadocs to GenericEditorDescriptor / GenericEditorAssociationOverride describing its purpose - search/replace defaultDescripter -> defaultDescriptor - extract "org.eclipse.ui.genericeditor.GenericEditor" to a constant somewhere in the bundle (I see it is already used in generic editor code as plain String)
Strange that the failure were not captured by Gerrit build... I'll investigate all that and appky the suggested imprvements later today.
New Gerrit change created: https://git.eclipse.org/r/147092
Gerrit change https://git.eclipse.org/r/147092 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=6e643fe1579edcd7f13e2828367b98dc5ca77abe
Patch was merged to fix the issue. Let's keep the ticket open and look at test results tomorrow before marking it as fixed.
Thanks all. Test is now green.