home *** CD-ROM | disk | FTP | other *** search
- import java.awt.BorderLayout;
- import java.awt.Container;
- import java.awt.Dialog;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Label;
- import java.awt.Panel;
- import java.awt.TextArea;
- import java.awt.TextField;
- import java.util.Vector;
-
- public class JDPSupportApp extends JDPClassLayout {
- JDPUser user;
- JDPJagg jaggSQL;
- JDPPopupMessage popuppanel;
- JDPMaskEdit JDPMaskEditMain;
- String moduleParameter;
- Panel Main;
- JDPEmailSender EMail1;
- JDPChiselFramePanel ChiselPanel1;
- JDPTabSelectPanel TabPanel1;
- Panel Panel1;
- JDPScrollPanel ScrollPanel2;
- Label Label9;
- TextField fromAddress;
- Label Label3;
- TextField subject;
- Label Label2;
- TextField firstName;
- Label Label5;
- TextField lastName;
- Label Label4;
- TextField mailServer;
- Label Label6;
- Panel Panel3;
- TextField attachment;
- JDPButton JDPButton1;
- Panel Panel2;
- Label Label1;
- TextArea messageText;
- JDPButtons JDPButtons1;
- JDPBrowser HTMLPanel1;
-
- public void InitClass(JDPUser var1, Panel var2, String var3) {
- this.user = var1;
- this.moduleParameter = var3;
- super.targetPanel = var2;
- 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();
- this.Main = new Panel();
- this.EMail1 = new JDPEmailSender(var1);
- this.ChiselPanel1 = new JDPChiselFramePanel(var1, "BulletProof Customer Support");
- String[] var4 = new String[2];
- Panel[] var5 = new Panel[]{new Panel(), null};
- var5[0].setLayout(new BorderLayout());
- var4[0] = "Send a message to Customer Support";
- var5[1] = new Panel();
- var5[1].setLayout(new BorderLayout());
- var4[1] = "Win JDesignerPro valued at $1200";
- this.TabPanel1 = new JDPTabSelectPanel(var1, var4, var5, "North");
- this.Panel1 = new Panel();
- this.ScrollPanel2 = new JDPScrollPanel();
- this.Label9 = new Label("Enter your email address:", 0);
- this.fromAddress = new TextField(String.valueOf(var1.cust.getEmailaddr()), 30);
- this.Label3 = new Label("Subject of your question:", 0);
- this.subject = new TextField("", 30);
- this.Label2 = new Label("Your First name:", 0);
- this.firstName = new TextField(String.valueOf(var1.cust.getFirstname()), 30);
- this.Label5 = new Label("Your Last name:", 0);
- this.lastName = new TextField(String.valueOf(var1.cust.getLastname()), 30);
- this.Label4 = new Label("Enter your mailserver (only if send fails):", 0);
- this.mailServer = new TextField("mail", 30);
- this.Label6 = new Label("Attach file:", 0);
- this.Panel3 = new Panel();
- this.attachment = new TextField("", 30);
- this.JDPButton1 = new JDPButton(JDPButton.getIconValue("New"), "Attach", JDPButton.getAlignmentValue("Center"));
- this.Panel2 = new Panel();
- this.Label1 = new Label("Enter the details of your question. The Java console and your system specifics are automatically added to this message:", 0);
- this.messageText = new TextArea("", 6, 31);
- String[] var6 = new String[]{"Send"};
- int[] var7 = new int[]{JDPButton.getIconValue("Email")};
- this.JDPButtons1 = new JDPButtons(var1, var6, var7, JDPButtons.getAlignmentValue("Horizontal"));
- this.HTMLPanel1 = new JDPBrowser();
- this.HTMLPanel1.InitClass(var1, var2, "Docs/jdpwin.htm");
- this.Main.setLayout(new BorderLayout());
- ((Container)this).add("Center", this.Main);
- this.Main.add("Center", this.ChiselPanel1);
- this.ChiselPanel1.add("Center", this.TabPanel1);
- var5[0].add("Center", this.Panel1);
- this.Panel1.setLayout(new BorderLayout());
- this.Panel1.add("North", this.ScrollPanel2);
- this.ScrollPanel2.add("Left", this.Label9);
- this.ScrollPanel2.add("Right", this.fromAddress);
- this.ScrollPanel2.add("Left", this.Label3);
- this.ScrollPanel2.add("Right", this.subject);
- this.ScrollPanel2.add("Left", this.Label2);
- this.ScrollPanel2.add("Right", this.firstName);
- this.ScrollPanel2.add("Left", this.Label5);
- this.ScrollPanel2.add("Right", this.lastName);
- this.ScrollPanel2.add("Left", this.Label4);
- this.ScrollPanel2.add("Right", this.mailServer);
- this.ScrollPanel2.add("Left", this.Label6);
- this.ScrollPanel2.add("Right", this.Panel3);
- this.Panel3.setLayout(new JDPLineLayout());
- this.Panel3.add("Left", this.attachment);
- this.Panel3.add("Left", this.JDPButton1);
- this.Panel1.add("Center", this.Panel2);
- this.Panel2.setLayout(new BorderLayout());
- this.Panel2.add("North", this.Label1);
- this.Panel2.add("Center", this.messageText);
- this.Panel1.add("South", this.JDPButtons1);
- var5[1].add("Center", this.HTMLPanel1);
- this.ChiselPanel1.setFont(new Font("Helvetica", 0, 11));
- this.ChiselPanel1.setForeground(var1.u._cvtcolor("Black"));
- this.ChiselPanel1.setBackground(var1.u._cvtcolor("LightGray"));
- this.TabPanel1.setTabcolor(0, var1.u._cvtcolor("Black"), var1.u._cvtcolor("LightGray"));
- this.TabPanel1.setTabcolor(1, var1.u._cvtcolor("Black"), var1.u._cvtcolor("LightGray"));
- this.Label9.setFont(new Font("Helvetica", 1, 11));
- this.Label9.setForeground(var1.u._cvtcolor("Black"));
- this.Label9.setBackground(var1.u._cvtcolor("LightGray"));
- this.fromAddress.setFont(new Font("Helvetica", 0, 11));
- this.fromAddress.setForeground(var1.u._cvtcolor("Black"));
- this.fromAddress.setBackground(var1.u._cvtcolor("White"));
- this.Label3.setFont(new Font("Helvetica", 1, 11));
- this.Label3.setForeground(var1.u._cvtcolor("Black"));
- this.Label3.setBackground(var1.u._cvtcolor("LightGray"));
- this.subject.setFont(new Font("Helvetica", 0, 11));
- this.subject.setForeground(var1.u._cvtcolor("Black"));
- this.subject.setBackground(var1.u._cvtcolor("White"));
- this.Label2.setFont(new Font("Helvetica", 1, 11));
- this.Label2.setForeground(var1.u._cvtcolor("Black"));
- this.Label2.setBackground(var1.u._cvtcolor("LightGray"));
- this.firstName.setFont(new Font("Helvetica", 0, 11));
- this.firstName.setForeground(var1.u._cvtcolor("Black"));
- this.firstName.setBackground(var1.u._cvtcolor("White"));
- this.Label5.setFont(new Font("Helvetica", 1, 11));
- this.Label5.setForeground(var1.u._cvtcolor("Black"));
- this.Label5.setBackground(var1.u._cvtcolor("LightGray"));
- this.lastName.setFont(new Font("Helvetica", 0, 11));
- this.lastName.setForeground(var1.u._cvtcolor("Black"));
- this.lastName.setBackground(var1.u._cvtcolor("White"));
- this.Label4.setFont(new Font("Helvetica", 1, 11));
- this.Label4.setForeground(var1.u._cvtcolor("Black"));
- this.Label4.setBackground(var1.u._cvtcolor("LightGray"));
- this.mailServer.setFont(new Font("Helvetica", 0, 11));
- this.mailServer.setForeground(var1.u._cvtcolor("Black"));
- this.mailServer.setBackground(var1.u._cvtcolor("White"));
- this.Label6.setFont(new Font("Helvetica", 1, 11));
- this.Label6.setForeground(var1.u._cvtcolor("Black"));
- this.Label6.setBackground(var1.u._cvtcolor("LightGray"));
- this.Panel3.setFont(new Font("Helvetica", 0, 11));
- this.Panel3.setForeground(var1.u._cvtcolor("Black"));
- this.Panel3.setBackground(var1.u._cvtcolor("LightGray"));
- this.attachment.setBackground(var1.u._cvtcolor("White"));
- this.Panel2.setFont(new Font("Helvetica", 0, 11));
- this.Panel2.setForeground(var1.u._cvtcolor("Black"));
- this.Panel2.setBackground(var1.u._cvtcolor("LightGray"));
- this.JDPButtons1.setFont(new Font("Helvetica", 0, 11));
- this.JDPButtons1.setForeground(var1.u._cvtcolor("Black"));
- this.JDPButtons1.setBackground(var1.u._cvtcolor("LightGray"));
- this.HTMLPanel1.setFont(new Font("TimesRoman", 0, 14));
- var1.gParm.addElement(this);
- this.InitComponents();
- }
-
- public boolean handleEvent(Event var1) {
- switch (var1.id) {
- case 401:
- if (var1.key == 9 && var1.modifiers != 1) {
- if (var1.target.equals(this.fromAddress)) {
- this.user.u.cursor(this.subject);
- }
-
- if (var1.target.equals(this.subject)) {
- this.user.u.cursor(this.firstName);
- }
-
- if (var1.target.equals(this.firstName)) {
- this.user.u.cursor(this.lastName);
- }
-
- if (var1.target.equals(this.lastName)) {
- this.user.u.cursor(this.mailServer);
- }
-
- if (var1.target.equals(this.mailServer)) {
- this.user.u.cursor(this.messageText);
- }
-
- if (var1.target.equals(this.messageText)) {
- this.user.u.cursor(this.fromAddress);
- }
- }
-
- if (var1.key == 9 && var1.modifiers == 1) {
- if (var1.target.equals(this.fromAddress)) {
- this.user.u.cursor(this.messageText);
- return true;
- }
-
- if (var1.target.equals(this.subject)) {
- this.user.u.cursor(this.fromAddress);
- return true;
- }
-
- if (var1.target.equals(this.firstName)) {
- this.user.u.cursor(this.subject);
- return true;
- }
-
- if (var1.target.equals(this.lastName)) {
- this.user.u.cursor(this.firstName);
- return true;
- }
-
- if (var1.target.equals(this.mailServer)) {
- this.user.u.cursor(this.lastName);
- return true;
- }
-
- if (var1.target.equals(this.messageText)) {
- this.user.u.cursor(this.mailServer);
- return true;
- }
- }
-
- return false;
- case 503:
- case 504:
- case 505:
- this.popuppanel.postEvent(var1);
- return false;
- case 1001:
- if (var1.target.equals(this.JDPButton1)) {
- JDPFileDialog var16 = new JDPFileDialog(this.user, this.user.jdpMainWindow, "Select the file to attach");
- JDPFilePicker var3 = var16.getFilePicker();
- var3.setMode(0);
- var3.setMultipleSelections(false);
- var3.loadFiles(this.user.JDesignerPro.JDPDirectory + JDesignerPro.serverSeparator + "Applications", false);
- ((Dialog)var16).show();
- this.attachment.setText(var3.getSelectedFullPath());
- return true;
- } else {
- if (var1.target.equals(this.JDPButtons1.button[0])) {
- this.EMail1.setMailServer(this.mailServer.getText());
- this.EMail1.setToAddress("support@bulletproof.com");
- this.EMail1.setMessageSubject(this.subject.getText());
- this.EMail1.setReturnAddress(this.fromAddress.getText());
- if (!this.user.u.ischaracter(this.fromAddress, this.user.mainmsg)) {
- return true;
- }
-
- if (!this.user.u.ischaracter(this.subject, this.user.mainmsg)) {
- return true;
- }
-
- if (!this.user.u.ischaracter(this.firstName, this.user.mainmsg)) {
- return true;
- }
-
- if (!this.user.u.ischaracter(this.lastName, this.user.mainmsg)) {
- return true;
- }
-
- String var2 = "Firstname:" + this.firstName.getText() + "\n";
- var2 = var2 + "Lastname:" + this.lastName.getText() + "\n";
- var2 = var2 + "Email:" + this.fromAddress.getText() + "\n";
- var2 = var2 + "JDPVersion:" + JDesignerPro.actualversion + "\n";
- var2 = var2 + "Vendor:" + System.getProperty("java.vendor") + "\n";
- var2 = var2 + "Version:" + System.getProperty("java.version") + "\n";
- var2 = var2 + "OS Name:" + System.getProperty("os.name") + "\n";
- var2 = var2 + "OS Version:" + System.getProperty("os.version") + "\n";
- var2 = var2 + "Domain:" + this.user.getJDPDomain() + "\n";
- var2 = var2 + "\n";
- var2 = var2 + this.messageText.getText();
- var2 = var2 + "\n\n";
- var2 = var2 + "Console:\n" + this.user.JDesignerPro.consoleDialog.consoleOutput.getText() + "\n";
- this.EMail1.setMessage(var2);
- this.EMail1.setAttachment(this.attachment.getText());
- this.EMail1.sendSingleMessage();
- this.updateJDPUserTable();
- return true;
- }
-
- return false;
- }
- default:
- return false;
- }
- }
-
- public void InitComponents() {
- if (this.firstName.getText().equals("Admin")) {
- this.firstName.setText("");
- }
-
- if (this.lastName.getText().equals("Account")) {
- this.lastName.setText("");
- }
-
- if (!JDesignerPro.executable) {
- this.Label1.setText("Enter the details of your question:");
- }
-
- }
-
- public void updateJDPUserTable() {
- if ((this.user.cust.getFirstname().equals("") || this.user.cust.getFirstname().equals("Admin") || this.user.cust.getLastname().equals("") || this.user.cust.getLastname().equals("Account") || this.user.cust.getEmailaddr().equals("")) && !this.user.cust.username.toLowerCase().equals("guest")) {
- String var1 = "UPDATE JDPUser SET firstname = '" + this.firstName.getText() + "'," + "lastname = '" + this.lastName.getText() + "', " + "emailaddr = '" + this.fromAddress.getText() + "' " + "WHERE userid = " + this.user.cust.suserid;
- Vector var2 = new Vector();
- this.user.jaggSQL.execSQL(var1, var2);
- }
-
- }
- }
-