1 17 18 package org.objectweb.jac.aspects.gui.web; 19 20 import org.objectweb.jac.core.rtti.FieldItem; 21 import java.io.PrintWriter ; 22 import java.net.URL ; 23 24 25 public class ImageURLViewer extends AbstractFieldView 26 implements HTMLViewer 27 { 28 URL value; 29 boolean small; 30 31 public ImageURLViewer(Object value, Object substance, FieldItem field) { 32 super(substance,field); 33 small = false; 34 setValue(value); 35 } 36 37 public ImageURLViewer() { 38 small=true; 39 } 40 41 public void setValue(Object value) { 42 this.value = (URL )value; 43 } 44 45 public void genHTML(PrintWriter out) { 46 if (value!=null) { 47 if (small) { 48 out.print("<img SRC=\""+value.toString()+ 49 "\" width=50 height=50 alt=\"\">"); 50 } else { 51 out.print("<img SRC=\""+value.toString()+"\" alt=\"\">"); 52 } 53 } 54 } 55 } 56 | Popular Tags |