new ImageManager - please use

John Mazzitelli mazz at redhat.com
Mon Nov 29 19:22:03 UTC 2010


In an effort to "clean up" the usage of the icons (that is, make sure we 
use the new icons in coregui images/ and move away from portal war 
images), there is a new  ImageManager, which is analogous to the 
LinkManager, except ImageManager gets you the links to the icon images. 
For example, if you ever need the green/red availability icon, use:

ImageManager.getAvailabilityIcon(Boolean) (or one of its derivatives).

As you go through the code, if you see image/icon URLs hardcoded, 
consider refactoring it to use the an ImageManager method (create one if 
it doesn't have it).

This will be especially useful if/when we remove portal war because lots 
of its images are still being referenced. If we use ImageManager, we can 
a) ensure it only uses coregui icons and b) if it DOES use portal war 
icons, its just a matter of adding the icon image to coregui and 
changing the one or couple lines of code in the single class 
ImageManager, rather than hunting down all the places we referenced the 
image in the coregui client code.

I already refactored the avail icon usage that I could find. In 
addition, the group view now actually shows the proper 
green/red/yellow/grey group icons in the title area, using this new 
ImageManager.


More information about the rhq-devel mailing list