1 26 package org.objectweb.util.explorer.interpreter.lib.swt; 27 28 import java.io.IOException ; 29 import java.net.URL ; 30 31 import org.eclipse.swt.graphics.Image; 32 import org.objectweb.util.explorer.api.IconProvider; 33 import org.objectweb.util.trace.TraceSystem; 34 35 43 public class IconFileProvider 44 implements IconProvider 45 { 46 47 53 protected Image imageIcon_; 54 55 61 public IconFileProvider(String iconFile){ 62 imageIcon_ = new Image(null, iconFile); 63 } 64 65 public IconFileProvider(URL iconFile){ 66 try { 67 imageIcon_ = new Image(null, iconFile.openStream()); 68 } catch (IOException e) { 69 TraceSystem.get("explorer").warn("[" + getClass().getName() + "] IOException: " + e.getMessage()); 70 } 71 } 72 73 79 85 88 public Object newIcon(Object object) { 89 return imageIcon_; 90 } 91 92 } 93 | Popular Tags |