Bug 477393

Summary: Replace usage of ImageRegistry with LocalResourceManager in platform.ui
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Björn Arnelid <bjorn.arnelid>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: alex.blewitt, bjorn.arnelid, karsten.thoms, Lars.Vogel, ma.becker, mistria, simon.scholz, sxenos
Version: 4.5Keywords: bugday, helpwanted
Target Milestone: 4.8 M7   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/115871
https://git.eclipse.org/r/115872
https://git.eclipse.org/r/116046
https://git.eclipse.org/r/116045
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=682736e437bd8e52469e2bc67fa66aa8257e4847
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=730e5e415f3e02e113904431739652b88efba74a
https://git.eclipse.org/c/platform/eclipse.git/commit/?id=c3e4d65f779ec643b76d698ccfac77a0409714d7
https://git.eclipse.org/r/117551
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=268daee9d4995a41afebfc637e47722157132682
Whiteboard:
Bug Depends on:    
Bug Blocks: 477394    

Description Lars Vogel CLA 2015-09-14 14:27:18 EDT

    
Comment 1 Björn Arnelid CLA 2018-01-15 08:39:46 EST
Does this include removing ImageRegistry from public facing classes like AbstractUIPlugin?
Comment 2 Lars Vogel CLA 2018-01-15 08:40:43 EST
(In reply to Björn Arnelid from comment #1)
> Does this include removing ImageRegistry from public facing classes like
> AbstractUIPlugin?

No
Comment 3 Eclipse Genie CLA 2018-01-23 07:51:43 EST
New Gerrit change created: https://git.eclipse.org/r/115871
Comment 4 Eclipse Genie CLA 2018-01-23 07:51:48 EST
New Gerrit change created: https://git.eclipse.org/r/115872
Comment 5 Björn Arnelid CLA 2018-01-23 08:09:53 EST
ImageRegistry is publicly exposed in FieldDecoratingRegistry, DialogCellEditor and JFaceResources so these should probably be left as is. 

I think MarkerUtil is part of dead code, it should probably be removed all together?
Comment 6 Lars Vogel CLA 2018-01-23 08:46:58 EST
(In reply to Björn Arnelid from comment #5)
> I think MarkerUtil is part of dead code, it should probably be removed all
> together?

For deletion of dead code, please open a new bug. I quick looks indicates that org.eclipse.ui.views.tasklist.MarkerUtil and the classes referring to it are internal and not used. If that is true, they should be deleted.
Comment 7 Eclipse Genie CLA 2018-01-25 09:18:15 EST
New Gerrit change created: https://git.eclipse.org/r/116046
Comment 8 Eclipse Genie CLA 2018-01-25 09:18:19 EST
New Gerrit change created: https://git.eclipse.org/r/116045
Comment 11 Mickael Istria CLA 2018-02-01 09:01:13 EST
Can someone please enlighten me about what is the benefit of LocalResourceManager over ImageRegistry?
Comment 12 Björn Arnelid CLA 2018-02-01 09:18:02 EST
I am probably not the best person to answer this since im fairly new to contributing. 

But one benefit i see is that it is a bit smarter when it comes to disposing resources. Instead of disposing when Display is disposed it will dispose as soon as the owner control is disposed (given that no other control claims ownership of the resource as well).
Comment 13 Lars Vogel CLA 2018-02-01 09:20:13 EST
(In reply to Mickael Istria from comment #11)
> Can someone please enlighten me about what is the benefit of
> LocalResourceManager over ImageRegistry?

This would also reduce the need for activators. Activators can slow done the startup time of Eclipse. IMHO it is better to move as much as possible out of the activator.
Comment 15 Eclipse Genie CLA 2018-02-16 11:56:18 EST
New Gerrit change created: https://git.eclipse.org/r/117551
Comment 17 Karsten Thoms CLA 2018-02-23 00:34:54 EST
@Björn: Anything left here?
Comment 18 Björn Arnelid CLA 2018-02-23 06:15:18 EST
Yes, there is, ImageRegistry is fairly frequently used in platform.ui so there are a lot of places where it needs to be replaced. I will write a short comment here once i think everything is finished.
Comment 19 Lars Vogel CLA 2019-02-28 04:39:48 EST
Please open a new bug if you plan to continue to work on this.