Bug 506132 - Some easy API to create overlay image descriptors
Summary: Some easy API to create overlay image descriptors
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.7 M4   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2016-10-18 05:01 EDT by Mickael Istria CLA
Modified: 2020-05-21 23:22 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2016-10-18 05:01:00 EDT
Platform/UI is missing a convenient way to create an ImageDescriptor from another ImageDescriptor adding it an overlay.
That's a frequently useful operation. Several other projects such as EGit have implemented such API.
Comment 2 Mickael Istria CLA 2016-11-23 11:59:19 EST
Added a noteworthy here as several other projects have similar classes to do that. They could drop their code and consume this class instead.
Comment 3 Eclipse Genie CLA 2016-11-23 12:23:32 EST
New Gerrit change created: https://git.eclipse.org/r/85613
Comment 5 Dani Megert CLA 2016-11-24 05:59:23 EST
DecorationOverlayIconTest fails at least on Mac and Windows, e.g.

http://download.eclipse.org/eclipse/downloads/drops4/I20161123-2000/testresults/html/org.eclipse.ui.tests_ep47I-unit-win32_win32.win32.x86_8.0.html

Workbench has not been created yet.

java.lang.IllegalStateException: Workbench has not been created yet.
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:93)
at org.eclipse.jface.tests.images.DecorationOverlayIconTest.setUp(DecorationOverlayIconTest.java:41)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:754)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:351)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:37)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:33)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 6 Andrey Loskutov CLA 2016-11-24 07:51:13 EST
(In reply to Dani Megert from comment #5)
> DecorationOverlayIconTest fails at least on Mac and Windows

It fails on *all* 4 platforms. 

Do we run tests *differently* on SDK builds compared to Gerrit? Is this again some obscure maven thing?

The test was fine in Gerrit: https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/11254/testReport/org.eclipse.jface.tests.images/DecorationOverlayIconTest/
Comment 7 Mickael Istria CLA 2016-11-24 08:08:55 EST
(In reply to Andrey Loskutov from comment #6)
> Do we run tests *differently* on SDK builds compared to Gerrit? Is this
> again some obscure maven thing?

Yes, tests are started differently -some with Ant against a full IDE, the other with Surefire with minimal dependency set-, and this is not really something we can change easily. However, there may be a way to tweak the configuration of Surefire tests to make it closer from Ant-based one.
None of the tests in org.eclipse.ui.tests does have a workbench as pre-requisite?
Comment 8 Eclipse Genie CLA 2016-11-24 09:07:12 EST
New Gerrit change created: https://git.eclipse.org/r/85695
Comment 9 Eclipse Genie CLA 2016-11-24 09:07:13 EST
New Gerrit change created: https://git.eclipse.org/r/85695
Comment 11 Mickael Istria CLA 2016-11-29 04:28:07 EST
Test should now be fixed to also run without a workbench.
Comment 12 Markus Keller CLA 2016-11-29 10:06:38 EST
Using Objects.equals(referenceImageOrDescriptor, ...) in DecorationOverlayIcon#equals(Object) was unnecessary and is potentially harmful, since it gives a wrong impression, and it can avoid early detection of a base image that is illegally null.

Please do not touch the image descriptors in master. I'm working on a big change for bug 495782 and will include that fix there.