1 17 18 package org.objectweb.jac.aspects.gui.web; 19 20 import java.io.IOException ; 21 import java.io.PrintWriter ; 22 import javax.servlet.http.HttpServletResponse ; 23 import org.apache.log4j.Logger; 24 import org.objectweb.jac.aspects.gui.*; 25 26 29 public class Page extends AbstractPage implements WindowListener 30 { 31 static Logger loggerWeb = Logger.getLogger("gui.events"); 32 33 public Page(View view, boolean newWindow) { 34 super(view,newWindow); 35 } 36 37 39 public void genBody(PrintWriter out) throws IOException { 40 out.println("<div class=\""+type+"\">"); 41 if (description!=null) 42 out.println("<div class=\"description\">"+description+"</div>"); 43 openForm(out); 44 ((HTMLViewer)view).genHTML(out); 45 showFormButtons(out,false); 46 closeForm(out); 47 out.println("</div>"); 48 } 49 50 52 HttpServletResponse response; 53 JacRequest jacRequest; 54 55 public void onOK(JacRequest request) { 56 logger.debug(this+".onOK"); 57 WebDisplay display = (WebDisplay)context.getDisplay(); 58 try { 59 response = WebDisplay.getResponse(); 60 jacRequest = WebDisplay.getRequest(); 61 display.closeWindow(this,true); 62 } finally { 63 display.refresh(); 64 } 65 } 66 67 public void onRefresh(JacRequest request) { 68 logger.debug(this+".onRefresh"); 69 WebDisplay display = (WebDisplay)context.getDisplay(); 70 response = WebDisplay.getResponse(); 71 jacRequest = WebDisplay.getRequest(); 72 WebDisplay.readValuesAndRefresh(context,request,true); 73 } 74 75 public void onCancel() { 76 CustomizedDisplay display = (WebDisplay)context.getDisplay(); 81 display.closeWindow(this,false); 82 display.refresh(); 83 } 84 85 public void onValidate(JacRequest request) { 86 WebDisplay.readValues(context,request,true); 87 } 88 } 89 | Popular Tags |