1 11 package org.eclipse.team.internal.ccvs.ui; 12 13 import java.util.HashMap ; 14 import java.util.Iterator ; 15 import java.util.Map ; 16 17 import org.eclipse.swt.graphics.Image; 18 import org.eclipse.team.internal.ui.*; 19 20 23 public class OverlayIconCache { 24 private Map cache = new HashMap (); 25 26 31 public Image getImageFor(OverlayIcon icon) { 32 Image image = (Image) cache.get(icon); 33 if (image == null) { 34 image = icon.createImage(); 35 cache.put(icon, image); 36 } 37 return image; 38 } 39 40 43 public void disposeAll() { 44 for (Iterator it = cache.values().iterator(); it.hasNext();) { 45 Image image = (Image) it.next(); 46 image.dispose(); 47 } 48 cache.clear(); 49 } 50 } 51 | Popular Tags |