1 17 18 package org.objectweb.jac.aspects.gui.web; 19 20 import java.io.PrintWriter ; 21 import org.objectweb.jac.aspects.gui.*; 22 import org.objectweb.jac.core.rtti.FieldItem; 23 import org.objectweb.jac.util.ExtBoolean; 24 25 28 29 public class BooleanEditor extends AbstractFieldEditor 30 implements FieldEditor, HTMLEditor 31 { 32 35 36 public BooleanEditor(Object substance, FieldItem field) { 37 super(substance,field); 38 } 39 40 42 public void genHTML(PrintWriter out) { 43 out.println("<input type=checkbox name=\""+label+"\" "+ 44 "value=\"true\""+ 45 (((Boolean )value).booleanValue()?" checked":"")); 46 printAttributes(out); 47 out.println(">"); 48 } 49 50 protected boolean doReadValue(Object parameter) { 51 setValue(ExtBoolean.valueOf(parameter==null?false:true)); 52 return true; 53 } 54 } 55 | Popular Tags |