eclipse-platform / eclipse.platform.images

Eclipse Public License 2.0
11 stars 19 forks source link

Deploy the org.eclipse.images bundle to central #81

Open laeubi opened 3 months ago

laeubi commented 3 months ago

There was recently a discussion about images reuse currently we copy images from org.eclipse.images to the individual bundles (and others do as well).

If we would deploy the org.eclipse.images to central it could be

  1. reused by others
  2. even platform might ship it and use icons from there

This would then even allow one to exchange the icons of eclipse quite easy, as one can simply just swap out that single bundle with a custom one. If I write a own plugin and then add my icons as a fragment of org.eclipse.images, then this would even work for custom written plugins.

FYI @ruspl-afed

ruspl-afed commented 3 months ago

Thank you for letting me know @laeubi

Trick with fragment should work for simple cases, but I never tried it for more complex setups. For example, if we have an image coming from NLS fragment, will it be possible to replace this image from another fragment?

laeubi commented 3 months ago

Fragments can only enhance but not replace things, so if one want NLS support one needs to support NLS aware image path (like we already did for different zoom levels).

ruspl-afed commented 3 months ago

TBH I don't know if Eclipse Babel is ever going to supply NL images with its NL features. But let's imagine it does so, and we have org.eclipse.images bundle + org.eclipse.images.nls.something image fragment Will it be possible to customize an image with custom fragment in this case?

laeubi commented 3 months ago

The easiest would be to simply replace the image in either org.eclipse.images or org.eclipse.images.nls.something as these are just jar zip files, instead of nls I more thought about e.g.m2e shipping its icons in an org.eclipse.images.m2e fragment, so in code one can always use the url platform:/bundle:org.eclipse.images/some/shared/icon.png

Of course one could think of (and I used that in one of my products) that one first looks for the custom name and then for the common name, that then will allow easily to have some "iconpack" fragments, e.g assume we have the following icon URL used icon:/org.eclipse.images/icons/pde/plugin.png (note the initial icon prefix!).

The URL Stream handler for "icon" then can look at the org.eclipse.images bundle and first search an entry with /custom/pde/plugin.png if no such item exits, it looks for /pde/plugin.png entry, then such an icon can be overridden by providing a fragment that contains an icon in the folder /custom/pde/plugin.png ... one could even think about instead of using "custom" to have it using a "theme-id" instead that is a system property...