home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / JDesignerPro / Jdp3_0.exe / data1.cab / Program_Files / JDPProjectMgr.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-09  |  15.0 KB  |  668 lines

  1. import java.awt.BorderLayout;
  2. import java.awt.Choice;
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Event;
  7. import java.awt.Label;
  8. import java.awt.Panel;
  9. import java.awt.TextArea;
  10. import java.awt.TextField;
  11. import java.util.Date;
  12. import java.util.StringTokenizer;
  13. import java.util.Vector;
  14.  
  15. public class JDPProjectMgr extends JDPClassLayout implements Runnable {
  16.    JDPJagg jaggSQL;
  17.    JDPWhereClause jdpWhereClause;
  18.    JDPSearchResults searchResults;
  19.    JDPPopupMessage popuppanel;
  20.    JDPPopupMenu popup;
  21.    JDPTreeBranch popupMain;
  22.    JDPTreeBranch popupFile;
  23.    JDPSelectDSN targetDSN;
  24.    Vector eventVector;
  25.    String[] psortChoice;
  26.    String[] pdisplayChoice;
  27.    int itemIndex;
  28.    boolean insertRequested;
  29.    boolean copyRequested;
  30.    boolean deleteRequested;
  31.    String pfromWhereClause;
  32.    String projectType;
  33.    String appDir;
  34.    TextField ClassName;
  35.    TextField ClassDesc;
  36.    TextField owner;
  37.    TextField lastmod;
  38.    Choice Status;
  39.    Vector valueStatus;
  40.    TextArea notes;
  41.    JDPButtons btns;
  42.  
  43.    boolean createPopupMenus() {
  44.       String[] var10000 = new String[1];
  45.       this.popup.addEntry("New Project...");
  46.       this.popup.addEntry("");
  47.       this.popup.addEntry("Refresh");
  48.       this.popupMain = this.popup.getMenuTree();
  49.       this.popup.clear();
  50.       this.popup.addEntry("New Project...");
  51.       this.popup.addEntry("Edit Project...");
  52.       this.popup.addEntry("Copy Project...");
  53.       this.popup.addEntry("Remove Project...");
  54.       this.popup.addEntry("");
  55.       this.popup.addEntry("Refresh");
  56.       this.popupFile = this.popup.getMenuTree();
  57.       return true;
  58.    }
  59.  
  60.    void loadChoices() {
  61.       this.valueStatus = new Vector();
  62.       this.Status.addItem("In Progress");
  63.       this.valueStatus.addElement("P");
  64.       this.Status.addItem("Active");
  65.       this.valueStatus.addElement("A");
  66.       this.Status.addItem("Inactive");
  67.       this.valueStatus.addElement("I");
  68.    }
  69.  
  70.    void saveProject() {
  71.       super.user.saveProperties.save(this.appDir + this.ClassName.getText() + ".jdp");
  72.       if (this.insertRequested) {
  73.          this.saveData();
  74.          this.newSearch();
  75.       } else {
  76.          this.saveData();
  77.       }
  78.  
  79.       this.selectProject();
  80.    }
  81.  
  82.    void selectProject() {
  83.       String[] var1 = new String[]{super.user.JDPSystemDesc, super.user.cust.username, this.ClassName.getText()};
  84.       this.searchResults.tree.select(var1, 3);
  85.    }
  86.  
  87.    void newSearch() {
  88.       String var1 = this.pfromWhereClause;
  89.       if (this.jdpWhereClause != null) {
  90.          var1 = var1 + " AND " + this.jdpWhereClause.whereClause;
  91.       }
  92.  
  93.       this.searchResults.setFromWhereClause(var1);
  94.       this.searchResults.clearList(super.user.JDesignerPro.JDPSystemDesc);
  95.       this.searchResults.loadList();
  96.       if (this.searchResults.treeRoot.leaves.size() > 0) {
  97.          JDPTreeBranch var2 = (JDPTreeBranch)this.searchResults.treeRoot.leaves.elementAt(0);
  98.          var2.expanded = true;
  99.       }
  100.  
  101.    }
  102.  
  103.    void clearFields() {
  104.       this.ClassName.setText("");
  105.       this.ClassDesc.setText("");
  106.       this.Status.select(0);
  107.       Date var1 = new Date();
  108.       this.lastmod.setText(var1.toLocaleString());
  109.       this.owner.setText(super.user.cust.username);
  110.       this.notes.setText("");
  111.    }
  112.  
  113.    void loadData() {
  114.       JDPJagg var2 = new JDPJagg(super.user.jaggPath);
  115.       var2.setNULL("space");
  116.       var2.setMRW("1000");
  117.       var2.loadSettings(super.user);
  118.       int var3 = 0;
  119.       Vector var4 = new Vector();
  120.       String var5 = var2.getSEP();
  121.       if ((this.itemIndex = this.searchResults.getSelectedIndex()) < 0) {
  122.          this.clearFields();
  123.       } else {
  124.          String var8 = "SELECT ClassName," + "ClassDesc," + "Status," + "lastmod," + "owner," + "notes" + " FROM JDPClassDef" + " WHERE projtype = '" + this.projectType + "' AND JDPSystem='" + this.searchResults.recordKey0[this.itemIndex] + "'" + " AND ClassName='" + this.searchResults.recordKey1[this.itemIndex] + "'";
  125.          super.user.mainmsg.setStatusMsg("Accessing database...", 0);
  126.          var3 = var2.execSQL(var8, var4);
  127.          if (var3 == -1) {
  128.             super.user.u.setSqlMessage(var2, var8);
  129.          } else if (var3 >= 1) {
  130.             String var6 = (String)var4.elementAt(0);
  131.             if (var6 != null && var6.trim().compareTo("") != 0) {
  132.                StringTokenizer var1 = new StringTokenizer(var6);
  133.                this.ClassName.setText(var1.nextToken(var5).trim());
  134.                this.ClassDesc.setText(var1.nextToken(var5).trim());
  135.                String var7 = var1.nextToken(var5).trim();
  136.                if (this.valueStatus.indexOf(var7) >= 0) {
  137.                   this.Status.select(this.valueStatus.indexOf(var7));
  138.                }
  139.  
  140.                this.lastmod.setText(var1.nextToken(var5).trim());
  141.                this.owner.setText(var1.nextToken(var5).trim());
  142.                this.notes.setText(var1.nextToken(var5).trim());
  143.             }
  144.  
  145.             if (var3 > 1) {
  146.                super.user.mainmsg.setStatusMsg("Multiple records found - first match only displayed.", 10);
  147.             } else {
  148.                super.user.mainmsg.clearStatusMsg();
  149.             }
  150.          } else {
  151.             super.user.mainmsg.setStatusMsg("Requested entry does not exist.", 10);
  152.             this.clearFields();
  153.          }
  154.       }
  155.    }
  156.  
  157.    boolean saveData() {
  158.       JDPJagg var1 = new JDPJagg(super.user.jaggPath);
  159.       var1.setNULL("space");
  160.       var1.setMRW("1000");
  161.       var1.loadSettings(super.user);
  162.       int var2 = 0;
  163.       Vector var3 = new Vector();
  164.       var1.getSEP();
  165.       String var4 = "";
  166.       Date var5 = new Date();
  167.       this.lastmod.setText(var5.toLocaleString());
  168.       if (this.insertRequested) {
  169.          var4 = "SELECT * FROM JDPClassDef " + " WHERE JDPSystem='" + super.user.JDPSystem + "'" + " AND ClassName='" + super.user.u.replace(this.ClassName.getText(), "'", "''") + "'";
  170.          var2 = var1.execSQL(var4, var3);
  171.          if (var2 > 0) {
  172.             return true;
  173.          }
  174.  
  175.          var3 = new Vector();
  176.          var4 = "INSERT INTO JDPClassDef (JDPSystem, ClassName, " + "ClassDesc, " + "Status, " + "projtype, " + "lastmod, " + "owner, " + "notes) VALUES('" + super.user.u.replace(super.user.JDPSystem, "'", "''") + "', " + "'" + super.user.u.replace(this.ClassName.getText(), "'", "''") + "', " + "'" + super.user.u.replace(this.ClassDesc.getText(), "'", "''") + "', " + "'" + (String)this.valueStatus.elementAt(this.Status.getSelectedIndex()) + "', " + "'" + this.projectType + "', " + "'" + super.user.u.replace(this.lastmod.getText(), "'", "''") + "', " + "'" + super.user.u.replace(this.owner.getText(), "'", "''") + "', " + "'" + super.user.u.replace(this.notes.getText(), "'", "''") + "')";
  177.       } else {
  178.          this.itemIndex = this.searchResults.getSelectedIndex();
  179.          if (this.ClassName.getText().equals("")) {
  180.             super.user.mainmsg.setStatusMsg("You must first make a selection", 5);
  181.             return false;
  182.          }
  183.  
  184.          if (this.itemIndex < 0) {
  185.             return false;
  186.          }
  187.  
  188.          if (this.deleteRequested) {
  189.             var4 = "DELETE FROM JDPClassDef" + " WHERE JDPSystem='" + this.searchResults.recordKey0[this.itemIndex] + "'" + " AND ClassName='" + this.searchResults.recordKey1[this.itemIndex] + "'";
  190.          } else {
  191.             var4 = "UPDATE JDPClassDef SET ClassDesc = '" + super.user.u.replace(this.ClassDesc.getText(), "'", "''") + "', " + "Status = '" + (String)this.valueStatus.elementAt(this.Status.getSelectedIndex()) + "', " + "lastmod = '" + super.user.u.replace(this.lastmod.getText(), "'", "''") + "', " + "notes = '" + super.user.u.replace(this.notes.getText(), "'", "''") + "'" + " WHERE JDPSystem='" + this.searchResults.recordKey0[this.itemIndex] + "'" + " AND ClassName='" + this.searchResults.recordKey1[this.itemIndex] + "'";
  192.          }
  193.       }
  194.  
  195.       super.user.mainmsg.setStatusMsg("Accessing database...", 0);
  196.       var2 = var1.execSQL(var4, var3);
  197.       if (var2 == -1) {
  198.          super.user.u.setSqlMessage(var1, var4);
  199.          return false;
  200.       } else {
  201.          if (var2 == 1) {
  202.             if (this.insertRequested) {
  203.                super.user.mainmsg.setStatusMsg("Record successfully added.", 3);
  204.             } else if (this.deleteRequested) {
  205.                super.user.mainmsg.setStatusMsg("Record successfully removed.", 3);
  206.             } else {
  207.                super.user.mainmsg.setStatusMsg("Record successfully updated.", 3);
  208.             }
  209.          } else {
  210.             super.user.u.setSqlMessage(var1, var4);
  211.          }
  212.  
  213.          this.insertRequested = false;
  214.          this.deleteRequested = false;
  215.          return true;
  216.       }
  217.    }
  218.  
  219.    boolean checkFields() {
  220.       if (!super.user.u.ischaracter(this.ClassName, super.user.mainmsg, "Please enter a Project name")) {
  221.          return false;
  222.       } else if (!super.user.u.ischaracter(this.ClassDesc, super.user.mainmsg, "Please enter a Project description")) {
  223.          return false;
  224.       } else {
  225.          String var1 = this.ClassName.getText();
  226.          var1 = super.user.u.replace(var1, " ", "");
  227.          var1 = super.user.u.replace(var1, "'", "");
  228.          this.ClassName.setText(var1);
  229.          return true;
  230.       }
  231.    }
  232.  
  233.    public synchronized boolean handleEvent(Event var1) {
  234.       switch (var1.id) {
  235.          case 202:
  236.             if (var1.target instanceof JDPTabSelectPanel) {
  237.                return true;
  238.             }
  239.  
  240.             return false;
  241.          case 401:
  242.             if (var1.key == 9) {
  243.                if (var1.modifiers != 1) {
  244.                   if (var1.target.equals(this.ClassName)) {
  245.                      super.user.u.cursor(this.ClassDesc);
  246.                      return true;
  247.                   }
  248.  
  249.                   if (var1.target.equals(this.ClassDesc)) {
  250.                      super.user.u.cursor(this.owner);
  251.                      return true;
  252.                   }
  253.  
  254.                   if (var1.target.equals(this.owner)) {
  255.                      super.user.u.cursor(this.lastmod);
  256.                      return true;
  257.                   }
  258.  
  259.                   if (var1.target.equals(this.lastmod)) {
  260.                      super.user.u.cursor(this.Status);
  261.                      return true;
  262.                   }
  263.  
  264.                   if (var1.target.equals(this.Status)) {
  265.                      super.user.u.cursor(this.notes);
  266.                      return true;
  267.                   }
  268.  
  269.                   if (var1.target.equals(this.notes)) {
  270.                      super.user.u.cursor(this.ClassName);
  271.                      return true;
  272.                   }
  273.                } else {
  274.                   if (var1.target.equals(this.ClassDesc)) {
  275.                      super.user.u.cursor(this.ClassName);
  276.                      return true;
  277.                   }
  278.  
  279.                   if (var1.target.equals(this.owner)) {
  280.                      super.user.u.cursor(this.ClassDesc);
  281.                      return true;
  282.                   }
  283.  
  284.                   if (var1.target.equals(this.lastmod)) {
  285.                      super.user.u.cursor(this.owner);
  286.                      return true;
  287.                   }
  288.  
  289.                   if (var1.target.equals(this.Status)) {
  290.                      super.user.u.cursor(this.lastmod);
  291.                      return true;
  292.                   }
  293.  
  294.                   if (var1.target.equals(this.notes)) {
  295.                      super.user.u.cursor(this.Status);
  296.                      return true;
  297.                   }
  298.  
  299.                   if (var1.target.equals(this.ClassName)) {
  300.                      super.user.u.cursor(this.notes);
  301.                      return true;
  302.                   }
  303.                }
  304.  
  305.                return true;
  306.             }
  307.  
  308.             return false;
  309.          case 501:
  310.             if (this.popup.isVisible()) {
  311.                this.popup.hideMenu();
  312.                return true;
  313.             }
  314.  
  315.             return false;
  316.          case 503:
  317.          case 504:
  318.          case 505:
  319.             this.popuppanel.postEvent(var1);
  320.             return false;
  321.          case 701:
  322.             if (var1.target instanceof JDPTreePicker) {
  323.                String var3 = (String)var1.arg;
  324.                if (var3.equals("BranchSelect")) {
  325.                   if (var1.target.equals(this.searchResults.tree)) {
  326.                      this.popup.setMenuTree(this.popupMain);
  327.                      this.popup.display(var1.x, var1.y);
  328.                      return true;
  329.                   }
  330.                } else if (var3.equals("LeafSelect") && var1.target.equals(this.searchResults.tree)) {
  331.                   this.popup.setMenuTree(this.popupFile);
  332.                   this.popup.display(var1.x, var1.y);
  333.                   return true;
  334.                }
  335.             }
  336.  
  337.             return false;
  338.          case 1001:
  339.             this.eventVector.addElement(var1);
  340.             Thread var2 = new Thread(this);
  341.             var2.start();
  342.             return true;
  343.          default:
  344.             if (super.user.jdpMainWindow != null) {
  345.                if (super.user.jdpMainWindow.getCursorType() == 3) {
  346.                   return false;
  347.                }
  348.  
  349.                super.user.jdpMainWindow.setCursor(0);
  350.             }
  351.  
  352.             return false;
  353.       }
  354.    }
  355.  
  356.    public void run() {
  357.       Event var1 = (Event)this.eventVector.elementAt(0);
  358.       this.eventVector.removeElementAt(0);
  359.       if (var1.target instanceof JDPTreePicker && var1.target.equals(this.searchResults.tree)) {
  360.          this.loadData();
  361.       } else if (var1.target instanceof JDPButton) {
  362.          String var3 = (String)var1.arg;
  363.          if (var3.trim().compareTo("Apply") == 0) {
  364.             if (this.checkFields()) {
  365.                this.saveProject();
  366.             }
  367.  
  368.             this.ClassName.setEditable(false);
  369.          } else if (var3.trim().compareTo("Reset") == 0) {
  370.             this.loadData();
  371.          } else if (var3.trim().compareTo("Edit") == 0) {
  372.             if (this.checkFields()) {
  373.                if (!this.copyRequested && !this.insertRequested && !super.user.saveProperties.load(this.appDir + this.ClassName.getText() + ".jdp")) {
  374.                   return;
  375.                }
  376.  
  377.                if (this.insertRequested) {
  378.                   this.saveData();
  379.                   super.user.saveProperties.save(this.appDir + this.ClassName.getText() + ".jdp");
  380.                   this.newSearch();
  381.                } else {
  382.                   this.saveData();
  383.                }
  384.  
  385.                this.selectProject();
  386.                this.copyRequested = false;
  387.                this.ClassName.setEditable(false);
  388.                super.user.jdpMenuPanel.loadNextTab();
  389.                this.retrieveDSN();
  390.             }
  391.  
  392.          } else if (var3.trim().compareTo("New") == 0) {
  393.             this.insertRequested = true;
  394.             super.user.saveProperties.clear();
  395.             this.clearFields();
  396.             this.ClassName.setEditable(true);
  397.             this.ClassName.requestFocus();
  398.          } else if (var3.trim().compareTo("Copy") == 0) {
  399.             super.user.saveProperties.load(this.appDir + this.ClassName.getText() + ".jdp");
  400.             this.ClassName.setText("");
  401.             this.ClassName.requestFocus();
  402.             this.ClassName.setEditable(true);
  403.             this.insertRequested = true;
  404.             this.copyRequested = true;
  405.          } else if (var3.trim().compareTo("Remove") == 0) {
  406.             this.insertRequested = false;
  407.             this.deleteRequested = true;
  408.             this.ClassName.setEditable(false);
  409.             this.saveData();
  410.             this.newSearch();
  411.          } else if (var3.trim().compareTo("Search") == 0) {
  412.             this.insertRequested = false;
  413.             this.deleteRequested = false;
  414.             this.newSearch();
  415.          }
  416.       } else if (!(var1.target instanceof Choice)) {
  417.          if (var1.target instanceof TextField) {
  418.             this.checkFields();
  419.          } else if (var1.target instanceof JDPPopupMenu) {
  420.             String[] var2 = this.popup.getSelectedBranch();
  421.             this.popup.hideMenu();
  422.             if (var2[0].equals("New Project...")) {
  423.                this.insertRequested = true;
  424.                super.user.saveProperties.clear();
  425.                this.ClassName.setEditable(true);
  426.                this.clearFields();
  427.                this.ClassName.requestFocus();
  428.             } else if (var2[0].equals("Copy Project...")) {
  429.                super.user.saveProperties.load(this.appDir + this.ClassName.getText() + ".jdp");
  430.                this.ClassName.setText("");
  431.                this.ClassName.requestFocus();
  432.                this.ClassName.setEditable(true);
  433.                this.insertRequested = true;
  434.                this.copyRequested = true;
  435.             } else if (var2[0].equals("Edit Project...")) {
  436.                if (this.checkFields()) {
  437.                   if (!this.copyRequested && !this.insertRequested && !super.user.saveProperties.load(this.appDir + this.ClassName.getText() + ".jdp")) {
  438.                      return;
  439.                   }
  440.  
  441.                   if (this.insertRequested) {
  442.                      this.saveData();
  443.                      super.user.saveProperties.save(this.appDir + this.ClassName.getText() + ".jdp");
  444.                      this.newSearch();
  445.                   } else {
  446.                      this.saveData();
  447.                   }
  448.  
  449.                   this.copyRequested = false;
  450.                   this.ClassName.setEditable(false);
  451.                   super.user.jdpMenuPanel.loadNextTab();
  452.                   this.retrieveDSN();
  453.                }
  454.  
  455.             } else if (var2[0].equals("Remove Project...")) {
  456.                this.insertRequested = false;
  457.                this.deleteRequested = true;
  458.                this.ClassName.setEditable(false);
  459.                this.saveData();
  460.                this.newSearch();
  461.             } else if (var2[0].equals("Refresh")) {
  462.                this.insertRequested = false;
  463.                this.deleteRequested = false;
  464.                this.ClassName.setEditable(false);
  465.                this.newSearch();
  466.             }
  467.          }
  468.       }
  469.    }
  470.  
  471.    void checkDevelopers() {
  472.       super.user.jaggSQL.setFCTN("CheckDevelopers");
  473.       super.user.jaggSQL.setFCTNP("");
  474.       Vector var1 = new Vector();
  475.       int var2 = super.user.jaggSQL.execSQL("", var1);
  476.       this.jaggSQL.setFCTN("");
  477.       boolean var3 = false;
  478.       if (var2 > this.searchResults.tree.treeRoot.leaves.size()) {
  479.          var3 = true;
  480.       } else {
  481.          for(int var4 = 0; var4 < var2; ++var4) {
  482.             if (this.searchResults.tree.treeRoot.leaves.size() > var4) {
  483.                JDPTreeBranch var5 = (JDPTreeBranch)this.searchResults.tree.treeRoot.leaves.elementAt(var4);
  484.                if (var5.name.equals(super.user.cust.username)) {
  485.                   var3 = true;
  486.                }
  487.             }
  488.          }
  489.       }
  490.  
  491.       if (!var3) {
  492.          String var6 = "";
  493.          if (var2 > 1) {
  494.             var6 = "s";
  495.          }
  496.  
  497.          super.user.mainmsg.setStatusMsg("Your developer license only allows " + Integer.toString(var2) + " developer" + var6 + ". Contact BulletProof for extra licenses.", 60);
  498.          this.searchResults.tree.disable();
  499.  
  500.          for(int var7 = 0; var7 < this.btns.button.length; ++var7) {
  501.             this.btns.button[var7].disable();
  502.          }
  503.  
  504.          this.ClassName.setEditable(false);
  505.          this.ClassDesc.setEditable(false);
  506.       }
  507.  
  508.       super.user.jaggSQL.setFCTN("");
  509.       super.user.jaggSQL.setFCTNP("");
  510.    }
  511.  
  512.    void retrieveDSN() {
  513.       for(int var1 = 0; var1 < super.user.gParm.size(); ++var1) {
  514.          if (super.user.gParm.elementAt(var1) instanceof Vector) {
  515.             Vector var2 = (Vector)super.user.gParm.elementAt(var1);
  516.             if (((String)var2.elementAt(0)).compareTo("SelectDSN") == 0) {
  517.                this.targetDSN = (JDPSelectDSN)var2.elementAt(3);
  518.                this.targetDSN.refresh();
  519.             }
  520.          }
  521.  
  522.          if (super.user.gParm.elementAt(var1) instanceof JDPLayoutMgr) {
  523.             ((JDPLayoutMgr)super.user.gParm.elementAt(var1)).restoreSelections();
  524.          }
  525.       }
  526.  
  527.    }
  528.  
  529.    public void InitClass(JDPUser var1, Panel var2, String var3) {
  530.       super.user = var1;
  531.       this.projectType = "W";
  532.       if (var3.length() > 0) {
  533.          this.projectType = var3.substring(0, 1);
  534.       }
  535.  
  536.       this.jaggSQL = new JDPJagg(var1.jaggPath);
  537.       this.jaggSQL.setNULL("space");
  538.       this.jaggSQL.setMRW("1000");
  539.       this.jaggSQL.loadSettings(var1);
  540.       this.appDir = var1.JDesignerPro.JDPDirectory + "Applications" + JDesignerPro.serverSeparator + "Wizard" + JDesignerPro.serverSeparator;
  541.       this.eventVector = new Vector();
  542.       ((Container)this).setLayout(new BorderLayout());
  543.       ((Component)this).setFont(var1.plainFont);
  544.       this.popuppanel = new JDPPopupMessage(var1, var2);
  545.       ((Container)var2).add(this.popuppanel);
  546.       Panel var4 = new Panel();
  547.       ((Container)var4).setLayout(new BorderLayout());
  548.       Panel var5 = new Panel();
  549.       ((Container)var5).setLayout(new BorderLayout());
  550.       Panel var6 = new Panel();
  551.       ((Container)var6).setLayout(new BorderLayout());
  552.       JDPScrollPanel var7 = new JDPScrollPanel();
  553.       Panel var8 = new Panel();
  554.       ((Container)var8).setLayout(new BorderLayout());
  555.       String var9 = "b.JDPSystem,a.ClassName";
  556.       String[] var10 = new String[]{"a.ClassName"};
  557.       this.pfromWhereClause = "FROM JDPClassDef a, JDPSystemDef b WHERE a.projtype = '" + this.projectType + "' AND a.JDPSystem = b.JDPSystem AND a.JDPSystem = '" + var1.JDPSystem + "'";
  558.       this.psortChoice = new String[1];
  559.       this.psortChoice[0] = "a.owner";
  560.       String[] var11 = new String[]{"Jdpsystem"};
  561.       this.pdisplayChoice = this.psortChoice;
  562.       boolean var12 = false;
  563.       String var13 = "Total Entries:";
  564.       if (var1.saveProperties == null) {
  565.          var1.saveProperties = new JDPSaveProps(var1);
  566.       }
  567.  
  568.       this.popup = new JDPPopupMenu(var1, this);
  569.       ((Container)var2).add(this.popup);
  570.       this.createPopupMenus();
  571.       this.ClassName = new TextField("", 22);
  572.       this.ClassDesc = new TextField("", 40);
  573.       this.owner = new TextField("", 22);
  574.       this.lastmod = new TextField("", 22);
  575.       this.Status = new Choice();
  576.       this.notes = new TextArea("", 8, 45);
  577.       this.loadChoices();
  578.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Project Name:", Color.black));
  579.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Description:", Color.black));
  580.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Owner:", Color.black));
  581.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Last Modified:", Color.black));
  582.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Status:", Color.black));
  583.       ((Container)var7).add("Left", new JDPWrapLabel(var1, "Notes:", Color.black));
  584.       Panel var14 = new Panel();
  585.       ((Container)var14).setLayout(new JDPLineLayout(3));
  586.       ((Container)var14).add("Left", this.ClassName);
  587.       ((Container)var7).add("Right", var14);
  588.       Panel var15 = new Panel();
  589.       ((Container)var15).setLayout(new JDPLineLayout(3));
  590.       ((Container)var15).add("Left", this.ClassDesc);
  591.       ((Container)var7).add("Right", var15);
  592.       Panel var16 = new Panel();
  593.       ((Container)var16).setLayout(new JDPLineLayout(3));
  594.       ((Container)var16).add("Left", this.owner);
  595.       ((Container)var7).add("Right", var16);
  596.       Panel var17 = new Panel();
  597.       ((Container)var17).setLayout(new JDPLineLayout(3));
  598.       ((Container)var17).add("Left", this.lastmod);
  599.       ((Container)var7).add("Right", var17);
  600.       Panel var18 = new Panel();
  601.       ((Container)var18).setLayout(new JDPLineLayout(3));
  602.       ((Container)var18).add("Left", this.Status);
  603.       ((Container)var7).add("Right", var18);
  604.       Panel var19 = new Panel();
  605.       ((Container)var19).setLayout(new JDPLineLayout(3));
  606.       ((Container)var19).add(new Label("", 0));
  607.       ((Container)var7).add("Right", var19);
  608.       ((Container)var6).add("North", var7);
  609.       ((Container)var6).add("Center", this.notes);
  610.       this.ClassName.setForeground(Color.black);
  611.       this.ClassDesc.setForeground(Color.black);
  612.       this.Status.setForeground(Color.black);
  613.       this.lastmod.setForeground(Color.black);
  614.       this.owner.setForeground(Color.black);
  615.       this.notes.setForeground(Color.black);
  616.       this.ClassName.setBackground(Color.white);
  617.       this.ClassDesc.setBackground(Color.white);
  618.       this.Status.setBackground(Color.white);
  619.       this.popuppanel.addComponent(this.ClassName, "Project Name", "Enter the name for the Project");
  620.       this.popuppanel.addComponent(this.ClassDesc, "Description", "Enter the description of the Project");
  621.       this.popuppanel.addComponent(this.Status, "Status", "The current status of the project");
  622.       this.popuppanel.addComponent(this.lastmod, "Last modified", "Date that the Project was last modified");
  623.       this.popuppanel.addComponent(this.owner, "Owner", "Project Owner");
  624.       this.popuppanel.addComponent(this.notes, "Notes", "Enter any notes for this Project");
  625.       this.lastmod.setEditable(false);
  626.       this.owner.setEditable(false);
  627.       String[] var20 = new String[]{"Apply", "Reset", "Edit", "New", "Copy", "Remove"};
  628.       int[] var21 = new int[]{0, 6, 1, 9, 10, 8};
  629.       this.btns = new JDPButtons(var1, var20, var21, JDPButtons.HORIZONTAL);
  630.       ((Container)var6).add("South", this.btns);
  631.       this.popuppanel.addComponent(this.btns.button[0], "Apply Changes", "Save changes to the database");
  632.       this.popuppanel.addComponent(this.btns.button[1], "Undo Changes", "Undo changes by reloading the record");
  633.       this.popuppanel.addComponent(this.btns.button[2], "Edit Project", "Edit this project");
  634.       this.popuppanel.addComponent(this.btns.button[3], "New Entry", "Create a new project");
  635.       this.popuppanel.addComponent(this.btns.button[4], "Copy Entry", "Copy this project");
  636.       this.popuppanel.addComponent(this.btns.button[5], "Remove record", "Remove the current project");
  637.       ((Container)var4).add("Center", var6);
  638.       String[] var22 = new String[0];
  639.       String[] var23 = new String[0];
  640.       String[][] var24 = new String[0][0];
  641.       String[][] var25 = new String[0][0];
  642.       boolean[] var26 = new boolean[0];
  643.       int[] var27 = new int[0];
  644.       if (var22.length > 0) {
  645.          this.jdpWhereClause = new JDPWhereClause(var1, var2, "JDPProjManager", true, " ", var22, var23, var24, var25, (String[][])null, (String[][])null, var27, var26);
  646.          ((Container)var8).add("North", this.jdpWhereClause);
  647.       }
  648.  
  649.       if (this.psortChoice.length > 0) {
  650.          this.searchResults = new JDPSearchResults(var1, var2, true, this.jaggSQL, false, var9, var10, this.pfromWhereClause, var11, this.psortChoice, this.pdisplayChoice, "", var12, var13);
  651.          int[] var28 = new int[]{4, 5, 1};
  652.          this.searchResults.setIcons(var28);
  653.          this.searchResults.setMinWidth(185);
  654.          ((Container)var8).add("Center", this.searchResults);
  655.          ((Container)var4).add("West", var8);
  656.       }
  657.  
  658.       ((Container)this).add("Center", new JDPChiselFramePanel(var1, "Project Manager", var4, "North"));
  659.       if (this.psortChoice.length > 0) {
  660.          this.newSearch();
  661.       }
  662.  
  663.       ((Component)var2).paintAll(((Component)var2).getGraphics());
  664.       var1.gParm.addElement(this);
  665.       this.checkDevelopers();
  666.    }
  667. }
  668.