1 11 package org.eclipse.jdt.internal.ui.viewsupport; 12 13 import org.eclipse.core.runtime.Assert; 14 15 import org.eclipse.swt.events.DisposeEvent; 16 import org.eclipse.swt.events.DisposeListener; 17 import org.eclipse.swt.graphics.Image; 18 19 20 24 public class ImageDisposer implements DisposeListener { 25 26 private Image[] fImages; 27 28 public ImageDisposer(Image image) { 29 this(new Image[] { image }); 30 } 31 32 public ImageDisposer(Image[] images) { 33 Assert.isNotNull(images); 34 fImages= images; 35 } 36 37 40 public void widgetDisposed(DisposeEvent e) { 41 if (fImages != null) { 42 for (int i= 0; i < fImages.length; i++) { 43 fImages[i].dispose(); 44 } 45 } 46 } 47 } 48 | Popular Tags |