home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / windowsxp / ftgateoffice / ftgateoffice.exe / Main / webhelp.jar / hhapplet / IndexPane.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-11-07  |  9.6 KB  |  600 lines

  1. package hhapplet;
  2.  
  3. import java.applet.Applet;
  4. import java.awt.BorderLayout;
  5. import java.awt.Button;
  6. import java.awt.Color;
  7. import java.awt.Component;
  8. import java.awt.Container;
  9. import java.awt.Cursor;
  10. import java.awt.Event;
  11. import java.awt.Font;
  12. import java.awt.Label;
  13. import java.awt.LayoutManager;
  14. import java.awt.List;
  15. import java.awt.Panel;
  16. import java.awt.TextField;
  17. import java.net.MalformedURLException;
  18. import java.net.URL;
  19. import java.util.Vector;
  20.  
  21. public class IndexPane extends Panel implements DialogDoneTarget, Runnable {
  22.    protected Applet m_applet;
  23.    protected Vector m_vSecondaryEntries = new Vector();
  24.    protected List m_list;
  25.    protected List m_listHolder;
  26.    protected IndexTree m_forapplelistHolder;
  27.    protected IndexTree m_forapplelist;
  28.    protected TextField m_tfEdit = new TextField();
  29.    protected Button m_btnDisplay = new Button(ResourceLib.GetRes("Display"));
  30.    protected IndexSecondaryDialog m_dlgSecondary;
  31.    protected int m_nSelectedIndex = -1;
  32.    protected Panel m_pnlEditArea = new Panel();
  33.    protected Label m_lblEditArea = new Label(ResourceLib.GetRes("IndexInputPrompt"));
  34.    protected LayoutManager m_layEditArea = new BorderLayout(0, 0);
  35.    protected boolean m_bIsIE4 = false;
  36.    protected boolean m_bIsNSWin16 = false;
  37.    protected boolean m_bIsNSWin32 = false;
  38.    protected boolean m_bIsIE3 = false;
  39.    protected boolean m_bMacOS = false;
  40.    protected boolean m_bUseForAppleList = false;
  41.    private BsscHelpRedirector m_rd = null;
  42.    int m_bResearch = 1;
  43.    private Object m_Cursor = null;
  44.    private LayoutManager m_layout;
  45.    private int[] m_charorder = null;
  46.    Thread m_textChangedThread = null;
  47.  
  48.    public boolean gotFocus(Event var1, Object var2) {
  49.       if (this.m_bUseForAppleList) {
  50.          if (var1.target != this.m_tfEdit && var1.target != this.m_forapplelist && var1.target != this.m_btnDisplay) {
  51.             this.m_tfEdit.requestFocus();
  52.          }
  53.       } else if (var1.target != this.m_tfEdit && var1.target != this.m_list && var1.target != this.m_btnDisplay) {
  54.          this.m_tfEdit.requestFocus();
  55.       }
  56.  
  57.       return true;
  58.    }
  59.  
  60.    public void HideList() {
  61.       if (this.m_bUseForAppleList) {
  62.          ((Container)this).add("Center", this.m_forapplelistHolder);
  63.          this.m_forapplelistHolder.show(true);
  64.          this.m_forapplelist.show(false);
  65.       } else {
  66.          ((Container)this).add("Center", this.m_listHolder);
  67.          this.m_listHolder.show(true);
  68.          this.m_list.show(false);
  69.       }
  70.  
  71.       ((Container)this).validate();
  72.    }
  73.  
  74.    public IndexTree getForAppleList() {
  75.       return this.m_forapplelistHolder;
  76.    }
  77.  
  78.    public void MoveSelectionDown() {
  79.    }
  80.  
  81.    public void dialogDone() {
  82.       this.m_dlgSecondary = null;
  83.    }
  84.  
  85.    public IndexPane(Applet var1, BsscHelpRedirector var2) {
  86.       this.m_applet = var1;
  87.       String var3 = ResourceLib.GetRes("langorder");
  88.       if (var3 != null) {
  89.          this.m_charorder = new int[256];
  90.          int var4 = 0;
  91.          int var5 = var3.indexOf(44, var4);
  92.  
  93.          for(int var6 = 0; var5 != -1; var5 = var3.indexOf(44, var4)) {
  94.             String var7 = var3.substring(var4, var5);
  95.             if (var7 != null) {
  96.                this.m_charorder[var6] = Integer.parseInt(var7);
  97.                ++var6;
  98.             }
  99.  
  100.             var4 = var5 + 1;
  101.          }
  102.       }
  103.  
  104.       this.m_rd = var2;
  105.  
  106.       try {
  107.          if (System.getProperty("os.name").startsWith("MacOS")) {
  108.             this.m_bMacOS = true;
  109.          }
  110.  
  111.          if (System.getProperty("java.vendor").startsWith("Netscape")) {
  112.             if (System.getProperty("os.name").startsWith("16-bit Windows")) {
  113.                this.m_bIsNSWin16 = true;
  114.             } else if (System.getProperty("os.name").startsWith("Windows")) {
  115.                if (System.getProperty("java.version").equalsIgnoreCase("1.02")) {
  116.                   this.m_bUseForAppleList = true;
  117.                }
  118.  
  119.                this.m_bIsNSWin32 = true;
  120.             } else if (System.getProperty("os.name").startsWith("Mac")) {
  121.                this.m_bUseForAppleList = true;
  122.             }
  123.          } else if (System.getProperty("java.vendor").startsWith("Microsoft")) {
  124.             if (System.getProperty("java.version").startsWith("1.1")) {
  125.                this.m_bIsIE4 = true;
  126.             } else {
  127.                this.m_bIsIE3 = true;
  128.             }
  129.  
  130.             if (System.getProperty("os.name").startsWith("Mac")) {
  131.                this.m_bUseForAppleList = true;
  132.             }
  133.  
  134.             if (System.getProperty("java.version").equalsIgnoreCase("1.1")) {
  135.                this.m_bUseForAppleList = true;
  136.             } else if (System.getProperty("java.version").equalsIgnoreCase("1.0.2")) {
  137.                this.m_bUseForAppleList = true;
  138.             }
  139.          }
  140.       } finally {
  141.          ;
  142.       }
  143.  
  144.       if (this.m_bUseForAppleList) {
  145.          this.m_forapplelist = new IndexTree(this);
  146.          this.m_forapplelistHolder = new IndexTree((IndexPane)null);
  147.          this.m_forapplelistHolder.addItem(ResourceLib.GetRes("LoadingIndex"));
  148.       } else {
  149.          this.m_list = new List();
  150.          this.m_listHolder = new List();
  151.          this.m_listHolder.addItem(ResourceLib.GetRes("LoadingIndex"));
  152.          this.m_listHolder.setBackground(Color.white);
  153.       }
  154.  
  155.       this.m_pnlEditArea.setLayout(this.m_layEditArea);
  156.       this.m_pnlEditArea.add("North", this.m_lblEditArea);
  157.       this.m_pnlEditArea.add("Center", this.m_tfEdit);
  158.       this.m_layout = new BorderLayout(2, 2);
  159.       ((Container)this).setLayout(this.m_layout);
  160.       if (!this.m_bUseForAppleList) {
  161.          this.m_list.setBackground(Color.white);
  162.       }
  163.  
  164.       int var12 = BsscFontFixPatch.GetFontSize();
  165.       if (!this.m_bUseForAppleList) {
  166.          this.m_list.setFont(new Font(BsscFontFixPatch.GetFontName(), 0, var12));
  167.       }
  168.  
  169.       this.m_tfEdit.setFont(new Font(BsscFontFixPatch.GetFontName(), 0, var12));
  170.       this.m_btnDisplay.setFont(new Font(BsscFontFixPatch.GetFontName(), 0, var12));
  171.       if (this.m_bUseForAppleList) {
  172.          ((Container)this).add("Center", this.m_forapplelistHolder);
  173.       } else {
  174.          ((Container)this).add("North", this.m_pnlEditArea);
  175.          ((Container)this).add("Center", this.m_listHolder);
  176.          ((Container)this).add("South", this.m_btnDisplay);
  177.       }
  178.  
  179.       this.m_tfEdit.requestFocus();
  180.    }
  181.  
  182.    public void add(String var1, Vector var2) {
  183.       if (this.m_bUseForAppleList) {
  184.          this.m_forapplelist.addItem(var1);
  185.       } else {
  186.          this.m_list.addItem(var1);
  187.       }
  188.  
  189.       this.m_vSecondaryEntries.addElement(var2);
  190.    }
  191.  
  192.    public boolean mouseUp(Event var1, int var2, int var3) {
  193.       return super.mouseUp(var1, var2, var3);
  194.    }
  195.  
  196.    private int compareString(String var1, String var2) {
  197.       if (this.m_charorder == null) {
  198.          String var5 = var1.toLowerCase();
  199.          String var4 = var2.toLowerCase();
  200.          return var5.compareTo(var4);
  201.       } else {
  202.          for(int var3 = 0; var3 < var1.length() && var3 < var2.length(); ++var3) {
  203.             if (this.m_charorder[var1.charAt(var3)] < this.m_charorder[var2.charAt(var3)]) {
  204.                return -1;
  205.             }
  206.  
  207.             if (this.m_charorder[var1.charAt(var3)] > this.m_charorder[var2.charAt(var3)]) {
  208.                return 1;
  209.             }
  210.          }
  211.  
  212.          if (var1.length() < var2.length()) {
  213.             return -1;
  214.          } else {
  215.             return var1.length() > var2.length() ? 1 : 0;
  216.          }
  217.       }
  218.    }
  219.  
  220.    public List getList() {
  221.       return this.m_list;
  222.    }
  223.  
  224.    public void MoveSelectionPageDown() {
  225.    }
  226.  
  227.    public int FindBaseKeywordForAppleList(int var1, int var2) {
  228.       while(var1 > 0 && var2 < 0 || var1 < this.m_forapplelist.countItems() - 1 && var2 > 0) {
  229.          if (this.m_forapplelist.getItem(var1).charAt(0) != ' ') {
  230.             return var1;
  231.          }
  232.  
  233.          var1 += var2;
  234.       }
  235.  
  236.       return var1;
  237.    }
  238.  
  239.    public void ShowList() {
  240.       if (this.m_bUseForAppleList) {
  241.          ((Container)this).add("North", this.m_pnlEditArea);
  242.          ((Container)this).add("Center", this.m_forapplelist);
  243.          ((Container)this).add("South", this.m_btnDisplay);
  244.          this.m_forapplelist.show(true);
  245.          this.m_forapplelistHolder.show(false);
  246.       } else {
  247.          if (!System.getProperty("java.vendor").startsWith("Netscape")) {
  248.             ((Container)this).add("North", this.m_pnlEditArea);
  249.          }
  250.  
  251.          ((Container)this).add("Center", this.m_list);
  252.          ((Container)this).add("South", this.m_btnDisplay);
  253.          this.m_list.show(true);
  254.          this.m_listHolder.show(false);
  255.       }
  256.  
  257.       ((Container)this).validate();
  258.    }
  259.  
  260.    public TextField getEditBox() {
  261.       return this.m_tfEdit;
  262.    }
  263.  
  264.    public boolean keyUp(Event var1, int var2) {
  265.       if ((var1.target == this.m_forapplelist || var1.target == this.m_list) && System.getProperty("java.version").equals("1.1") && System.getProperty("java.vendor").startsWith("Microsoft") && var1.key == 10) {
  266.          this.action(var1, var1.target);
  267.          return true;
  268.       } else if (var1.target == this.m_tfEdit && System.getProperty("java.version").equals("1.1") && System.getProperty("java.vendor").startsWith("Microsoft") && var1.key == 10) {
  269.          this.action(var1, var1.target);
  270.          return true;
  271.       } else {
  272.          if (this.m_bIsNSWin16) {
  273.             var2 &= 255;
  274.          }
  275.  
  276.          boolean var3 = super.keyUp(var1, var2);
  277.          if ((var2 == 8 || var2 >= 32 && var2 <= 126) && var1.target == this.m_tfEdit) {
  278.             try {
  279.                this.textChanged();
  280.                if (var1.target == this.m_tfEdit) {
  281.                   this.m_tfEdit.requestFocus();
  282.                }
  283.             } finally {
  284.                ;
  285.             }
  286.          }
  287.  
  288.          return var3;
  289.       }
  290.    }
  291.  
  292.    public boolean GetUseForAppleListFlag() {
  293.       return this.m_bUseForAppleList;
  294.    }
  295.  
  296.    public void ResetCursor() {
  297.       if (!System.getProperty("java.version").startsWith("1.0") && (System.getProperty("java.vendor").indexOf("Netscape") == -1 || !System.getProperty("java.version").startsWith("1.1.2"))) {
  298.          if (this.m_Cursor != null) {
  299.             try {
  300.                ((Component)this).setCursor((Cursor)this.m_Cursor);
  301.             } catch (Exception var1) {
  302.             }
  303.  
  304.             this.m_Cursor = null;
  305.          }
  306.  
  307.       }
  308.    }
  309.  
  310.    public void gotoSelectedIndex() {
  311.       int var1 = -1;
  312.       if (this.m_bUseForAppleList) {
  313.          var1 = this.m_forapplelist.getSelectedIndex();
  314.       } else {
  315.          var1 = this.m_list.getSelectedIndex();
  316.       }
  317.  
  318.       if (var1 != -1) {
  319.          if (((Vector)this.m_vSecondaryEntries.elementAt(var1)).size() == 1) {
  320.             IndexSecondaryEntry var2 = (IndexSecondaryEntry)((Vector)this.m_vSecondaryEntries.elementAt(var1)).elementAt(0);
  321.             if (var2.see_also != null) {
  322.                for(int var7 = 0; var7 < this.m_vSecondaryEntries.size(); ++var7) {
  323.                   if (((Vector)this.m_vSecondaryEntries.elementAt(var7)).size() == 1) {
  324.                      IndexSecondaryEntry var9 = (IndexSecondaryEntry)((Vector)this.m_vSecondaryEntries.elementAt(var7)).elementAt(0);
  325.                      if (var9.name.equals(var2.see_also)) {
  326.                         if (this.m_bUseForAppleList) {
  327.                            this.m_forapplelist.select(var7);
  328.                            if (var7 > 0) {
  329.                               this.m_forapplelist.setTopIndex(var7 - 1);
  330.                            } else {
  331.                               this.m_forapplelist.setTopIndex(var7);
  332.                            }
  333.  
  334.                            this.gotoSelectedIndex();
  335.                            return;
  336.                         }
  337.  
  338.                         if (this.m_list.getVisibleIndex() != var7) {
  339.                            this.m_list.makeVisible(this.m_forapplelist.countItems() - 1);
  340.                            if (var7 > 0) {
  341.                               this.m_list.makeVisible(var7 - 1);
  342.                            } else {
  343.                               this.m_list.makeVisible(var7);
  344.                            }
  345.                         }
  346.  
  347.                         this.m_list.select(var7);
  348.                         this.gotoSelectedIndex();
  349.                         return;
  350.                      }
  351.                   }
  352.                }
  353.  
  354.             } else {
  355.                try {
  356.                   URL var3 = URLFileHandler.makeURL(this.m_applet.getDocumentBase(), var2.local, var2.url);
  357.                   String var4 = var3.toString();
  358.                   if (var4.indexOf("file:/\\\\") == 0) {
  359.                      var4 = "file://" + var4.substring(8);
  360.                      var3 = new URL(var4);
  361.                   }
  362.  
  363.                   this.m_rd.showDoc(var3, var2.frame);
  364.                } catch (MalformedURLException var5) {
  365.                   ((Throwable)var5).printStackTrace();
  366.                }
  367.             }
  368.          } else {
  369.             if (this.m_dlgSecondary != null) {
  370.                this.m_dlgSecondary.closeDialog();
  371.                this.m_dlgSecondary = null;
  372.             }
  373.  
  374.             this.m_dlgSecondary = new IndexSecondaryDialog(this.m_applet, (Vector)this.m_vSecondaryEntries.elementAt(var1), this, this.m_rd);
  375.             this.m_dlgSecondary.showTopic();
  376.             this.m_dlgSecondary.getList().requestFocus();
  377.          }
  378.       }
  379.    }
  380.  
  381.    public void SetWaitCursor() {
  382.       if (!System.getProperty("java.version").startsWith("1.0") && (System.getProperty("java.vendor").indexOf("Netscape") == -1 || !System.getProperty("java.version").startsWith("1.1.2"))) {
  383.          try {
  384.             this.m_Cursor = ((Component)this).getCursor();
  385.             ((Component)this).setCursor(new Cursor(3));
  386.          } catch (Exception var1) {
  387.          }
  388.       }
  389.    }
  390.  
  391.    public int FindBaseKeyword(int var1, int var2) {
  392.       while(var1 > 0 && var2 < 0 || var1 < this.m_list.countItems() - 1 && var2 > 0) {
  393.          if (this.m_list.getItem(var1).charAt(0) != ' ') {
  394.             return var1;
  395.          }
  396.  
  397.          var1 += var2;
  398.       }
  399.  
  400.       return var1;
  401.    }
  402.  
  403.    protected void finalize() throws Throwable {
  404.       if (this.m_bUseForAppleList) {
  405.          this.m_forapplelist.clear();
  406.          this.m_forapplelist = null;
  407.       } else {
  408.          this.m_list.clear();
  409.          this.m_list = null;
  410.       }
  411.  
  412.       super.finalize();
  413.    }
  414.  
  415.    public boolean action(Event var1, Object var2) {
  416.       this.gotoSelectedIndex();
  417.       return true;
  418.    }
  419.  
  420.    public void run() {
  421.       try {
  422.          while(true) {
  423.             if (this.m_bResearch <= 0) {
  424.                try {
  425.                   Thread.sleep(100L);
  426.                } catch (InterruptedException var8) {
  427.                   ((Throwable)var8).printStackTrace();
  428.                }
  429.             } else {
  430.                String var1 = this.m_tfEdit.getText().toUpperCase();
  431.                int var2 = var1.length();
  432.                if (var2 > 0) {
  433.                   if (this.m_bUseForAppleList) {
  434.                      int var3 = 0;
  435.                      int var4 = this.FindBaseKeywordForAppleList(this.m_forapplelist.countItems() - 1, -1);
  436.  
  437.                      int var5;
  438.                      for(var5 = this.FindBaseKeywordForAppleList((this.m_forapplelist.countItems() - 1) / 2, -1); var3 < var4; var5 = this.FindBaseKeywordForAppleList((var3 + var4) / 2, -1)) {
  439.                         String var6 = this.m_forapplelist.getItem(var5).toUpperCase();
  440.                         int var7 = this.compareString(var6, var1);
  441.                         if (var7 > 0) {
  442.                            var4 = var5;
  443.                         } else if (var7 < 0) {
  444.                            var3 = this.FindBaseKeywordForAppleList(var5 + 1, 1);
  445.                         } else {
  446.                            var3 = var5;
  447.                            var4 = var5;
  448.                         }
  449.                      }
  450.  
  451.                      while(var5 > 0) {
  452.                         String var13 = this.m_forapplelist.getItem(var5 - 1);
  453.                         int var16 = this.compareString(var13, var1);
  454.                         if (var16 != 0) {
  455.                            break;
  456.                         }
  457.  
  458.                         --var5;
  459.                      }
  460.  
  461.                      this.m_forapplelist.getItem(var5).toUpperCase();
  462.                      if (var5 > this.m_forapplelist.countItems() - 1) {
  463.                         var5 = this.m_forapplelist.countItems() - 1;
  464.                      }
  465.  
  466.                      if (var5 < 0) {
  467.                         var5 = 0;
  468.                      }
  469.  
  470.                      if (var5 != this.m_nSelectedIndex) {
  471.                         this.m_forapplelist.makeVisible(this.m_forapplelist.countItems() - 1);
  472.                         if (var5 > 0) {
  473.                            this.m_forapplelist.makeVisible(var5 - 1);
  474.                         } else {
  475.                            this.m_forapplelist.makeVisible(var5);
  476.                         }
  477.  
  478.                         this.m_forapplelist.getVisibleIndex();
  479.                         this.m_forapplelist.select(var5);
  480.                         this.m_nSelectedIndex = var5;
  481.                      }
  482.  
  483.                      this.m_applet.showStatus(this.m_forapplelist.getSelectedItem());
  484.                   } else {
  485.                      int var10 = 0;
  486.                      int var11 = this.FindBaseKeyword(this.m_list.countItems() - 1, -1);
  487.  
  488.                      int var12;
  489.                      for(var12 = this.FindBaseKeyword((this.m_list.countItems() - 1) / 2, -1); var10 < var11; var12 = this.FindBaseKeyword((var10 + var11) / 2, -1)) {
  490.                         String var14 = this.m_list.getItem(var12).toUpperCase();
  491.                         int var17 = this.compareString(var14, var1);
  492.                         if (var17 > 0) {
  493.                            var11 = var12;
  494.                         } else if (var17 < 0) {
  495.                            var10 = this.FindBaseKeyword(var12 + 1, 1);
  496.                         } else {
  497.                            var10 = var12;
  498.                            var11 = var12;
  499.                         }
  500.                      }
  501.  
  502.                      while(var12 > 0) {
  503.                         String var15 = this.m_list.getItem(var12 - 1);
  504.                         int var18 = this.compareString(var15, var1);
  505.                         if (var18 != 0) {
  506.                            break;
  507.                         }
  508.  
  509.                         --var12;
  510.                      }
  511.  
  512.                      this.m_list.getItem(var12).toUpperCase();
  513.                      if (var12 > this.m_list.countItems() - 1) {
  514.                         var12 = this.m_list.countItems() - 1;
  515.                      }
  516.  
  517.                      if (var12 < 0) {
  518.                         var12 = 0;
  519.                      }
  520.  
  521.                      if (var12 != this.m_nSelectedIndex) {
  522.                         this.m_list.makeVisible(this.m_list.countItems() - 1);
  523.                         if (var12 > 0) {
  524.                            this.m_list.makeVisible(var12 - 1);
  525.                         } else {
  526.                            this.m_list.makeVisible(var12);
  527.                         }
  528.  
  529.                         this.m_list.getVisibleIndex();
  530.                         this.m_list.select(var12);
  531.                         this.m_nSelectedIndex = var12;
  532.                      }
  533.  
  534.                      this.m_applet.showStatus(this.m_list.getSelectedItem());
  535.                   }
  536.                }
  537.  
  538.                this.m_bResearch += -1;
  539.             }
  540.          }
  541.       } catch (Exception var9) {
  542.          ((Throwable)var9).printStackTrace();
  543.       }
  544.    }
  545.  
  546.    public boolean handleEvent(Event var1) {
  547.       if (var1.id == 401 && var1.key == 9 && System.getProperty("java.vendor").startsWith("Netscape") && System.getProperty("java.version").startsWith("1.1.2")) {
  548.          ((Component)this).nextFocus();
  549.          return true;
  550.       } else if (System.getProperty("java.version").startsWith("1.1.5") && this.m_bIsNSWin32 && var1.id == 401 && var1.key == 10 && var1.target == this.m_btnDisplay) {
  551.          this.action(var1, var1.target);
  552.          return true;
  553.       } else if (this.m_bIsIE4 && var1.id == 1001 && var1.target == this.m_tfEdit) {
  554.          return true;
  555.       } else {
  556.          if (var1.target == this.m_list) {
  557.             if (var1.id == 701 && this.m_list.getSelectedIndex() != this.m_nSelectedIndex) {
  558.                this.m_nSelectedIndex = this.m_list.getSelectedIndex();
  559.                String var2 = this.m_list.getItem(this.m_nSelectedIndex);
  560.                if (var2 != null) {
  561.                   var2 = var2.trim();
  562.                   this.m_tfEdit.setText(var2);
  563.                   this.m_applet.showStatus(var2);
  564.                }
  565.             }
  566.          } else if (var1.target == this.m_tfEdit && var1.id == 401 && var1.key == 10 && (!System.getProperty("java.version").equals("1.1") || !System.getProperty("java.vendor").startsWith("Microsoft")) && !System.getProperty("java.vendor").startsWith("Netscape")) {
  567.             this.action(var1, var1.target);
  568.             return true;
  569.          }
  570.  
  571.          return super.handleEvent(var1);
  572.       }
  573.    }
  574.  
  575.    public void textChanged() {
  576.       if (this.m_textChangedThread == null) {
  577.          this.m_textChangedThread = new Thread(this);
  578.          this.m_textChangedThread.setPriority(4);
  579.          this.m_textChangedThread.start();
  580.       } else {
  581.          ++this.m_bResearch;
  582.       }
  583.    }
  584.  
  585.    public void MoveSelectionUp() {
  586.    }
  587.  
  588.    public void MoveSelectionPageUp() {
  589.    }
  590.  
  591.    public boolean keyDown(Event var1, int var2) {
  592.       if ((var1.target == this.m_forapplelist || var1.target == this.m_list) && (!System.getProperty("java.version").equals("1.1") || !System.getProperty("java.vendor").startsWith("Microsoft")) && var1.key == 10) {
  593.          this.action(var1, var1.target);
  594.          return true;
  595.       } else {
  596.          return super.keyDown(var1, var2);
  597.       }
  598.    }
  599. }
  600.