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

  1. import java.awt.BorderLayout;
  2. import java.awt.Button;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Event;
  6. import java.awt.GridLayout;
  7. import java.awt.Label;
  8. import java.awt.Panel;
  9. import java.awt.TextField;
  10. import java.util.Vector;
  11.  
  12. public class JDPListLayout extends JDPClassLayout {
  13.    JDPSelectDSN targetDSN;
  14.    JDPSelectTable targetTable;
  15.    JDPSelectColumns target;
  16.    JDPLayoutMgr targetLayoutMgr;
  17.    String moduleParameter;
  18.    JDPPopupMessage popuppanel;
  19.    JDPList columns;
  20.    JDPComboBox useTree;
  21.    Label includeLabel;
  22.    JDPList columns1;
  23.    JDPList includeTree;
  24.    TextField mainBranchText;
  25.    JDPComboBox mainBranchIcon;
  26.    JDPComboBox mainIcon;
  27.    JDPComboBox iconlist;
  28.    JDPList uniqueTree;
  29.    TextField treeMinWidth;
  30.    TextField maxRows;
  31.    JDPComboBox displayCount;
  32.    TextField pcounttext;
  33.    TextField psortchoicetext;
  34.    TextField psortchoicesql;
  35.    JDPComboBox psortorder;
  36.    JDPComboBox pinitchoice;
  37.    TextField pfromwhereclause;
  38.    Label listCount;
  39.    String[] psortChoiceText;
  40.    String[] psortChoiceSql;
  41.    String[] psortOrder;
  42.    int[] iconList;
  43.    String pinitChoice = "";
  44.    String pselectFields;
  45.    String[] psdisplayFields;
  46.    String[] psortCh;
  47.    String[] psortChSql;
  48.    Vector gParmObject;
  49.    int currentSelection = -1;
  50.    int currentSelection1 = -1;
  51.    JDPTabSelectPanel tabPanel;
  52.    long lastEventTime;
  53.  
  54.    void updateArrays() {
  55.       if (this.currentSelection >= 0) {
  56.          this.psortChoiceText[this.currentSelection] = this.psortchoicetext.getText();
  57.          this.psortChoiceSql[this.currentSelection] = this.psortchoicesql.getText();
  58.          this.psortOrder[this.currentSelection] = this.psortorder.getSelectedItem();
  59.       }
  60.    }
  61.  
  62.    void clearList() {
  63.       this.columns.clear();
  64.  
  65.       for(int var1 = 0; var1 < this.columns1.countItems(); ++var1) {
  66.          this.columns1.deselect(var1);
  67.       }
  68.  
  69.       for(int var2 = 0; var2 < this.includeTree.countItems(); ++var2) {
  70.          this.includeTree.deselect(var2);
  71.       }
  72.  
  73.       for(int var3 = 0; var3 < this.uniqueTree.countItems(); ++var3) {
  74.          this.uniqueTree.deselect(var3);
  75.       }
  76.  
  77.       this.columns1.clear();
  78.       this.includeTree.clear();
  79.       this.uniqueTree.clear();
  80.    }
  81.  
  82.    void loadList() {
  83.       this.clearList();
  84.       this.psortChoiceText = new String[1];
  85.       this.psortChoiceSql = new String[1];
  86.       this.psortOrder = new String[1];
  87.       this.iconList = new int[1];
  88.       if (this.target != null && this.target.columnName != null && this.target.columns.getSelectedIndexes().length != 0) {
  89.          String[] var1 = this.target.columns.getSelectedItems();
  90.          this.target.columns.getSelectedIndexes();
  91.          int var2 = var1.length;
  92.          this.listCount.setText(Integer.toString(var2));
  93.          this.psortChoiceText = new String[var2];
  94.          this.psortChoiceSql = new String[var2];
  95.          this.psortOrder = new String[var2];
  96.          this.iconList = new int[var2];
  97.  
  98.          for(int var3 = 0; var3 < var1.length; ++var3) {
  99.             this.psortChoiceText[var3] = super.user.u.makeLabel(var1[var3]);
  100.             this.psortChoiceSql[var3] = var1[var3];
  101.             this.psortOrder[var3] = "Ascending";
  102.             this.columns.addItem(var1[var3], 8);
  103.             this.columns1.addItem(var1[var3]);
  104.          }
  105.  
  106.          String[] var5 = this.target.keys.getSelectedItems();
  107.  
  108.          for(int var4 = 0; var4 < var5.length; ++var4) {
  109.             this.uniqueTree.addItem(var5[var4]);
  110.             this.uniqueTree.select(var4);
  111.             this.uniqueTree.makeVisible(0);
  112.          }
  113.  
  114.       } else {
  115.          if (super.componentName.equals("") && ((Component)this).isShowing()) {
  116.             super.user.mainmsg.setStatusMsg("You must first select a Table.", 5);
  117.          }
  118.  
  119.       }
  120.    }
  121.  
  122.    boolean restoreSelections() {
  123.       JDPSaveProps var1 = super.user.saveProperties;
  124.       if (super.user.prevProperties != null) {
  125.          var1 = super.user.prevProperties;
  126.       }
  127.  
  128.       String var2 = "JDPListLayout" + super.componentName;
  129.       this.mainBranchText.setText("");
  130.       this.mainBranchIcon.select(0);
  131.       this.mainIcon.select(0);
  132.       var1.restoreObject(this.columns, var2, "columns");
  133.       var1.restoreObject(this.useTree, var2, "useTree");
  134.       var1.restoreObject(this.columns1, var2, "columns1");
  135.       var1.restoreObject(this.includeTree, var2, "includeTree", 1);
  136.       var1.restoreObject(this.mainBranchText, var2, "mainBranchText");
  137.       var1.restoreObject(this.mainBranchIcon, var2, "mainBranchIcon");
  138.       var1.restoreObject(this.mainIcon, var2, "mainIcon");
  139.       int[] var3 = (int[])var1.restoreObject(this.iconList, var2, "iconList");
  140.       var1.restoreObject(this.uniqueTree, var2, "uniqueTree");
  141.       var1.restoreObject(this.treeMinWidth, var2, "treeMinWidth");
  142.       var1.restoreObject(this.maxRows, var2, "maxRows");
  143.       var1.restoreObject(this.displayCount, var2, "displayCount");
  144.       var1.restoreObject(this.pcounttext, var2, "pcounttext");
  145.       String[] var4 = (String[])var1.restoreObject(this.psortChoiceText, var2, "psortChoiceText");
  146.       String[] var5 = (String[])var1.restoreObject(this.psortChoiceSql, var2, "psortChoiceSql");
  147.       String[] var6 = (String[])var1.restoreObject(this.psortOrder, var2, "psortOrder");
  148.       this.pinitChoice = (String)var1.restoreObject(this.pinitChoice, var2, "pinitChoice");
  149.       var1.restoreObject(this.pfromwhereclause, var2, "pfromwhereclause");
  150.       if (var3 != null) {
  151.          if (this.iconList.length < var3.length) {
  152.             this.iconList = new int[var3.length];
  153.          }
  154.  
  155.          if (this.psortChoiceText.length < var4.length) {
  156.             this.psortChoiceText = new String[var4.length];
  157.          }
  158.  
  159.          if (this.psortChoiceSql.length < var5.length) {
  160.             this.psortChoiceSql = new String[var5.length];
  161.          }
  162.  
  163.          if (this.psortOrder.length < var6.length) {
  164.             this.psortOrder = new String[var6.length];
  165.          }
  166.  
  167.          for(int var7 = 0; var7 < var3.length; ++var7) {
  168.             this.iconList[var7] = var3[var7];
  169.             this.psortChoiceText[var7] = var4[var7];
  170.             this.psortChoiceSql[var7] = var5[var7];
  171.             this.psortOrder[var7] = var6[var7];
  172.          }
  173.       }
  174.  
  175.       return true;
  176.    }
  177.  
  178.    void clearFields() {
  179.       this.psortchoicetext.setText("");
  180.       this.psortchoicesql.setText("");
  181.       this.psortorder.select("Ascending");
  182.       this.pinitchoice.select("Yes");
  183.       this.pinitChoice = "";
  184.    }
  185.  
  186.    void loadLayoutComponent() {
  187.       if (this.targetLayoutMgr != null && this.psortChoiceSql != null && this.columns.countItems() > 0 && this.columns.getSelectedIndexes().length > 0) {
  188.          JDPJagg var1 = new JDPJagg(super.user.jaggPath);
  189.          var1.loadSettings(this.targetDSN);
  190.          var1.setMRW("100");
  191.          this.pselectFields = "";
  192.          String[] var2 = this.uniqueTree.getSelectedItems();
  193.  
  194.          for(int var3 = 0; var3 < var2.length; ++var3) {
  195.             if (var3 > 0) {
  196.                String var10001 = this.pselectFields;
  197.                this.pselectFields = var10001 + ",";
  198.             }
  199.  
  200.             String var12 = this.pselectFields;
  201.             this.pselectFields = var12 + var2[var3];
  202.          }
  203.  
  204.          this.psdisplayFields = new String[this.includeTree.countItems()];
  205.  
  206.          for(int var7 = 0; var7 < this.includeTree.countItems(); ++var7) {
  207.             this.psdisplayFields[var7] = this.includeTree.getItem(var7);
  208.          }
  209.  
  210.          int[] var8 = this.columns.getSelectedIndexes();
  211.          this.psortCh = new String[var8.length];
  212.  
  213.          for(int var4 = 0; var4 < this.psortCh.length; ++var4) {
  214.             if (var8[var4] < this.psortChoiceText.length) {
  215.                this.psortCh[var4] = this.psortChoiceText[var8[var4]];
  216.             }
  217.          }
  218.  
  219.          this.psortChSql = new String[var8.length];
  220.  
  221.          for(int var9 = 0; var9 < this.psortChSql.length; ++var9) {
  222.             if (var8[var9] < this.psortChoiceSql.length) {
  223.                this.psortChSql[var9] = this.psortChoiceSql[var8[var9]];
  224.                if (this.psortOrder[var8[var9]].equals("Descending")) {
  225.                   String[] var10000 = this.psortChSql;
  226.                   var10000[var9] = var10000[var9] + " DESC";
  227.                }
  228.             }
  229.          }
  230.  
  231.          Container var10 = null;
  232.          if (super.thisBranch.thisObject instanceof Component) {
  233.             var10 = ((Component)super.thisBranch.thisObject).getParent();
  234.             if (var10 != null) {
  235.                var10.remove((Component)super.thisBranch.thisObject);
  236.             }
  237.          }
  238.  
  239.          super.thisBranch.thisObject = new JDPSearchResults(super.user, super.targetPanel, this.useTree.getSelectedIndex() == 0, var1, false, this.pselectFields, this.psdisplayFields, this.pfromwhereclause.getText(), this.psortCh, this.psortChSql, this.psortChSql, this.pinitChoice, this.displayCount.getSelectedIndex() == 0, this.pcounttext.getText());
  240.          int[] var5 = new int[this.iconList.length + 2];
  241.          var5[0] = this.mainBranchIcon.getSelectedIndex();
  242.          var5[1] = this.mainIcon.getSelectedIndex();
  243.  
  244.          for(int var6 = 0; var6 < this.iconList.length; ++var6) {
  245.             var5[var6 + 2] = this.iconList[var6];
  246.          }
  247.  
  248.          JDPSearchResults var11 = (JDPSearchResults)super.thisBranch.thisObject;
  249.          var11.setMinWidth(Integer.parseInt(this.treeMinWidth.getText()));
  250.          var11.setIcons(var5);
  251.          var11.setFromWhereClause(this.targetLayoutMgr.gSource.createFromWhereClause(this.targetDSN, this.targetTable, this));
  252.          var11.clearList(this.mainBranchText.getText());
  253.          var11.loadList();
  254.          if (var10 != null) {
  255.             var10.add(super.thisBranch.compPosition, (Component)super.thisBranch.thisObject);
  256.          }
  257.  
  258.          if (!this.targetLayoutMgr.projectLoading) {
  259.             this.targetLayoutMgr.gSource.constructMethod(super.thisBranch, "Main");
  260.             this.targetLayoutMgr.setButton("Layout");
  261.             this.targetLayoutMgr.reDraw();
  262.          }
  263.  
  264.          this.targetLayoutMgr.cMgr.updateProperties(0);
  265.       }
  266.  
  267.    }
  268.  
  269.    void updateArrays1() {
  270.       if (this.currentSelection1 >= 0) {
  271.          this.iconList[this.currentSelection1] = this.iconlist.getSelectedIndex();
  272.       }
  273.    }
  274.  
  275.    void loadItem1(int var1) {
  276.       this.iconlist.select(this.iconList[var1]);
  277.    }
  278.  
  279.    boolean saveSelections() {
  280.       JDPSaveProps var1 = super.user.saveProperties;
  281.       String var2 = "JDPListLayout" + super.componentName;
  282.       var1.saveObject(this.columns, var2, "columns");
  283.       var1.saveObject(this.useTree, var2, "useTree");
  284.       var1.saveObject(this.columns1, var2, "columns1");
  285.       var1.saveObject(this.includeTree, var2, "includeTree", 1);
  286.       var1.saveObject(this.mainBranchText, var2, "mainBranchText");
  287.       var1.saveObject(this.mainBranchIcon, var2, "mainBranchIcon");
  288.       var1.saveObject(this.mainIcon, var2, "mainIcon");
  289.       var1.saveObject(this.iconList, var2, "iconList");
  290.       var1.saveObject(this.uniqueTree, var2, "uniqueTree");
  291.       var1.saveObject(this.treeMinWidth, var2, "treeMinWidth");
  292.       var1.saveObject(this.maxRows, var2, "maxRows");
  293.       var1.saveObject(this.pcounttext, var2, "pcounttext");
  294.       var1.saveObject(this.displayCount, var2, "displayCount");
  295.       var1.saveObject(this.psortChoiceText, var2, "psortChoiceText");
  296.       var1.saveObject(this.psortChoiceSql, var2, "psortChoiceSql");
  297.       var1.saveObject(this.psortOrder, var2, "psortOrder");
  298.       var1.saveObject(this.pinitChoice, var2, "pinitChoice");
  299.       var1.saveObject(this.pfromwhereclause, var2, "pfromwhereclause");
  300.       return true;
  301.    }
  302.  
  303.    void refresh() {
  304.       this.clearFields();
  305.       this.currentSelection = -1;
  306.       this.currentSelection1 = -1;
  307.       this.retrieveColumns();
  308.       this.loadList();
  309.       this.restoreSelections();
  310.    }
  311.  
  312.    void retrieveColumns() {
  313.       for(int var1 = 0; var1 < super.user.gParm.size(); ++var1) {
  314.          if (super.user.gParm.elementAt(var1) instanceof Vector) {
  315.             Vector var2 = (Vector)super.user.gParm.elementAt(var1);
  316.             if (((String)var2.elementAt(0)).compareTo("SelectDSN" + super.componentName) == 0) {
  317.                this.targetDSN = (JDPSelectDSN)var2.elementAt(3);
  318.             }
  319.  
  320.             if (((String)var2.elementAt(0)).compareTo("SelectTable" + super.componentName) == 0) {
  321.                this.targetTable = (JDPSelectTable)var2.elementAt(1);
  322.             }
  323.  
  324.             if (((String)var2.elementAt(0)).compareTo("SelectColumns" + super.componentName) == 0) {
  325.                this.target = (JDPSelectColumns)var2.elementAt(1);
  326.             }
  327.          }
  328.  
  329.          if (super.user.gParm.elementAt(var1) instanceof JDPLayoutMgr && !super.componentName.equals("")) {
  330.             this.targetLayoutMgr = (JDPLayoutMgr)super.user.gParm.elementAt(var1);
  331.          }
  332.       }
  333.  
  334.    }
  335.  
  336.    public boolean handleEvent(Event var1) {
  337.       switch (var1.id) {
  338.          case 401:
  339.             if (var1.key == 9) {
  340.                if (var1.target.equals(this.uniqueTree)) {
  341.                   super.user.u.cursor(this.psortchoicesql);
  342.                   return true;
  343.                }
  344.  
  345.                if (var1.target.equals(this.psortchoicesql)) {
  346.                   super.user.u.cursor(this.useTree);
  347.                   return true;
  348.                }
  349.  
  350.                if (var1.target.equals(this.mainBranchText)) {
  351.                   super.user.u.cursor(this.mainBranchIcon);
  352.                   return true;
  353.                }
  354.  
  355.                if (var1.target.equals(this.mainBranchIcon)) {
  356.                   super.user.u.cursor(this.mainIcon);
  357.                   return true;
  358.                }
  359.  
  360.                if (var1.target.equals(this.mainIcon)) {
  361.                   super.user.u.cursor(this.treeMinWidth);
  362.                   return true;
  363.                }
  364.  
  365.                if (var1.target.equals(this.treeMinWidth)) {
  366.                   super.user.u.cursor(this.columns1);
  367.                   return true;
  368.                }
  369.  
  370.                if (var1.target.equals(this.columns1)) {
  371.                   super.user.u.cursor(this.includeTree);
  372.                   return true;
  373.                }
  374.  
  375.                if (var1.target.equals(this.includeTree)) {
  376.                   super.user.u.cursor(this.iconlist);
  377.                   return true;
  378.                }
  379.  
  380.                if (var1.target.equals(this.iconlist)) {
  381.                   super.user.u.cursor(this.uniqueTree);
  382.                   return true;
  383.                }
  384.  
  385.                if (var1.target.equals(this.uniqueTree)) {
  386.                   super.user.u.cursor(this.mainBranchText);
  387.                   return true;
  388.                }
  389.  
  390.                if (var1.target.equals(this.psortchoicetext)) {
  391.                   super.user.u.cursor(this.psortorder);
  392.                   return true;
  393.                }
  394.  
  395.                if (var1.target.equals(this.psortorder)) {
  396.                   super.user.u.cursor(this.pinitchoice);
  397.                   return true;
  398.                }
  399.  
  400.                if (var1.target.equals(this.pinitchoice)) {
  401.                   super.user.u.cursor(this.psortchoicetext);
  402.                   return true;
  403.                }
  404.  
  405.                if (var1.target.equals(this.maxRows)) {
  406.                   super.user.u.cursor(this.displayCount);
  407.                   return true;
  408.                }
  409.  
  410.                if (var1.target.equals(this.displayCount)) {
  411.                   super.user.u.cursor(this.pcounttext);
  412.                   return true;
  413.                }
  414.  
  415.                if (var1.target.equals(this.pcounttext)) {
  416.                   super.user.u.cursor(this.pfromwhereclause);
  417.                   return true;
  418.                }
  419.  
  420.                if (super.componentName.equals("")) {
  421.                   if (var1.target.equals(this.pfromwhereclause)) {
  422.                      super.user.u.cursor(this.maxRows);
  423.                      return true;
  424.                   }
  425.                } else if (var1.target.equals(this.pfromwhereclause)) {
  426.                   super.user.u.cursor(this.displayCount);
  427.                   return true;
  428.                }
  429.  
  430.                return true;
  431.             }
  432.  
  433.             return false;
  434.          case 503:
  435.          case 504:
  436.          case 505:
  437.             this.popuppanel.postEvent(var1);
  438.             return false;
  439.          case 701:
  440.          case 702:
  441.             if (var1.target instanceof JDPList) {
  442.                if (var1.target.equals(this.columns)) {
  443.                   this.updateArrays();
  444.                   int var4 = (Integer)var1.arg;
  445.                   this.loadItem(var4);
  446.                   this.currentSelection = var4;
  447.                }
  448.  
  449.                if (var1.target.equals(this.columns1)) {
  450.                   this.updateArrays1();
  451.                   if (this.columns1.getSelectedIndex() >= 0) {
  452.                      this.includeTree.addItem(this.columns1.getSelectedItem());
  453.                      this.columns1.delItem(this.columns1.getSelectedIndex());
  454.                   }
  455.                }
  456.  
  457.                if (var1.target.equals(this.includeTree)) {
  458.                   this.updateArrays1();
  459.                   int var5 = this.includeTree.getSelectedIndex();
  460.                   this.loadItem1(var5);
  461.                   this.currentSelection1 = var5;
  462.                }
  463.  
  464.                return true;
  465.             }
  466.  
  467.             return false;
  468.          case 1001:
  469.             if (var1.target instanceof TextField) {
  470.                super.user.u.isnumeric(this.maxRows, super.user.mainmsg);
  471.                super.user.u.isnumeric(this.treeMinWidth, super.user.mainmsg);
  472.                return true;
  473.             } else if (var1.target instanceof JDPComboBox) {
  474.                if (var1.target.equals(this.pinitchoice)) {
  475.                   if (this.pinitchoice.getSelectedItem().compareTo("Yes") == 0) {
  476.                      this.pinitChoice = this.psortchoicetext.getText();
  477.                   } else {
  478.                      this.pinitChoice = "";
  479.                   }
  480.                }
  481.  
  482.                if (var1.target.equals(this.useTree)) {
  483.                }
  484.  
  485.                return true;
  486.             } else {
  487.                if (var1.target instanceof Button) {
  488.                   String var2 = (String)var1.arg;
  489.                   if (var2.trim().compareTo("Accept") == 0) {
  490.                      if (super.user.u.isnumeric(this.maxRows, super.user.mainmsg) && super.user.u.isnumeric(this.treeMinWidth, super.user.mainmsg)) {
  491.                         if (this.useTree.getSelectedItem().equals("Tree Structure") && this.uniqueTree.getSelectedIndexes().length <= 0) {
  492.                            super.user.mainmsg.setStatusMsg("You must select a unique key for branches in the tree", 10);
  493.                            return true;
  494.                         }
  495.  
  496.                         this.updateArrays();
  497.                         this.updateArrays1();
  498.                         this.saveSelections();
  499.                         super.user.mainmsg.setStatusMsg("Selections accepted.", 5);
  500.                         if (super.componentName.equals("")) {
  501.                            super.user.jdpMenuPanel.loadNextTab();
  502.                         } else {
  503.                            this.tabPanel = JDPUtils.getTabPanel(this);
  504.                            if (this.tabPanel != null) {
  505.                               int var6 = this.tabPanel.getSelectedIndex();
  506.                               this.tabPanel.loadNextTab();
  507.                               if (var6 == this.tabPanel.getSelectedIndex()) {
  508.                                  this.loadLayoutComponent();
  509.                               }
  510.                            }
  511.                         }
  512.                      }
  513.  
  514.                      return true;
  515.                   }
  516.  
  517.                   if (var2.trim().compareTo("Reset") == 0) {
  518.                      for(int var3 = 0; var3 < this.columns.countItems(); ++var3) {
  519.                         this.columns.deselect(var3);
  520.                      }
  521.  
  522.                      return true;
  523.                   }
  524.  
  525.                   if (var2.trim().compareTo(">") == 0 && this.columns1.getSelectedIndex() >= 0) {
  526.                      this.includeTree.addItem(this.columns1.getSelectedItem());
  527.                      this.columns1.delItem(this.columns1.getSelectedIndex());
  528.                   }
  529.  
  530.                   if (var2.trim().compareTo("<") == 0 && this.includeTree.getSelectedIndex() >= 0) {
  531.                      this.columns1.addItem(this.includeTree.getSelectedItem());
  532.                      this.includeTree.delItem(this.includeTree.getSelectedIndex());
  533.                   }
  534.                }
  535.  
  536.                return true;
  537.             }
  538.          default:
  539.             return false;
  540.       }
  541.    }
  542.  
  543.    boolean removeSelections() {
  544.       JDPSaveProps var1 = super.user.saveProperties;
  545.       String var2 = "JDPListLayout" + super.componentName;
  546.       var1.removeObject(this.columns, var2, "columns");
  547.       var1.removeObject(this.useTree, var2, "useTree");
  548.       var1.removeObject(this.columns1, var2, "columns1");
  549.       var1.removeObject(this.includeTree, var2, "includeTree");
  550.       var1.removeObject(this.mainBranchText, var2, "mainBranchText");
  551.       var1.removeObject(this.mainBranchIcon, var2, "mainBranchIcon");
  552.       var1.removeObject(this.mainIcon, var2, "mainIcon");
  553.       var1.removeObject(this.iconList, var2, "iconList");
  554.       var1.removeObject(this.uniqueTree, var2, "uniqueTree");
  555.       var1.removeObject(this.treeMinWidth, var2, "treeMinWidth");
  556.       var1.removeObject(this.maxRows, var2, "maxRows");
  557.       var1.removeObject(this.pcounttext, var2, "pcounttext");
  558.       var1.removeObject(this.displayCount, var2, "displayCount");
  559.       var1.removeObject(this.psortChoiceText, var2, "psortChoiceText");
  560.       var1.removeObject(this.psortChoiceSql, var2, "psortChoiceSql");
  561.       var1.removeObject(this.psortOrder, var2, "psortOrder");
  562.       var1.removeObject(this.pinitChoice, var2, "pinitChoice");
  563.       var1.removeObject(this.pfromwhereclause, var2, "pfromwhereclause");
  564.       return true;
  565.    }
  566.  
  567.    void loadItem(int var1) {
  568.       this.psortchoicetext.setText(this.psortChoiceText[var1]);
  569.       this.psortchoicesql.setText(this.psortChoiceSql[var1]);
  570.       this.psortorder.select(this.psortOrder[var1]);
  571.       if (this.pinitChoice.compareTo(this.psortChoiceText[var1]) == 0) {
  572.          this.pinitchoice.select("Yes");
  573.       } else {
  574.          this.pinitchoice.select("No");
  575.       }
  576.    }
  577.  
  578.    public void InitClass(JDPUser var1, Panel var2, String var3) {
  579.       super.user = var1;
  580.       this.moduleParameter = var3;
  581.       super.moduleName = "ListLayout";
  582.       if (var3.startsWith("JDPLayoutMgr:")) {
  583.          super.componentName = var3.substring(13);
  584.          this.moduleParameter = "";
  585.          var3 = "";
  586.       }
  587.  
  588.       ((Container)this).setLayout(new BorderLayout());
  589.       ((Component)this).setFont(var1.plainFont);
  590.       this.popuppanel = new JDPPopupMessage(var1, var2);
  591.       ((Container)var2).add(this.popuppanel);
  592.       Panel var4 = new Panel();
  593.       ((Container)var4).setLayout(new BorderLayout());
  594.       Panel var5 = new Panel();
  595.       ((Container)var5).setLayout(new BorderLayout());
  596.       Panel var6 = new Panel();
  597.       ((Container)var6).setLayout(new BorderLayout());
  598.       Panel var7 = new Panel();
  599.       ((Container)var7).setLayout(new BorderLayout());
  600.       Panel var8 = new Panel();
  601.       ((Container)var8).setLayout(new BorderLayout());
  602.       Panel var9 = new Panel();
  603.       ((Container)var9).setLayout(new BorderLayout());
  604.       Panel var10 = new Panel();
  605.       ((Container)var10).setLayout(new BorderLayout());
  606.       JDPScrollPanel var11 = new JDPScrollPanel();
  607.       JDPScrollPanel var12 = new JDPScrollPanel();
  608.       JDPScrollPanel var13 = new JDPScrollPanel();
  609.       JDPScrollPanel var14 = new JDPScrollPanel();
  610.       ((Container)var7).add("Center", new JDPChiselFramePanel(var1, "Result list style", var11, "North"));
  611.       ((Container)var8).add("Center", new JDPChiselFramePanel(var1, "Define the format of the tree", var12, "North"));
  612.       ((Container)var9).add("Center", new JDPChiselFramePanel(var1, "Define the order by pulldown", var13, "North"));
  613.       ((Container)var10).add("Center", new JDPChiselFramePanel(var1, "General settings", var14, "North"));
  614.       String[] var15 = new String[]{"Style", "Tree Definition", "Ordering", "General"};
  615.       Panel[] var16 = new Panel[]{var7, var8, var9, var10};
  616.       JDPTabSelectPanel var17 = new JDPTabSelectPanel(var1, var15, var16, "North");
  617.       this.useTree = new JDPComboBox(var1, "", 15);
  618.       this.useTree.setEditable(false);
  619.       this.useTree.addItem("Tree Structure");
  620.       this.useTree.addItem("List");
  621.       this.columns1 = new JDPList(var1);
  622.       this.columns1.setMinWidth(90);
  623.       this.columns1.setMinHeight(80);
  624.       this.includeTree = new JDPList(var1);
  625.       this.includeTree.setMinWidth(90);
  626.       this.includeTree.setMinHeight(80);
  627.       this.mainBranchText = new TextField("", 30);
  628.       this.mainBranchIcon = new JDPComboBox(var1, "", 15);
  629.       this.mainBranchIcon.setEditable(false);
  630.       this.mainIcon = new JDPComboBox(var1, "", 15);
  631.       this.mainIcon.setEditable(false);
  632.       this.iconlist = new JDPComboBox(var1, "", 10);
  633.       this.iconlist.setEditable(false);
  634.       String[] var18 = JDPTreePicker.getTreeIconList();
  635.  
  636.       for(int var19 = 0; var19 < var18.length; ++var19) {
  637.          this.mainBranchIcon.addItem(var18[var19]);
  638.          this.mainIcon.addItem(var18[var19]);
  639.          this.iconlist.addItem(var18[var19]);
  640.       }
  641.  
  642.       this.uniqueTree = new JDPList(var1);
  643.       this.uniqueTree.allowMultipleSelections(true);
  644.       this.uniqueTree.setMinWidth(90);
  645.       this.uniqueTree.setMinHeight(80);
  646.       this.treeMinWidth = new TextField("130", 7);
  647.       this.maxRows = new TextField("100", 10);
  648.       this.displayCount = new JDPComboBox(var1, "", 5);
  649.       this.displayCount.setEditable(false);
  650.       this.displayCount.addItem("Yes");
  651.       this.displayCount.addItem("No");
  652.       this.pcounttext = new TextField("Total Entries:", 15);
  653.       this.psortchoicetext = new TextField("", 20);
  654.       this.psortchoicesql = new TextField("", 20);
  655.       this.psortorder = new JDPComboBox(var1, "", 15);
  656.       this.psortorder.setEditable(false);
  657.       this.psortorder.addItem("Ascending");
  658.       this.psortorder.addItem("Descending");
  659.       this.pinitchoice = new JDPComboBox(var1, "", 5);
  660.       this.pinitchoice.setEditable(false);
  661.       this.pinitchoice.addItem("Yes");
  662.       this.pinitchoice.addItem("No");
  663.       this.pfromwhereclause = new TextField("(1=1)", 30);
  664.       ((Container)var11).add("Left", new JDPWrapLabel(var1, "Type of structure for results:"));
  665.       ((Container)var11).add("Right", this.useTree);
  666.       Panel var33 = new Panel();
  667.       ((Container)var33).setLayout(new BorderLayout());
  668.       ((Container)var33).add("Center", this.columns1);
  669.       Panel var20 = new Panel();
  670.       ((Container)var20).setLayout(new GridLayout(2, 1));
  671.       ((Container)var20).add(new JDPButton("  >  "));
  672.       ((Container)var20).add(new JDPButton("  <  "));
  673.       Panel var21 = new Panel();
  674.       ((Container)var21).setLayout(new BorderLayout());
  675.       ((Container)var21).add("Center", this.includeTree);
  676.       Panel var22 = new Panel();
  677.       ((Container)var22).setLayout(new BorderLayout());
  678.       ((Container)var22).add("North", this.iconlist);
  679.       Panel var23 = new Panel();
  680.       ((Container)var23).setLayout(new JDPLineLayout(1));
  681.       ((Container)var23).add("Left", var33);
  682.       ((Container)var23).add("Left", var20);
  683.       ((Container)var23).add("Left", var21);
  684.       ((Container)var23).add("Left", var22);
  685.       JDPScrollPanel var24 = new JDPScrollPanel();
  686.       ((Container)var24).add("Left", new JDPWrapLabel(var1, "Initial branch text:"));
  687.       ((Container)var24).add("Right", this.mainBranchText);
  688.       ((Container)var24).add("Left", new JDPWrapLabel(var1, "Initial branch icon:"));
  689.       ((Container)var24).add("Right", this.mainBranchIcon);
  690.       ((Container)var24).add("Left", new JDPWrapLabel(var1, "First branch icon:"));
  691.       ((Container)var24).add("Right", this.mainIcon);
  692.       ((Container)var24).add("Left", new JDPWrapLabel(var1, "Initial width of tree panel:"));
  693.       ((Container)var24).add("Right", this.treeMinWidth);
  694.       ((Container)var12).add("Left", var24);
  695.       ((Container)var12).add("Left", new JDPWrapLabel(var1, "Select the branch structure of the tree and the icons:"));
  696.       ((Container)var12).add("Left", var23);
  697.       Panel var25 = new Panel();
  698.       ((Container)var25).setLayout(new JDPLineLayout(3));
  699.       ((Container)var25).add("Left", new JDPWrapLabel(var1, "Unique key for branch in tree:"));
  700.       ((Container)var25).add("Right", this.uniqueTree);
  701.       ((Container)var12).add("Left", var25);
  702.       if (super.componentName.equals("")) {
  703.          ((Container)var14).add("Left", new JDPWrapLabel(var1, "Maximum result rows:"));
  704.          ((Container)var14).add("Right", this.maxRows);
  705.       }
  706.  
  707.       ((Container)var14).add("Left", new JDPWrapLabel(var1, "Display a list count:"));
  708.       ((Container)var14).add("Right", this.displayCount);
  709.       ((Container)var14).add("Left", new JDPWrapLabel(var1, "List count text:"));
  710.       ((Container)var14).add("Right", this.pcounttext);
  711.       ((Container)var13).add("Left", new JDPWrapLabel(var1, "Sort pulldown text:"));
  712.       ((Container)var13).add("Right", this.psortchoicetext);
  713.       ((Container)var11).add("Left", new JDPWrapLabel(var1, "SQL Select:"));
  714.       ((Container)var11).add("Right", this.psortchoicesql);
  715.       ((Container)var13).add("Left", new JDPWrapLabel(var1, "Sort Order:"));
  716.       ((Container)var13).add("Right", this.psortorder);
  717.       ((Container)var13).add("Left", new JDPWrapLabel(var1, "Make this the initial choice:"));
  718.       ((Container)var13).add("Right", this.pinitchoice);
  719.       ((Container)var14).add("Left", new JDPWrapLabel(var1, "Special Where Clause:"));
  720.       ((Container)var14).add("Right", this.pfromwhereclause);
  721.       ((Container)var6).add("Center", var17);
  722.       String[] var26 = new String[]{"Accept", "Reset"};
  723.       int[] var27 = new int[]{5, 6};
  724.       JDPButtons var28 = new JDPButtons(var1, var26, var27, JDPButtons.HORIZONTAL);
  725.       ((Container)var6).add("South", var28);
  726.       this.popuppanel.addComponent(var28.button[0], "Accept Selections", "Accept selections and proceed to next screen");
  727.       this.popuppanel.addComponent(var28.button[1], "Reset Selections", "Reset selections back to default settings");
  728.       ((Container)var4).add("Center", var6);
  729.       this.columns = new JDPList(var1);
  730.       this.columns.setSelectionsCheckboxes(true);
  731.       this.columns.allowMultipleSelections(true);
  732.       this.columns.setMinWidth(160);
  733.       Panel var29 = new Panel();
  734.       ((Container)var29).setLayout(new BorderLayout());
  735.       ((Container)var29).add("Center", this.columns);
  736.       ((Container)var4).add("West", var29);
  737.       Panel var30 = new Panel();
  738.       ((Container)var30).setLayout(new BorderLayout(4, 1));
  739.       ((Container)var30).add("West", new Label("Columns:", 0));
  740.       this.listCount = new Label("0      ", 0);
  741.       Panel var31 = new Panel();
  742.       ((Container)var31).setLayout(new BorderLayout(4, 1));
  743.       ((Container)var31).add("West", this.listCount);
  744.       ((Container)var31).add("Center", new Label(" ", 0));
  745.       ((Container)var30).add("Center", var31);
  746.       ((Container)var29).add("North", var30);
  747.       ((Container)this).add("Center", new JDPChiselFramePanel(var1, "Select the columns by which to order your search results", var4, "North"));
  748.       this.gParmObject = new Vector();
  749.       this.gParmObject.addElement(super.moduleName + super.componentName);
  750.       this.gParmObject.addElement(this);
  751.       var1.gParm.addElement(this.gParmObject);
  752.       ((Component)var2).paintAll(((Component)var2).getGraphics());
  753.    }
  754. }
  755.