Getting Work Item Icons
I've been working on a plugin for the Jazz 2.0 client and I wanted to show the icon associated with a work item (based on its type). Based on some of the other posts in this forum, I put together this piece of code to put a work item into a Table inside of a UIJob:
@Override However, this code tends to be pretty slow. It's making a call to the server every time it needs this icon. So as a workaround for the performance hit, I'm caching the icons in a global hash table after that first call - doesn't seem like a good permanent solution, though. I'm wondering, is there a faster way to get icons? Maybe a global icon registry on the client or something? |
One answer
However, this code tends to be pretty slow. It's making a call to the Your code doesn't seem to go to the server on every call as there is some caching involved on lower levels. But you are right that creating the image every time is not efficient. This is what we use in our code: resourceManager= new LocalResourceManager(JFaceResources.getResources(), table); .... imageDescriptor= WorkItemUI.getImageDescriptor(type.getIconURL()); image= JazzResources.getImageWithDefault(resourceManager, imageDescriptor) Images will be managed by the resource manager, which takes care of reuse/dispose. You could attach it to your table, so all image resources will be disposed when the table is disposed. -- Regards, Patrick Jazz Work Item Team |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.