Skip to content

Add method for providing disabled image descriptors#4094

Open
HeikoKlare wants to merge 2 commits into
eclipse-platform:masterfrom
HeikoKlare:imagedescriptor-disabled
Open

Add method for providing disabled image descriptors#4094
HeikoKlare wants to merge 2 commits into
eclipse-platform:masterfrom
HeikoKlare:imagedescriptor-disabled

Conversation

@HeikoKlare

Copy link
Copy Markdown
Contributor

Image descriptors are often shared and used with a ResourceManager to share an image created from the same descriptor. To do this with the disabled version of the image of a descriptor, a descriptor for the disabled image has to be managed in addition to the descriptor for the ordinary image. This is what is also done in shared workbench images where an image descriptor for the original and the disabled image are managed independently.

This change adds a method to an image descriptor for providing a shared image descriptor for the disabled version of the same image. This allows to only manage the original image's descriptor while also sharing the disabled version of that image. The disabled image descriptor is created lazy upon first access.
It is applied as a replacement at all placed which used the createWithFlags() operation of an image descriptor for creating an image descriptor for the disabled version of the image to ensure that a shared image descriptor is used there.

As a further follow-up task, remaining usages of independently managed image descriptors for disabled image versions can be exchanged with usage of the new API.

This also contributes to:

Feedback

Like always, feedback is welcome, in particular since this will introduce new API at the ImageDescriptor class. In case you have other proposals for sharing the image descriptor for a disabled version of another image descriptor, please share it.

HeikoKlare and others added 2 commits June 13, 2026 16:55
Image descriptors are often shared and used with a ResourceManager to
share an image created from the same descriptor. To do this with the
disabled version of the image of a descriptor, a descriptor for the
disabled image has to be managed in addition to the descriptor for the
ordinary image.

This change adds a method to an image descriptor for providing a shared
image descriptor for the disabled version of the same image. This allows
to only manage the original image's descriptor while also sharing the
disabled version of that image.
It is applied as a replacement at all placed which used the
createWithFlags() operation of an image descriptor for creating an image
descriptor for the disabled version of the image to ensure that a shared
image descriptor is used there.
@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From ed1df5188fcc6f6c127e3cd70ee2e56ff68c6dcd Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Sat, 13 Jun 2026 15:12:27 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
index 7c3f352aad..5099c92416 100644
--- a/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.ide.application;singleton:=true
-Bundle-Version: 1.6.100.qualifier
+Bundle-Version: 1.6.200.qualifier
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.21.0,4.0.0)",
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   864 files  ±0     864 suites  ±0   55m 11s ⏱️ - 3m 43s
 8 050 tests ±0   7 807 ✅ +1  243 💤 ±0  0 ❌  - 1 
20 589 runs  ±0  19 934 ✅ +1  655 💤 ±0  0 ❌  - 1 

Results for commit b29299b. ± Comparison against base commit e314e02.

@HeikoKlare HeikoKlare marked this pull request as ready for review June 13, 2026 16:12
* @return a shared image descriptor for a disabled version of the icon for this
* descriptor.
*/
public ImageDescriptor getDisabledDescriptor() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there is no way to set it maybe it should be

Suggested change
public ImageDescriptor getDisabledDescriptor() {
public ImageDescriptor asDisabledDescriptor() {

Also one might want to check if this is already a disabled one and then return this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants