home *** CD-ROM | disk | FTP | other *** search
Wrap
import java.awt.BorderLayout; import java.awt.CheckboxGroup; import java.awt.Container; import java.awt.Event; import java.awt.Label; import java.awt.Panel; import java.awt.TextField; public class SimplePrinting extends JDPClassLayout { JDPUser user; JDPJagg jaggSQL; JDPPopupMessage popuppanel; JDPMaskEdit JDPMaskEditMain; String moduleParameter; Panel Main; JDPButtons JDPButtons1; JDPScrollPanel ScrollPanel1; Label Label1; TextField TextField1; Label Label2; TextField TextField2; JDPEmailSender EMail1; JDPFormatDoc Formatter1; public void InitClass(JDPUser var1, Panel var2, String var3) { this.user = var1; this.moduleParameter = var3; this.jaggSQL = new JDPJagg(var1.jaggPath); ((Container)this).setLayout(new BorderLayout()); this.popuppanel = new JDPPopupMessage(var1, this); ((Container)this).add(this.popuppanel); this.JDPMaskEditMain = new JDPMaskEdit(); new CheckboxGroup(); this.Main = new Panel(); String[] var4 = new String[]{"Create Html", "Create Excel", "Send Email"}; int[] var5 = new int[]{JDPButton.getIconValue("New"), JDPButton.getIconValue("New"), JDPButton.getIconValue("Email")}; this.JDPButtons1 = new JDPButtons(var1, var4, var5, JDPButtons.getAlignmentValue("Horizontal")); this.ScrollPanel1 = new JDPScrollPanel(); this.Label1 = new Label("Name:", 0); this.TextField1 = new TextField("", 20); this.Label2 = new Label("Email:", 0); this.TextField2 = new TextField("", 20); this.EMail1 = new JDPEmailSender(var1); this.Formatter1 = new JDPFormatDoc(var1); this.Main.setLayout(new BorderLayout()); ((Container)this).add("Center", this.Main); this.Main.add("South", this.JDPButtons1); this.Main.add("Center", this.ScrollPanel1); this.ScrollPanel1.add("Left", this.Label1); this.ScrollPanel1.add("Right", this.TextField1); this.ScrollPanel1.add("Left", this.Label2); this.ScrollPanel1.add("Right", this.TextField2); this.InitComponents(); var1.gParm.addElement(this); } public boolean handleEvent(Event var1) { switch (var1.id) { case 503: case 504: case 505: this.popuppanel.postEvent(var1); return false; case 1001: if (var1.target.equals(this.JDPButtons1.button[0])) { this.Formatter1.initDocument(0); this.Formatter1.setTitle("My first html report"); this.Formatter1.setBody(""); this.Formatter1.addHeader("My First Report", "h2"); this.Formatter1.addComponent(this.ScrollPanel1); this.Formatter1.finishOutput(); this.Formatter1.loadDocument(); return true; } else if (var1.target.equals(this.JDPButtons1.button[1])) { this.Formatter1.initDocument(3); this.Formatter1.addComponent(this.ScrollPanel1); this.Formatter1.finishOutput(); this.Formatter1.loadDocument(); return true; } else { if (var1.target.equals(this.JDPButtons1.button[2])) { this.Formatter1.initDocument(2); this.Formatter1.addComponent(this.ScrollPanel1); this.Formatter1.finishOutput(); this.user.u.writeToFile(this.user.JDesignerPro.JDPDirectory + "temp" + JDesignerPro.serverSeparator + this.user.cust.getUsername() + ".txt", this.Formatter1.getFinishedDocument(), "w+"); this.EMail1.setMailServer("mail"); this.EMail1.setToAddress(this.TextField2.getText()); this.EMail1.setReturnAddress(this.TextField2.getText()); this.EMail1.setMessageSubject("Attached file example from JDesignerPro"); this.EMail1.setMessage("Hi " + this.TextField1.getText() + ",\n" + "This message was sent from JDesignerPro to demonstrate how to send an attachment created from the contents of a JDP screen.\n\n"); this.EMail1.setAttachment(this.user.JDesignerPro.JDPDirectory + "temp" + JDesignerPro.serverSeparator + this.user.cust.getUsername() + ".txt"); this.EMail1.sendSingleMessage(); return true; } return false; } default: return false; } } public void InitComponents() { } }