Exchangeable Icons - extending Evn.getImageIcon()


First of all, we already did this for ADempiere and it works very well.
What we want to do is the following:
-Create a Table/Window for Icons. In this window, which is available for the System role, we simply have the name of the icon, a description and a binary file
-Extend to be able to load images from the database with fallback to the filesystem if nothing is found in the database. Then you could load an icon by calling Env.getImageIcon("mWindow", 24). This will return an ImageIcon object with the size 24*24 pixel. The icons themself are stored in .ico files which can hold the same image of different sizes (e. g. 16, 24, 32, 48, 64, 128, 256) or even different images for each size. For the Webui we will use Env.getRenderedImageIcon(String name, int iconSize) and it will return a RenderedImage object. RenderedImages can be assigned to zk components by calling comp.setImageContent(). A basic set of icons will be stored on the filesystem and if a customer wants branding he can easily overload icons via the Icon window
-Probably extend the Menu window so an icon can be assigned to an menu entry
-Probably extend to provide the same functionality for loading images
-Probably make the default icon size for tree or menu bar icons configurable via system configurator




Jan Thielemann
February 6, 2013, 3:29 PM

Because in our mind, images and icons are different. We would like to use the System Image window only for images. Images can have any size. The Icon window is only for icons which have always the same width/height. Also Images may have the filetype of png, gif or jpg but icons should always have the filetype ico and contain different sized images.

Jan Thielemann
February 6, 2013, 6:10 PM

Update: We will also provide a method which returns a list of images. This will be useful for windows and dialogs. Instead of setIconImage() you will be able to use setIconImages(). This way, e. g. you will see another icon in the windows top bar than when hitting alt+tab or than in the task bar (when using large icons in task bar).

Carlos Ruiz
October 15, 2014, 7:14 PM

Jan, can you please provide a comment about the reason of closing the ticket, or we can tag it as "Potential Idea" and then close it

Jan Thielemann
October 16, 2014, 6:23 AM

Feel free to tag it. I once implemented it in idempiere but it caused some problems in the webui because you have to load the icon files, get the image and then draw it so it can be displayed. It caused some lags and since we are now able to provide custom images via webui themes, i don't see advantages anymore.

However, i still would love to have the functionality to attach images to menu entries and configure the size of the images via system configurator

Carlos Ruiz
March 4, 2015, 4:23 PM

Labeled as Potential Idea




Jan Thielemann

Tested By



Affects versions