CursorPanel(Cursor value) {
      setLayout(new java.awt.GridBagLayout());
      java.awt.GridBagConstraints gridBagConstraints1;
      list = new JList(new java.util.Vector(CURSOR_TYPES.keySet()));
      list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
      if (value != null) list.setSelectedValue(value.getName(), true);

      gridBagConstraints1 = new java.awt.GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 1;
      gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints1.insets = new java.awt.Insets(8, 8, 8, 8);
      gridBagConstraints1.weightx = 1.0;
      gridBagConstraints1.weighty = 1.0;
      add(list, gridBagConstraints1);

      gridBagConstraints1 = new java.awt.GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      gridBagConstraints1.insets = new java.awt.Insets(8, 8, 0, 8);
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
      add(
          new JLabel(
              org.openide.util.NbBundle.getBundle(CursorEditor.class)
                  .getString("CTL_SelectCursorName")),
          gridBagConstraints1);
    }
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    plateName = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    barCode = new javax.swing.JTextField();
    makePlate = new javax.swing.JButton();
    plateCancel = new javax.swing.JButton();
    jComboBoxAuthor = new javax.swing.JComboBox();
    jComboBoxPlateType = new javax.swing.JComboBox();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    location = new javax.swing.JTextField();

    jLabel1.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.jLabel1.text")); // NOI18N

    plateName.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.plateName.text")); // NOI18N
    plateName.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            plateNameActionPerformed(evt);
          }
        });

    jLabel2.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.jLabel2.text")); // NOI18N

    barCode.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.barCode.text")); // NOI18N

    makePlate.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.makePlate.text")); // NOI18N
    makePlate.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            makePlateActionPerformed(evt);
          }
        });

    plateCancel.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.plateCancel.text")); // NOI18N
    plateCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            plateCancelActionPerformed(evt);
          }
        });

    jLabel3.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.jLabel3.text")); // NOI18N

    jLabel4.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.jLabel4.text")); // NOI18N

    jLabel5.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.jLabel5.text")); // NOI18N

    location.setText(
        org.openide.util.NbBundle.getMessage(
            PlateConfigPanel.class, "PlateConfigPanel.location.text")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(22, 22, 22)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(makePlate)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel1)
                                            .addComponent(jLabel2)
                                            .addComponent(jLabel4)
                                            .addComponent(jLabel5))
                                    .addGap(96, 96, 96)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                location,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                110,
                                                Short.MAX_VALUE)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.TRAILING,
                                                        false)
                                                    .addComponent(
                                                        jComboBoxPlateType,
                                                        0,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        Short.MAX_VALUE)
                                                    .addComponent(
                                                        jComboBoxAuthor,
                                                        0,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        Short.MAX_VALUE)
                                                    .addComponent(
                                                        barCode,
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(
                                                        plateName,
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        110,
                                                        Short.MAX_VALUE)
                                                    .addComponent(
                                                        plateCancel,
                                                        javax.swing.GroupLayout.Alignment
                                                            .LEADING)))))
                    .addGap(91, 91, 91)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(43, 43, 43)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(
                                plateName,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(
                                barCode,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(20, 20, 20)
                                    .addComponent(jLabel5))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        location,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(23, 23, 23)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(
                                jComboBoxAuthor,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(
                                jComboBoxPlateType,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(makePlate)
                            .addComponent(plateCancel))
                    .addContainerGap()));
  } // </editor-fold>//GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jLabel1 = new javax.swing.JLabel();
    projectLocation = new javax.swing.JTextField();
    sourceRootsPanel = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    sourceRoots = new ResizableRowHeightTable();
    addSourceRoot = new javax.swing.JButton();
    removeSourceRoot = new javax.swing.JButton();
    upSourceRoot = new javax.swing.JButton();
    downSourceRoot = new javax.swing.JButton();
    testRootsPanel = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    testRoots = new ResizableRowHeightTable();
    addTestRoot = new javax.swing.JButton();
    removeTestRoot = new javax.swing.JButton();
    upTestRoot = new javax.swing.JButton();
    downTestRoot = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    sourceLevel = new javax.swing.JComboBox();
    includeExcludeButton = new javax.swing.JButton();
    jLabel5 = new javax.swing.JLabel();
    encoding = new javax.swing.JComboBox();
    jPanel2 = new javax.swing.JPanel();

    setLayout(new java.awt.GridBagLayout());

    jLabel1.setDisplayedMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_ProjectFolder")
            .charAt(0));
    jLabel1.setLabelFor(projectLocation);
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle"); // NOI18N
    jLabel1.setText(bundle.getString("CTL_ProjectFolder")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
    add(jLabel1, gridBagConstraints);

    projectLocation.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    add(projectLocation, gridBagConstraints);
    projectLocation
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizerSources_projectLocation")); // NOI18N

    sourceRootsPanel.setLayout(new java.awt.GridBagLayout());

    jLabel2.setDisplayedMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_SourceRoots")
            .charAt(0));
    jLabel2.setLabelFor(sourceRoots);
    jLabel2.setText(bundle.getString("CTL_SourceRoots")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
    sourceRootsPanel.add(jLabel2, gridBagConstraints);

    jScrollPane1.setPreferredSize(new java.awt.Dimension(450, 150));

    sourceRoots.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {
              {null, null},
              {null, null},
              {null, null},
              {null, null}
            },
            new String[] {"Package Folder", "Label"}) {
          Class[] types = new Class[] {java.lang.Object.class, java.lang.String.class};
          boolean[] canEdit = new boolean[] {false, false};

          public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
          }

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    jScrollPane1.setViewportView(sourceRoots);
    sourceRoots
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_sourceRoots")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 0.5;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
    sourceRootsPanel.add(jScrollPane1, gridBagConstraints);

    addSourceRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_AddSourceRoot")
            .charAt(0));
    addSourceRoot.setText(bundle.getString("CTL_AddSourceRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    sourceRootsPanel.add(addSourceRoot, gridBagConstraints);
    addSourceRoot
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_addSourceRoot")); // NOI18N

    removeSourceRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_RemoveSourceRoot")
            .charAt(0));
    removeSourceRoot.setText(bundle.getString("CTL_RemoveSourceRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
    sourceRootsPanel.add(removeSourceRoot, gridBagConstraints);
    removeSourceRoot
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizerSources_removeSourceRoot")); // NOI18N

    upSourceRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_UpSourceRoot")
            .charAt(0));
    upSourceRoot.setText(bundle.getString("CTL_UpSourceRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    sourceRootsPanel.add(upSourceRoot, gridBagConstraints);
    upSourceRoot
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_upSourceRoot")); // NOI18N

    downSourceRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_DownSourceRoot")
            .charAt(0));
    downSourceRoot.setText(bundle.getString("CTL_DownSourceRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
    sourceRootsPanel.add(downSourceRoot, gridBagConstraints);
    downSourceRoot
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizerSources_downSourceRoot")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 0.45;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    add(sourceRootsPanel, gridBagConstraints);

    testRootsPanel.setLayout(new java.awt.GridBagLayout());

    jLabel3.setDisplayedMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_TestRoots")
            .charAt(0));
    jLabel3.setLabelFor(testRoots);
    jLabel3.setText(bundle.getString("CTL_TestRoots")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
    testRootsPanel.add(jLabel3, gridBagConstraints);

    jScrollPane2.setPreferredSize(new java.awt.Dimension(450, 150));

    testRoots.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {
              {null, null},
              {null, null},
              {null, null},
              {null, null}
            },
            new String[] {"Package Folder", "Label"}) {
          Class[] types = new Class[] {java.lang.Object.class, java.lang.String.class};
          boolean[] canEdit = new boolean[] {false, false};

          public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
          }

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    jScrollPane2.setViewportView(testRoots);
    testRoots
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_testRoots")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 0.5;
    testRootsPanel.add(jScrollPane2, gridBagConstraints);

    addTestRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_AddTestRoot")
            .charAt(0));
    addTestRoot.setText(bundle.getString("CTL_AddTestRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 6, 0);
    testRootsPanel.add(addTestRoot, gridBagConstraints);
    addTestRoot
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_addTestRoot")); // NOI18N

    removeTestRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_RemoveTestRoot")
            .charAt(0));
    removeTestRoot.setText(bundle.getString("CTL_RemoveTestRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 12, 0);
    testRootsPanel.add(removeTestRoot, gridBagConstraints);
    removeTestRoot
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizerSources_removeTestRoot")); // NOI18N

    upTestRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_UpTestRoot")
            .charAt(0));
    upTestRoot.setText(bundle.getString("CTL_UpTestRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 6, 0);
    testRootsPanel.add(upTestRoot, gridBagConstraints);
    upTestRoot
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_upTestRoot")); // NOI18N

    downTestRoot.setMnemonic(
        java.util.ResourceBundle.getBundle(
                "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle")
            .getString("MNE_DownTestRoot")
            .charAt(0));
    downTestRoot.setText(bundle.getString("CTL_DownTestRoot")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
    testRootsPanel.add(downTestRoot, gridBagConstraints);
    downTestRoot
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizerSources_downTestRoot")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 0.45;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    add(testRootsPanel, gridBagConstraints);

    jPanel1.setLayout(new java.awt.GridBagLayout());

    jLabel4.setLabelFor(sourceLevel);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel4, bundle.getString("TXT_SourceLevel")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
    jPanel1.add(jLabel4, gridBagConstraints);

    sourceLevel.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"1.4", "1.5"}));
    sourceLevel.setMinimumSize(this.sourceLevel.getPreferredSize());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    jPanel1.add(sourceLevel, gridBagConstraints);
    sourceLevel
        .getAccessibleContext()
        .setAccessibleName(bundle.getString("AN_SourceLevel")); // NOI18N
    sourceLevel
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_SourceLevel")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        includeExcludeButton,
        org.openide.util.NbBundle.getMessage(
            CustomizerSources.class, "CustomizerSources.includeExcludeButton")); // NOI18N
    includeExcludeButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            includeExcludeButtonActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    jPanel1.add(includeExcludeButton, gridBagConstraints);
    includeExcludeButton
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerSources.class, "AD_CustomizerSources_Include")); // NOI18N

    jLabel5.setLabelFor(encoding);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel5,
        org.openide.util.NbBundle.getMessage(CustomizerSources.class, "TXT_Encoding")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(8, 0, 0, 12);
    jPanel1.add(jLabel5, gridBagConstraints);
    jLabel5
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerSources.class, "AD_CustomizerSources_Encoding")); // NOI18N

    encoding.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"Item 1", "Item 2", "Item 3", "Item 4"}));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(8, 0, 0, 0);
    jPanel1.add(encoding, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    jPanel1.add(jPanel2, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    add(jPanel1, gridBagConstraints);
  } // </editor-fold>//GEN-END:initComponents
/**
 * Main Corona debugger class
 *
 * @author Jan Jancura
 * @version 0.47, May 26, 1998
 */
public class JPDADebugger extends AbstractDebugger implements Executor {

  // static ........................................................................

  static final long serialVersionUID = 2797853329739651906L;

  /** bundle to obtain text information from */
  static ResourceBundle bundle = org.openide.util.NbBundle.getBundle(JPDADebugger.class);

  private static CoreBreakpoint.Event[] breakpointEvents;
  private static CoreBreakpoint.Action[] breakpointActions;
  private static Random random = new Random();

  static {
    breakpointEvents =
        new CoreBreakpoint.Event[] {
          //      new InstanceCounter (),
          new LineBreakpoint(),
          new MethodBreakpoint(),
          new ExceptionBreakpoint(),
          new VariableBreakpoint(),
          new ThreadBreakpoint(),
          new ClassBreakpoint()
        };
    breakpointActions = new CoreBreakpoint.Action[] {};
  }

  // variables .................................................................

  transient VirtualMachine virtualMachine = null;
  transient EventRequestManager requestManager = null;
  protected transient ThreadManager threadManager;
  protected transient Operator operator;
  private transient Process process;
  transient StepRequest stepRequest;
  private transient MethodEntryRequest findSourceMER;
  private transient StepRequest findSourceSR;
  private transient int findSourceCounter = 0;
  private transient Thread debuggerThread;

  private transient AttachingConnector connector;
  private transient Map args;
  private transient String mainClassName;
  private transient String stopClassName;

  // threads
  private transient JPDAThread currentThread = null;
  protected transient JPDAThreadGroup threadGroup = new JPDAThreadGroup(null);

  private transient boolean stopOnMain = false;
  private transient DebuggerInfo debuggerInfo;

  private static transient String[] stopMethodNames = {"main", "start", "init", "<init>"}; // NOI18N
  private transient CoreBreakpoint[] breakpointMain = null;

  // init .......................................................................

  public JPDADebugger() {
    this(false, null);
  }

  public JPDADebugger(boolean multisession, Validator validator) {
    super(multisession, validator);
  }

  /** Deserializes debugger. */
  protected void setDebugger(AbstractDebugger debugger) {
    super.setDebugger(debugger);
  }

  // Debugger implementation .................................................................

  /**
   * Starts the debugger. The method stops the current debugging (if any) and takes information from
   * the provided info (containing the class to start and arguments to pass it and name of class to
   * stop debugging in) and starts new debugging session.
   *
   * @param info debugger info about class to start
   * @exception DebuggerException if an error occures during the start of the debugger
   */
  public void startDebugger(DebuggerInfo info) throws DebuggerException {
    debuggerInfo = info;
    if (virtualMachine != null) finishDebugger();

    stopOnMain = info.getStopClassName() != null;
    mainClassName =
        info
            .getClassName(); // S ystem.out.println ("JPDADebugger stop on " + info.getStopClassName
                             // ()); // NOI18N

    // open output window ...
    super.startDebugger(info);

    // stop on main
    if (stopOnMain) {
      try {
        String stopClassName = debuggerInfo.getStopClassName();
        AbstractDebugger d = (AbstractDebugger) TopManager.getDefault().getDebugger();
        breakpointMain = new CoreBreakpoint[stopMethodNames.length];
        for (int x = 0; x < breakpointMain.length; x++) {
          breakpointMain[x] = (CoreBreakpoint) d.createBreakpoint(true);
          breakpointMain[x].setClassName(""); // NOI18N
          breakpointMain[x].setMethodName(stopMethodNames[x]); // NOI18N
          CoreBreakpoint.Action[] a = breakpointMain[x].getActions();
          int i, ii = a.length;
          for (i = 0; i < ii; i++)
            if (a[i] instanceof PrintAction) {
              ((PrintAction) a[i]).setPrintText(bundle.getString("CTL_Stop_On_Main_print_text"));
            }
          breakpointMain[x].setClassName(stopClassName);
        }

        addPropertyChangeListener(
            new PropertyChangeListener() {
              public void propertyChange(PropertyChangeEvent ev) {
                if (ev.getPropertyName().equals(PROP_STATE)) {
                  if ((((Integer) ev.getNewValue()).intValue() == DEBUGGER_STOPPED)
                      || (((Integer) ev.getNewValue()).intValue() == DEBUGGER_NOT_RUNNING)) {
                    if (breakpointMain != null) {
                      for (int x = 0; x < breakpointMain.length; x++) breakpointMain[x].remove();
                      breakpointMain = null;
                    }
                    removePropertyChangeListener(this);
                  }
                }
              }
            });

      } catch (DebuggerException e) {
        e.printStackTrace();
      }
    }

    // start & init remote debugger ............................................
    boolean launch = false;
    if (info instanceof ReconnectDebuggerInfo) {
      virtualMachine = reconnect((ReconnectDebuggerInfo) info);
    } else if (info instanceof RemoteDebuggerInfo) {
      virtualMachine = connect((RemoteDebuggerInfo) info);
    } else {
      virtualMachine = launch(info);
      process = virtualMachine.process();
      showOutput(process, STD_OUT, STD_OUT);
      connectInput(process);
      launch = true;
    }
    requestManager = virtualMachine.eventRequestManager();
    operator =
        new Operator(
            virtualMachine,
            launch
                ? new Runnable() {
                  public void run() {
                    startDebugger();
                  }
                }
                : null,
            new Runnable() {
              public void run() {
                try {
                  finishDebugger();
                } catch (DebuggerException e) {
                }
              }
            });
    operator.start();
    if (!launch) startDebugger();
  }

  /** Finishes debugger. */
  public void finishDebugger() throws DebuggerException {
    if (breakpointMain != null) {
      for (int x = 0; x < breakpointMain.length; x++) breakpointMain[x].remove();
      breakpointMain = null;
    }
    try {
      if (virtualMachine != null) virtualMachine.exit(0);
    } catch (VMDisconnectedException e) {
    }
    if (threadManager != null) threadManager.finish();
    if (debuggerThread != null) {
      debuggerThread.interrupt();
      debuggerThread.stop();
    }
    super.finishDebugger();
  }

  /** Trace into. */
  public synchronized void traceInto() throws DebuggerException {
    if (virtualMachine == null) return;
    removeStepRequest();
    try {
      setLastAction(ACTION_TRACE_INTO);
      stepRequest =
          requestManager.createStepRequest(
              currentThread.getThreadReference(), StepRequest.STEP_LINE, StepRequest.STEP_INTO);
      stepRequest.addCountFilter(1);
      stepRequest.putProperty("traceInto", "traceInto"); // NOI18N
      stepRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
      operator.register(stepRequest, this);
      stepRequest.enable();
      virtualMachine.resume();
      super.traceInto();
    } catch (DuplicateRequestException e) {
      e.printStackTrace();
    }
  }

  /** Trace over. */
  public synchronized void traceOver() throws DebuggerException {
    if (virtualMachine == null) return;
    removeStepRequest();
    try {
      setLastAction(ACTION_TRACE_OVER);
      stepRequest =
          requestManager.createStepRequest(
              currentThread.getThreadReference(), StepRequest.STEP_LINE, StepRequest.STEP_OVER);
      stepRequest.addCountFilter(1);
      stepRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
      operator.register(stepRequest, this);
      stepRequest.enable();
      virtualMachine.resume();
      super.traceOver();
    } catch (DuplicateRequestException e) {
      e.printStackTrace();
    }
  }

  /** Go. */
  public synchronized void go() throws DebuggerException {
    if (virtualMachine == null) return;
    setLastAction(ACTION_GO);
    removeStepRequest();
    virtualMachine.resume();
    threadGroup.refresh();
    super.go();
  }

  /** Step out. */
  public synchronized void stepOut() throws DebuggerException {
    if (virtualMachine == null) return;
    removeStepRequest();
    try {
      setLastAction(ACTION_STEP_OUT);
      stepRequest =
          requestManager.createStepRequest(
              currentThread.getThreadReference(), StepRequest.STEP_LINE, StepRequest.STEP_OUT);
      stepRequest.addCountFilter(1);
      stepRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
      operator.register(stepRequest, this);
      stepRequest.enable();
      virtualMachine.resume();
      super.stepOut();
    } catch (DuplicateRequestException e) {
      e.printStackTrace();
    }
  }

  // WATCHES ..............................................................

  /**
   * Creates new uninitialized watch. The watch is visible (not hidden).
   *
   * @return new uninitialized watch
   */
  public Watch createWatch() {
    JPDAWatch w = new JPDAWatch(this);
    watch.addElement(w);
    fireWatchCreated(w);
    return w;
  }

  /**
   * Creates a watch its expression is set to initial value. Also allows to create a watch not
   * presented to the user, for example for internal usage in the editor to obtain values of
   * variables under the mouse pointer.
   *
   * @param expr expresion to watch for
   * @param hidden allows to specify whether the watch should be presented to the user or not (be
   *     only of internal usage of the IDE).
   * @return new watch
   */
  public Watch createWatch(String expr, boolean hidden) {
    JPDAWatch w = new JPDAWatch(this);
    if (!hidden) watch.addElement(w);
    w.setVariableName(expr);
    if (!hidden) fireWatchCreated(w);
    return w;
  }

  // AbstractDebugger implementation ..................................................

  // properties ........................

  /** Returns version of this debugger. */
  public String getVersion() {
    return bundle.getString("CTL_Debugger_version");
    /*    if (virtualMachine != null)
      return virtualMachine.versionDescription () + " (" +
             virtualMachine.majorVersion () + "/" +
             virtualMachine.minorVersion () + ")";
    else
      return bundle.getString ("CTL_Debugger_version");*/
  }

  /** Returns size of memory. */
  public int getTotalMemory() throws DebuggerException {
    if (virtualMachine == null) return 0;
    return 0;
  }

  /** Returns size of free memory. */
  public int getFreeMemory() throws DebuggerException {
    if (virtualMachine == null) return 0;
    return 0;
  }

  /** @return newly constructed string containing classpath obtained from filesystems */
  public String getClasspath() {
    return ""; // NOI18N
  }

  /** @return Connect Panel for this version of debugger. */
  public JComponent getConnectPanel() {
    return new Connector();
  }

  /** @return name of proces for given DebuggerInfo. */
  public String getProcessName(DebuggerInfo info) {
    if (info instanceof RemoteDebuggerInfo) {
      if (((RemoteDebuggerInfo) info).getConnector().transport().name().equals("dt_shmem")) {
        Argument a = (Argument) ((RemoteDebuggerInfo) info).getArgs().get("name");
        if (a == null) return "localhost:???";
        else return "localhost:" + a.value();
      } else if (((RemoteDebuggerInfo) info)
          .getConnector()
          .transport()
          .name()
          .equals("dt_socket")) {
        Argument name = (Argument) ((RemoteDebuggerInfo) info).getArgs().get("hostname");
        Argument port = (Argument) ((RemoteDebuggerInfo) info).getArgs().get("port");
        return ((name == null) ? "???:" : (name.value() + ":"))
            + ((port == null) ? "???" : (port.value()));
      } else return "???";
    } else return (info.getStopClassName() != null) ? info.getStopClassName() : info.getClassName();
  }

  /** @return name of location for given DebuggerInfo. */
  public String getLocationName(DebuggerInfo info) {
    if (info instanceof RemoteDebuggerInfo) {
      if (((RemoteDebuggerInfo) info).getConnector().transport().name().equals("dt_shmem")) {
        return "localhost";
      } else if (((RemoteDebuggerInfo) info)
          .getConnector()
          .transport()
          .name()
          .equals("dt_socket")) {
        Argument name = (Argument) ((RemoteDebuggerInfo) info).getArgs().get("hostname");
        return name == null ? "localhost" : name.value();
      } else return "localhost";
    } else return "localhost";
  }

  /** Returns true - JPDADebugger supports evaluation of expressions. */
  public boolean supportsExpressions() {
    return true;
  }

  // breakpoints ........................

  /** Returns events available for this version of debugger. */
  public CoreBreakpoint.Event[] getBreakpointEvents() {
    return breakpointEvents;
  }

  /** Returns actions available for this version of debugger. */
  public CoreBreakpoint.Action[] getBreakpointActions() {
    return breakpointActions;
  }

  // threads ........................

  /** Returns root of all threads. */
  public AbstractThreadGroup getThreadGroupRoot() {
    return threadGroup;
  }

  /** Returns current thread or null. */
  public AbstractThread getCurrentThread() {
    return currentThread;
  }

  /** Sets current thread. If thread is null, unsets curent thread. */
  public void setCurrentThread(AbstractThread thread) {
    if (currentThread == thread) return;
    Object old = currentThread;
    currentThread = (JPDAThread) thread;
    firePropertyChange(PROP_CURRENT_THREAD, old, thread);
  }

  // interface Executor .....................................................................

  /** Executes breakpoint hit event. */
  public void exec(com.sun.jdi.event.Event ev) {
    // S ystem.out.println ("exec "); // NOI18N
    removeStepRequest();
    StepEvent event = (StepEvent) ev;
    ThreadReference tr = event.thread();
    Location loc = event.location();
    int ln = -1;
    String methodName = "?"; // NOI18N
    String className = "?"; // NOI18N
    String lineNumber = "?"; // NOI18N
    String threadName = tr.name();
    Line l = null;

    if (loc != null) {
      if (loc.method() != null) methodName = loc.method().name();
      className = loc.declaringType().name();
      ln = loc.lineNumber();
      if (ln >= 0) lineNumber = "" + loc.lineNumber();
    }

    if (ln != -1)
      try {
        l = Utils.getLineForSource(className, loc.sourceName(), ln);
      } catch (AbsentInformationException e) {
        l = Utils.getLine(className, ln);
      }

    if (resolveCanBeCurrent(tr, l))
      // if this line can not be current resolveCanBeCurrent () calls stepOver
      return;
    // line can be current

    if ((l == null) && (getLastAction() == ACTION_TRACE_INTO))
      // try to find another "intelligent" line of code
      traceToSourceCode(tr);
    // you know - intelligent means that one with source code
    else {
      makeCurrent(threadName, className, methodName, lineNumber, l != null, tr);
      operator.stopRequest();
    }
  }

  // support for multisession debugging
  // ................................................................

  /** Disconnects from running debugged process. */
  public void disconnect() throws DebuggerException {
    if (breakpointMain != null) {
      for (int x = 0; x < breakpointMain.length; x++) breakpointMain[x].remove();
      breakpointMain = null;
    }
    try {
      if (virtualMachine != null) virtualMachine.dispose();
    } catch (VMDisconnectedException e) {
    }
    if (threadManager != null) threadManager.finish();
    if (debuggerThread != null) {
      debuggerThread.interrupt();
      debuggerThread.stop();
    }
    super.finishDebugger();
  }

  /** Reconnects to disconnected Virtual Machine. */
  public void reconnect() throws DebuggerException {
    startDebugger(new ReconnectDebuggerInfo(connector, args));
  }

  // helper private methods
  // .........................................................................

  /** Finds the first executed line with source code. */
  public void traceToSourceCode(ThreadReference thread) {
    // S ystem.out.println ("Start finding!!! "); // NOI18N

    // create Step Request for searching a source code
    try {
      findSourceSR =
          requestManager.createStepRequest(thread, StepRequest.STEP_LINE, StepRequest.STEP_OUT);
      findSourceSR.addCountFilter(1);
      findSourceSR.setSuspendPolicy(EventRequest.SUSPEND_ALL);
      operator.register(findSourceSR, this);
      findSourceSR.enable();
    } catch (DuplicateRequestException e) {
      e.printStackTrace();
    }

    // create Method Entry Request for searching a source code
    findSourceMER = requestManager.createMethodEntryRequest();
    findSourceMER.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    findSourceMER.addThreadFilter(thread);
    findSourceCounter = 0;
    operator.register(
        findSourceMER,
        new Executor() {
          public void exec(com.sun.jdi.event.Event event) {
            if (findSourceCounter == 500) {
              // finding source takes a long time
              operator.resume();
              if (findSourceMER != null) {
                requestManager.deleteEventRequest(findSourceMER);
                findSourceMER = null;
              }
              return;
            }
            findSourceCounter++;

            Location loc = ((MethodEntryEvent) event).location();
            if (loc == null) {
              // no line => continue finding
              operator.resume();
              return;
            }
            String className = loc.declaringType().name();
            int ln = loc.lineNumber();
            // S ystem.out.println ("FIND " + className + " : " + ln); // NOI18N
            try {
              Line l = null;
              if ((l = Utils.getLineForSource(className, loc.sourceName(), ln)) == null) {
                // no line => continue finding
                operator.resume();
                return;
              }

              // WOW I have a nice line!
              ThreadReference tr = ((MethodEntryEvent) event).thread();
              if (resolveCanBeCurrent(tr, l))
                // if can not be current => steps to some line
                return;

              // line can be current!
              String threadName = tr.name();
              String methodName = loc.method() != null ? loc.method().name() : ""; // NOI18N
              String lineNumber = ln == -1 ? "?" : "" + ln; // NOI18N
              makeCurrent(threadName, className, methodName, lineNumber, true, tr);
              operator.stopRequest();
            } catch (AbsentInformationException e) {
            }
          }
        });
    findSourceMER.enable();

    operator.resume();
    return;
  }

  /** if this line can not be current => stepOver & return true. return false on the other hand. */
  boolean resolveCanBeCurrent(ThreadReference tr) {
    try {
      Location l = tr.frame(0).location();
      if (l == null) return false;
      return resolveCanBeCurrent(
          tr, Utils.getLineForSource(l.declaringType().name(), l.sourceName(), l.lineNumber()));
    } catch (Exception e) {
    }
    return false;
  }

  /**
   * If this line can not be current => stepOver & return true. {support for non java languages}
   *
   * <p>return false on the other hand.
   */
  boolean resolveCanBeCurrent(ThreadReference tr, Line l) {
    if ((l != null) && (!canBeCurrent(l, false))) {
      try {
        removeStepRequest();
        findSourceSR =
            requestManager.createStepRequest(tr, StepRequest.STEP_LINE, StepRequest.STEP_OVER);
        findSourceSR.addCountFilter(1);
        findSourceSR.setSuspendPolicy(EventRequest.SUSPEND_ALL);
        operator.register(findSourceSR, this);
        findSourceSR.enable();
        operator.resume();
      } catch (DuplicateRequestException e) {
        e.printStackTrace();
      }
      return true;
    }
    return false;
  }

  /**
   * Sets curent line. It means: change debugger state to stopped, shows message, sets current
   * thread and updates watches.
   */
  private void makeCurrent(
      final String threadName,
      final String className,
      final String methodName,
      final String lineNumber,
      final boolean hasSource,
      final ThreadReference tr) {
    setDebuggerState(DEBUGGER_STOPPED);

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            // show message
            if (isFollowedByEditor()) {
              if (hasSource) {
                println(
                    new MessageFormat(bundle.getString("CTL_Thread_stopped"))
                        .format(new Object[] {threadName, className, methodName, lineNumber}),
                    ERR_OUT + STL_OUT);
              } else {
                println(
                    new MessageFormat(bundle.getString("CTL_Thread_stopped_no_source"))
                        .format(new Object[] {threadName, className, methodName, lineNumber}),
                    ERR_OUT + STL_OUT);
              }
            } else
              println(
                  new MessageFormat(bundle.getString("CTL_Thread_stopped"))
                      .format(new Object[] {threadName, className, methodName, lineNumber}),
                  ERR_OUT + STL_OUT);

            // refresh all
            JPDAThread tt = threadManager.getThread(tr);
            tt.setCurrent(true);
            updateWatches();
          }
        });
  }

  /** Second part of debugger start procedure. */
  private void startDebugger() {
    threadManager = new ThreadManager(this);

    setBreakpoints();
    updateWatches();
    println(bundle.getString("CTL_Debugger_running"), STL_OUT);
    setDebuggerState(DEBUGGER_RUNNING);

    virtualMachine.resume();

    // start refresh thread .................................................
    if (debuggerThread != null) debuggerThread.stop();
    debuggerThread =
        new Thread(
            new Runnable() {
              public void run() {
                for (; ; ) {
                  try {
                    Thread.sleep(5000);
                  } catch (InterruptedException ex) {
                  }
                  if (getState() == DEBUGGER_RUNNING) threadGroup.refresh();
                }
              }
            },
            "Debugger refresh thread"); // NOI18N
    debuggerThread.setPriority(Thread.MIN_PRIORITY);
    debuggerThread.start();
  }

  /** Removes last step request. */
  void removeStepRequest() {
    if (stepRequest != null) {
      requestManager.deleteEventRequest(stepRequest);
      stepRequest = null;
    }
    if (findSourceMER != null) {
      requestManager.deleteEventRequest(findSourceMER);
      findSourceMER = null;
    }
    if (findSourceSR != null) {
      requestManager.deleteEventRequest(findSourceSR);
      findSourceSR = null;
    }
  }

  private static String generatePassword() {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 4; i++) sb.append((char) (random.nextInt(26) + 'a'));
    return new String(sb);
  }

  private VirtualMachine launch(DebuggerInfo info) throws DebuggerException {
    // create process & read password for local debugging

    // create main class & arguments ...............................................
    StringBuffer sb = new StringBuffer();
    sb.append(mainClassName);
    String[] infoArgs = info.getArguments();
    int i, k = infoArgs.length;
    for (i = 0; i < k; i++) sb.append(" \"").append(infoArgs[i]).append('"'); // NOI18N
    String main = new String(sb);

    // create connector ..............................................................
    VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
    java.util.List lcs = vmm.launchingConnectors();
    k = lcs.size();
    for (i = 0; i < k; i++)
      if (((LaunchingConnector) lcs.get(i)).name().indexOf("RawCommandLineLaunch") >= 0) // NOI18N
      break;
    if (i == k) {
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_Cannot_find_launcher"))
              .format(
                  new Object[] {
                    "RawCommandLineLaunch" // NOI18N
                  }));
    }
    LaunchingConnector lc = (LaunchingConnector) lcs.get(i);
    String transport = lc.transport().name();

    // create commandLine & NbProcessDescriptor ..............................
    NbProcessDescriptor debugerProcess;
    if (info instanceof ProcessDebuggerInfo)
      debugerProcess = ((ProcessDebuggerInfo) info).getDebuggerProcess();
    else debugerProcess = ProcessDebuggerType.DEFAULT_DEBUGGER_PROCESS;

    // generate password
    String password;
    if (transport.equals("dt_shmem")) { // NOI18N
      connector = getAttachingConnectorFor("dt_shmem");
      password = generatePassword();
      args = connector.defaultArguments();
      ((Argument) args.get("name")).setValue(password);
    } else {
      try {
        java.net.ServerSocket ss = new java.net.ServerSocket(0);
        password = "" + ss.getLocalPort(); // NOI18N
        ss.close();
      } catch (java.io.IOException e) {
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_Cannot_find_empty_local_port"))
                .format(new Object[] {e.toString()}));
      }
      connector = getAttachingConnectorFor("dt_socket");
      args = connector.defaultArguments();
      ((Argument) args.get("port")).setValue(password);
    }
    HashMap map =
        Utils.processDebuggerInfo(
            info,
            "-Xdebug -Xnoagent -Xrunjdwp:transport="
                + // NOI18N
                transport
                + ",address="
                + // NOI18N
                password
                + ",suspend=y ", // NOI18N
            main);
    MapFormat format = new MapFormat(map);
    String commandLine =
        format.format(
            debugerProcess.getProcessName()
                + " "
                + // NOI18N
                debugerProcess.getArguments());
    println(commandLine, ERR_OUT);
    /*
    We mus wait on process start to connect...
    try {
      process = debugerProcess.exec (format);
    } catch (java.io.IOException exc) {
      finishDebugger ();
      throw new DebuggerException (
        new MessageFormat (bundle.getString ("EXC_While_create_debuggee")).
          format (new Object[] {
            debugerProcess.getProcessName (),
            exc.toString ()
          }),
        exc
      );
    }
    return connect (
      null,
      connector,
      args
    );*/

    /*      S ystem.out.println ("attaching: ");
    Utils.showConnectors (vmm.attachingConnectors ());

    S ystem.out.println ("launching: ");
    Utils.showConnectors (vmm.launchingConnectors ());

    S ystem.out.println ("listening: ");
    Utils.showConnectors (vmm.listeningConnectors ());*/

    // set debugger-start arguments
    Map params = lc.defaultArguments();
    ((Argument) params.get("command"))
        .setValue( // NOI18N
            commandLine);
    ((Argument) params.get("address"))
        .setValue( // NOI18N
            password);

    // launch VM
    try {
      return lc.launch(params);
    } catch (VMStartException exc) {
      showOutput(process = exc.process(), ERR_OUT, ERR_OUT);
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_While_create_debuggee"))
              .format(
                  new Object[] {format.format(debugerProcess.getProcessName()), exc.toString()}),
          exc);
    } catch (Exception exc) {
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_While_create_debuggee"))
              .format(
                  new Object[] {format.format(debugerProcess.getProcessName()), exc.toString()}),
          exc);
    }
  }

  private VirtualMachine reconnect(ReconnectDebuggerInfo info) throws DebuggerException {
    return connect("CTL_Reconnecting_to", info.getConnector(), info.getArgs());
  }

  private VirtualMachine connect(RemoteDebuggerInfo info) throws DebuggerException {
    return connect("CTL_Connecting_to", connector = info.getConnector(), args = info.getArgs());
  }

  private VirtualMachine connect(String bndlPrefix, AttachingConnector connector, Map args)
      throws DebuggerException {
    if (bndlPrefix != null) {
      if (connector.transport().name().equals("dt_shmem")) {
        Argument a = (Argument) args.get("name");
        if (a == null) println(bundle.getString(bndlPrefix + "_shmem_noargs"), ERR_OUT);
        else
          println(
              new MessageFormat(bundle.getString(bndlPrefix + "_shmem"))
                  .format(new Object[] {a.value()}),
              ERR_OUT);
      } else if (connector.transport().name().equals("dt_socket")) {
        Argument name = (Argument) args.get("hostname");
        Argument port = (Argument) args.get("port");
        if ((name == null) || (port == null))
          println(bundle.getString(bndlPrefix + "_socket_noargs"), ERR_OUT);
        else
          println(
              new MessageFormat(bundle.getString(bndlPrefix + "_socket"))
                  .format(new Object[] {name.value(), port.value()}),
              ERR_OUT);
      } else println(bundle.getString(bndlPrefix), ERR_OUT);
    }

    // launch VM
    try { // S ystem.out.println ("attach to:" + ac + " : " + password); // NOI18N
      return connector.attach(args);
    } catch (Exception e) {
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_While_connecting_to_debuggee"))
              .format(new Object[] {e.toString()}),
          e);
    }
  }

  /** Performs stop action. */
  void stop(boolean stop, final AbstractThread thread) {
    final ResourceBundle bundle = NbBundle.getBundle(JPDADebugger.class);
    if (stop) {
      removeStepRequest();
      setLastAction(ACTION_BREAKPOINT_HIT);
      setDebuggerState(DEBUGGER_STOPPED);
      operator.stopRequest();
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              thread.setCurrent(true);
              updateWatches();
              threadGroup.refresh();
            }
          });
    } else operator.resume();
  }

  private static AttachingConnector getAttachingConnectorFor(String transport) {
    List acs = Bootstrap.virtualMachineManager().attachingConnectors();
    AttachingConnector ac;
    int i, k = acs.size();
    for (i = 0; i < k; i++)
      if ((ac = (AttachingConnector) acs.get(i)).transport().name().equals(transport)) return ac;
    return null;
  }

  /**
   * Setter method for debugger state property.
   *
   * @param newState
   */
  public synchronized void setDebuggerState(final int newState) {
    super.setDebuggerState(newState);
  }

  // innerclasses ..............................................................

  private class ReconnectDebuggerInfo extends RemoteDebuggerInfo {
    private ReconnectDebuggerInfo(AttachingConnector connector, Map args) {
      super(connector, args);
    }
  }

  class Connector extends JPanel implements DebuggerInfoProducer, ActionListener {

    private JComboBox cbConnectors;
    private Map args;
    private java.util.List acs;
    private JTextField[] tfParams;
    private AttachingConnector ac;

    Connector() {
      VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
      acs = vmm.attachingConnectors();
      setLayout(new GridBagLayout());
      refresh(0);
    }

    private void refresh(int index) {
      GridBagConstraints c = new GridBagConstraints();

      // No connector ................
      if (acs.size() == 0) {
        add(new JLabel(bundle.getString("CTL_No_Connector")), c);
        return;
      }

      // Connector switch ................
      if (acs.size() > 1) {
        c.insets = new Insets(0, 0, 3, 3);
        add(new JLabel(bundle.getString("CTL_Connector")), c);

        cbConnectors = new JComboBox();
        int i, k = acs.size();
        for (i = 0; i < k; i++) {
          AttachingConnector ac = (AttachingConnector) acs.get(i);
          int jj = ac.name().lastIndexOf('.');
          String s = (jj < 0) ? ac.name() : ac.name().substring(jj + 1);
          cbConnectors.addItem(s + " (" + ac.description() + ")");
        }
        c = new GridBagConstraints();
        c.insets = new Insets(0, 3, 3, 0);
        c.weightx = 1.0;
        c.fill = java.awt.GridBagConstraints.HORIZONTAL;
        c.gridwidth = 0;
        cbConnectors.setSelectedIndex(index);
        cbConnectors.setActionCommand("SwitchMe!");
        cbConnectors.addActionListener(this);
        add(cbConnectors, c);
      }

      ac = (AttachingConnector) acs.get(index);

      // Transport ................
      c = new GridBagConstraints();
      c.insets = new Insets(3, 0, 0, 3);
      add(new JLabel(bundle.getString("CTL_Transport")), c);

      JTextField tfTransport = new JTextField(ac.transport().name());
      tfTransport.setEnabled(false);
      c = new GridBagConstraints();
      c.gridwidth = 0;
      c.insets = new Insets(3, 3, 0, 0);
      c.fill = java.awt.GridBagConstraints.HORIZONTAL;
      c.weightx = 1.0;
      add(tfTransport, c);

      // Other params ................
      args = ac.defaultArguments();
      tfParams = new JTextField[args.size()];
      Iterator it = args.keySet().iterator();
      int i = 0;
      while (it.hasNext()) {
        String name = (String) it.next();
        Argument a = (Argument) args.get(name);

        c = new GridBagConstraints();
        c.insets = new Insets(6, 0, 0, 3);
        c.anchor = GridBagConstraints.WEST;
        add(new JLabel(a.label() + ": "), c);

        JTextField tfParam = new JTextField(a.value());
        tfParams[i++] = tfParam;
        tfParam.setName(name);
        c = new GridBagConstraints();
        c.gridwidth = 0;
        c.insets = new Insets(6, 3, 0, 0);
        c.fill = java.awt.GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        add(tfParam, c);
      }

      c = new GridBagConstraints();
      c.weighty = 1.0;
      JPanel p = new JPanel();
      p.setPreferredSize(new Dimension(1, 1));
      add(p, c);
    }

    /** Returns DebuggerInfo. */
    public DebuggerInfo getDebuggerInfo() {
      int i, k = tfParams.length;
      for (i = 0; i < k; i++) {
        Argument a = (Argument) args.get(tfParams[i].getName());
        a.setValue(tfParams[i].getText());
      }
      return new RemoteDebuggerInfo(ac, args);
    }

    public void actionPerformed(ActionEvent e) {
      removeAll();
      refresh(((JComboBox) e.getSource()).getSelectedIndex());
      Component w = getParent();
      while (!(w instanceof Window)) w = w.getParent();
      if (w != null) ((Window) w).pack(); // ugly hack...
      return;
    }

    private String translate(String name) {
      /*      if (name.equals ("SwitchMe!"))
        return
      else*/
      return name;
    }
  }
}
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    panPeriod = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    dpiFrom = new org.jdesktop.swingx.JXDatePicker();
    dpiTo = new org.jdesktop.swingx.JXDatePicker();
    jPanel2 = new javax.swing.JPanel();
    btnThisWeek = new javax.swing.JToggleButton();
    btnLastWeek = new javax.swing.JToggleButton();
    btnThisMonth = new javax.swing.JToggleButton();
    btnLastMonth = new javax.swing.JToggleButton();
    jPanel7 = new javax.swing.JPanel();
    btnRefreshAnlaesse = new javax.swing.JButton();
    panMasterDetail = new javax.swing.JPanel();
    panMaster = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jXTable1 = new org.jdesktop.swingx.JXTable();
    panDetail = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    lblDokumentLink = new javax.swing.JLabel();
    jPanel5 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    lstKassenzeichen = new javax.swing.JList();
    jButton1 = new javax.swing.JButton();
    cbxAbgearbeitet = new javax.swing.JCheckBox();
    jPanel6 = new javax.swing.JPanel();
    jPanel8 = new javax.swing.JPanel();
    btnCloseDialog = new javax.swing.JButton();
    jProgressBar1 = new javax.swing.JProgressBar();
    jPanel9 = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class, "FortfuehrungsanlaesseDialog.title")); // NOI18N
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jPanel1.setPreferredSize(new java.awt.Dimension(800, 643));
    jPanel1.setLayout(new java.awt.GridBagLayout());

    panPeriod.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                FortfuehrungsanlaesseDialog.class,
                "FortfuehrungsanlaesseDialog.panPeriod.border.title"))); // NOI18N
    panPeriod.setLayout(new java.awt.GridBagLayout());

    jLabel1.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.jLabel1.text")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 5);
    panPeriod.add(jLabel1, gridBagConstraints);

    jLabel2.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.jLabel2.text")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 5);
    panPeriod.add(jLabel2, gridBagConstraints);

    dpiFrom.addPropertyChangeListener(
        new java.beans.PropertyChangeListener() {

          @Override
          public void propertyChange(final java.beans.PropertyChangeEvent evt) {
            dpiFromPropertyChange(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.insets = new java.awt.Insets(10, 0, 5, 10);
    panPeriod.add(dpiFrom, gridBagConstraints);

    dpiTo.addPropertyChangeListener(
        new java.beans.PropertyChangeListener() {

          @Override
          public void propertyChange(final java.beans.PropertyChangeEvent evt) {
            dpiToPropertyChange(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.insets = new java.awt.Insets(10, 0, 5, 10);
    panPeriod.add(dpiTo, gridBagConstraints);

    jPanel2.setLayout(new java.awt.GridLayout(2, 3, 5, 5));

    buttonGroup1.add(btnThisWeek);
    btnThisWeek.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnThisWeek.text")); // NOI18N
    btnThisWeek.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnThisWeekActionPerformed(evt);
          }
        });
    jPanel2.add(btnThisWeek);

    buttonGroup1.add(btnLastWeek);
    btnLastWeek.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnLastWeek.text")); // NOI18N
    btnLastWeek.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnLastWeekActionPerformed(evt);
          }
        });
    jPanel2.add(btnLastWeek);

    buttonGroup1.add(btnThisMonth);
    btnThisMonth.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnThisMonth.text")); // NOI18N
    btnThisMonth.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnThisMonthActionPerformed(evt);
          }
        });
    jPanel2.add(btnThisMonth);

    buttonGroup1.add(btnLastMonth);
    btnLastMonth.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnLastMonth.text")); // NOI18N
    btnLastMonth.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnLastMonthActionPerformed(evt);
          }
        });
    jPanel2.add(btnLastMonth);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
    panPeriod.add(jPanel2, gridBagConstraints);

    jPanel7.setPreferredSize(new java.awt.Dimension(50, 10));

    final javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
        jPanel7Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 50, Short.MAX_VALUE));
    jPanel7Layout.setVerticalGroup(
        jPanel7Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 88, Short.MAX_VALUE));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.weightx = 1.0;
    panPeriod.add(jPanel7, gridBagConstraints);

    btnRefreshAnlaesse.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnRefreshAnlaesse.text")); // NOI18N
    btnRefreshAnlaesse.setEnabled(false);
    btnRefreshAnlaesse.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnRefreshAnlaesseActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 10, 10, 10);
    panPeriod.add(btnRefreshAnlaesse, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel1.add(panPeriod, gridBagConstraints);

    panMasterDetail.setLayout(new java.awt.GridBagLayout());

    panMaster.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                FortfuehrungsanlaesseDialog.class,
                "FortfuehrungsanlaesseDialog.panMaster.border.title"))); // NOI18N
    panMaster.setLayout(new java.awt.GridBagLayout());

    jXTable1.setEnabled(false);
    jScrollPane1.setViewportView(jXTable1);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 10, 10, 10);
    panMaster.add(jScrollPane1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10);
    panMasterDetail.add(panMaster, gridBagConstraints);
    panMaster
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                FortfuehrungsanlaesseDialog.class,
                "FortfuehrungsanlaesseDialog.panMaster.AccessibleContext.accessibleName")); // NOI18N

    panDetail.setBorder(null);
    panDetail.setMinimumSize(new java.awt.Dimension(250, 137));
    panDetail.setPreferredSize(new java.awt.Dimension(250, 244));
    panDetail.setVerifyInputWhenFocusTarget(false);
    panDetail.setLayout(new java.awt.GridBagLayout());

    jPanel3.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                FortfuehrungsanlaesseDialog.class,
                "FortfuehrungsanlaesseDialog.jPanel3.border.title"))); // NOI18N
    jPanel3.setLayout(new java.awt.GridBagLayout());

    lblDokumentLink.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.lblDokumentLink.text")); // NOI18N
    lblDokumentLink.setEnabled(false);
    lblDokumentLink.addMouseListener(
        new java.awt.event.MouseAdapter() {

          @Override
          public void mouseClicked(final java.awt.event.MouseEvent evt) {
            lblDokumentLinkMouseClicked(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
    jPanel3.add(lblDokumentLink, gridBagConstraints);

    final javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    jPanel3.add(jPanel5, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
    panDetail.add(jPanel3, gridBagConstraints);

    jPanel4.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                FortfuehrungsanlaesseDialog.class,
                "FortfuehrungsanlaesseDialog.jPanel4.border.title"))); // NOI18N
    jPanel4.setLayout(new java.awt.GridBagLayout());

    lstKassenzeichen.setModel(new DefaultListModel());
    lstKassenzeichen.setEnabled(false);
    lstKassenzeichen.addMouseListener(
        new java.awt.event.MouseAdapter() {

          @Override
          public void mouseClicked(final java.awt.event.MouseEvent evt) {
            lstKassenzeichenMouseClicked(evt);
          }
        });
    lstKassenzeichen.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {

          @Override
          public void valueChanged(final javax.swing.event.ListSelectionEvent evt) {
            lstKassenzeichenValueChanged(evt);
          }
        });
    jScrollPane2.setViewportView(lstKassenzeichen);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
    jPanel4.add(jScrollPane2, gridBagConstraints);

    jButton1.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.jButton1.text")); // NOI18N
    jButton1.setEnabled(false);
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
    jPanel4.add(jButton1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
    panDetail.add(jPanel4, gridBagConstraints);

    cbxAbgearbeitet.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.cbxAbgearbeitet.text")); // NOI18N
    cbxAbgearbeitet.setEnabled(false);
    cbxAbgearbeitet.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            cbxAbgearbeitetActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
    panDetail.add(cbxAbgearbeitet, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
    panMasterDetail.add(panDetail, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel1.add(panMasterDetail, gridBagConstraints);

    final javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    jPanel1.add(jPanel6, gridBagConstraints);

    jPanel8.setLayout(new java.awt.GridBagLayout());

    btnCloseDialog.setText(
        org.openide.util.NbBundle.getMessage(
            FortfuehrungsanlaesseDialog.class,
            "FortfuehrungsanlaesseDialog.btnCloseDialog.text")); // NOI18N
    btnCloseDialog.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(final java.awt.event.ActionEvent evt) {
            btnCloseDialogActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LAST_LINE_END;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
    jPanel8.add(btnCloseDialog, gridBagConstraints);

    jProgressBar1.setIndeterminate(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
    jPanel8.add(jProgressBar1, gridBagConstraints);

    jPanel9.setOpaque(false);

    final javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
        jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 634, Short.MAX_VALUE));
    jPanel9Layout.setVerticalGroup(
        jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 30, Short.MAX_VALUE));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    jPanel8.add(jPanel9, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel1.add(jPanel8, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(jPanel1, gridBagConstraints);

    pack();
  } // </editor-fold>
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jPanel1 = new javax.swing.JPanel();
    lName = new javax.swing.JLabel();
    tName = new javax.swing.JTextField();
    lClassName = new javax.swing.JLabel();
    tClassName = new javax.swing.JTextField();
    lIcon = new javax.swing.JLabel();
    cIcon = new javax.swing.JComboBox();
    jLabel5 = new javax.swing.JLabel();
    projectTextField = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    packageComboBox = new javax.swing.JComboBox();
    jLabel4 = new javax.swing.JLabel();
    fileTextField = new javax.swing.JTextField();
    jSeparator1 = new javax.swing.JSeparator();
    jPanel3 = new javax.swing.JPanel();
    lNote = new javax.swing.JLabel();

    setName(
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "TITLE_File")); // NOI18N
    setLayout(new java.awt.GridBagLayout());

    jPanel1.setLayout(new java.awt.GridBagLayout());

    lName.setLabelFor(tName);
    org.openide.awt.Mnemonics.setLocalizedText(
        lName,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_Name")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 4);
    jPanel1.add(lName, gridBagConstraints);
    lName
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidletName")); // NOI18N
    lName
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidletName")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 4, 3, 4);
    jPanel1.add(tName, gridBagConstraints);
    tName
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidletName")); // NOI18N
    tName
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidletName")); // NOI18N

    lClassName.setLabelFor(tClassName);
    org.openide.awt.Mnemonics.setLocalizedText(
        lClassName,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_MIDletClassName")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 4);
    jPanel1.add(lClassName, gridBagConstraints);
    lClassName
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpClassName")); // NOI18N
    lClassName
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpClassName")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 4, 3, 4);
    jPanel1.add(tClassName, gridBagConstraints);
    tClassName
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpClassName")); // NOI18N
    tClassName
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpClassName")); // NOI18N

    lIcon.setLabelFor(cIcon);
    org.openide.awt.Mnemonics.setLocalizedText(
        lIcon,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_Icon")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 0, 3, 4);
    jPanel1.add(lIcon, gridBagConstraints);
    lIcon
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidletIcon")); // NOI18N
    lIcon
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidletIcon")); // NOI18N

    cIcon.setEditable(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 4, 3, 4);
    jPanel1.add(cIcon, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 24, 0);
    add(jPanel1, gridBagConstraints);

    jLabel5.setLabelFor(projectTextField);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel5,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_Project")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
    add(jLabel5, gridBagConstraints);
    jLabel5
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpTargetProject")); // NOI18N
    jLabel5
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpTargetProject")); // NOI18N

    projectTextField.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 6, 0);
    add(projectTextField, gridBagConstraints);
    projectTextField
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpTargetProject")); // NOI18N
    projectTextField
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpTargetProject")); // NOI18N

    jLabel2.setLabelFor(packageComboBox);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel2,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_Package")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
    add(jLabel2, gridBagConstraints);
    jLabel2
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpTargetPackage")); // NOI18N
    jLabel2
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpTargetPackage")); // NOI18N

    packageComboBox.setEditable(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 12, 0);
    add(packageComboBox, gridBagConstraints);
    packageComboBox
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_MidpTargetPackage")); // NOI18N
    packageComboBox
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_MidpTargetPackage")); // NOI18N

    jLabel4.setLabelFor(fileTextField);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel4,
        org.openide.util.NbBundle.getMessage(
            MIDPTargetChooserPanelGUI.class, "LBL_File_Created")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
    add(jLabel4, gridBagConstraints);
    jLabel4
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_CreatedFile")); // NOI18N
    jLabel4
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_CreatedFile")); // NOI18N

    fileTextField.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 12, 0);
    add(fileTextField, gridBagConstraints);
    fileTextField
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSN_CreatedFile")); // NOI18N
    fileTextField
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                MIDPTargetChooserPanelGUI.class, "ACSD_CreatedFile")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
    add(jSeparator1, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(jPanel3, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(
        lNote,
        NbBundle.getMessage(MIDPTargetChooserPanelGUI.class, "LBL_MIDPTarget_Note")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    add(lNote, gridBagConstraints);
  } // </editor-fold>//GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jButton1 = new javax.swing.JButton();
    jTextField1 = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();

    org.openide.awt.Mnemonics.setLocalizedText(
        jButton1,
        org.openide.util.NbBundle.getMessage(
            ImportDocumentVisualPanel0.class,
            "ImportDocumentVisualPanel0.jButton1.text_1_1")); // NOI18N

    jTextField1.setEditable(false);

    jTextArea1.setColumns(20);
    jTextArea1.setEditable(false);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);

    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel1,
        org.openide.util.NbBundle.getMessage(
            ImportDocumentVisualPanel0.class, "ImportDocumentVisualPanel0.jLabel1.text")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel2,
        org.openide.util.NbBundle.getMessage(
            ImportDocumentVisualPanel0.class, "ImportDocumentVisualPanel0.jLabel2.text")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel3,
        org.openide.util.NbBundle.getMessage(
            ImportDocumentVisualPanel0.class, "ImportDocumentVisualPanel0.jLabel3.text")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(
                                jLabel3,
                                javax.swing.GroupLayout.Alignment.LEADING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel2,
                                javax.swing.GroupLayout.Alignment.LEADING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel1,
                                javax.swing.GroupLayout.Alignment.LEADING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(
                                                jTextField1,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                187,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                jTextField2,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                187,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton1))
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                273,
                                Short.MAX_VALUE))
                    .addGap(74, 74, 74)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(51, 51, 51)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(
                                jTextField2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1)
                            .addComponent(
                                jTextField1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(111, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    configSep = new javax.swing.JSeparator();
    configPanel = new javax.swing.JPanel();
    configLabel = new javax.swing.JLabel();
    configCombo = new javax.swing.JComboBox();
    configNew = new javax.swing.JButton();
    configDel = new javax.swing.JButton();
    mainPanel = new javax.swing.JPanel();
    jLabelMainClass = new javax.swing.JLabel();
    jTextFieldMainClass = new javax.swing.JTextField();
    jButtonMainClass = new javax.swing.JButton();
    jLabelArgs = new javax.swing.JLabel();
    jTextFieldArgs = new javax.swing.JTextField();
    jLabelWorkingDirectory = new javax.swing.JLabel();
    jTextWorkingDirectory = new javax.swing.JTextField();
    jButtonWorkingDirectoryBrowse = new javax.swing.JButton();
    jLabelVMOptions = new javax.swing.JLabel();
    jTextVMOptions = new javax.swing.JTextField();
    jLabelVMOptionsExample = new javax.swing.JLabel();
    customizeOptionsButton = new javax.swing.JButton();
    extPanel = new javax.swing.JPanel();

    setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
    add(configSep, gridBagConstraints);

    configPanel.setLayout(new java.awt.GridBagLayout());

    configLabel.setLabelFor(configCombo);
    org.openide.awt.Mnemonics.setLocalizedText(
        configLabel,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "CustomizerRun.configLabel")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(2, 0, 2, 0);
    configPanel.add(configLabel, gridBagConstraints);
    configLabel
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerRun.class, "AD_CustomizerRun_Cfg")); // NOI18N

    configCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"<default>"}));
    configCombo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            configComboActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(2, 6, 2, 0);
    configPanel.add(configCombo, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(
        configNew,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "CustomizerRun.configNew")); // NOI18N
    configNew.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            configNewActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(2, 6, 2, 0);
    configPanel.add(configNew, gridBagConstraints);
    configNew
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerRun.class, "AD_CustomizerRun_NewCfg")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        configDel,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "CustomizerRun.configDelete")); // NOI18N
    configDel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            configDelActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(2, 6, 2, 0);
    configPanel.add(configDel, gridBagConstraints);
    configDel
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerRun.class, "AD_CustomizerRun_DeleteCfg")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
    add(configPanel, gridBagConstraints);

    mainPanel.setLayout(new java.awt.GridBagLayout());

    jLabelMainClass.setLabelFor(jTextFieldMainClass);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabelMainClass,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_MainClass_JLabel")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
    mainPanel.add(jLabelMainClass, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 5, 0);
    mainPanel.add(jTextFieldMainClass, gridBagConstraints);
    jTextFieldMainClass
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getBundle(CustomizerRun.class)
                .getString("AD_jTextFieldMainClass")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        jButtonMainClass,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_MainClass_JButton")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 5, 0);
    mainPanel.add(jButtonMainClass, gridBagConstraints);
    jButtonMainClass
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getBundle(CustomizerRun.class)
                .getString("AD_jButtonMainClass")); // NOI18N

    jLabelArgs.setLabelFor(jTextFieldArgs);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabelArgs,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_Args_JLabel")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
    mainPanel.add(jLabelArgs, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 12, 0);
    mainPanel.add(jTextFieldArgs, gridBagConstraints);
    jTextFieldArgs
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getBundle(CustomizerRun.class)
                .getString("AD_jTextFieldArgs")); // NOI18N

    jLabelWorkingDirectory.setLabelFor(jTextWorkingDirectory);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabelWorkingDirectory,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_Working_Directory")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
    mainPanel.add(jLabelWorkingDirectory, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 5, 0);
    mainPanel.add(jTextWorkingDirectory, gridBagConstraints);
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/netbeans/modules/java/j2seproject/ui/customizer/Bundle"); // NOI18N
    jTextWorkingDirectory
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizeRun_Run_Working_Directory ")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        jButtonWorkingDirectoryBrowse,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_Working_Directory_Browse")); // NOI18N
    jButtonWorkingDirectoryBrowse.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonWorkingDirectoryBrowseActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 5, 0);
    mainPanel.add(jButtonWorkingDirectoryBrowse, gridBagConstraints);
    jButtonWorkingDirectoryBrowse
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("AD_CustomizeRun_Run_Working_Directory_Browse")); // NOI18N

    jLabelVMOptions.setLabelFor(jTextVMOptions);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabelVMOptions,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_VM_Options")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
    mainPanel.add(jLabelVMOptions, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
    mainPanel.add(jTextVMOptions, gridBagConstraints);
    jTextVMOptions
        .getAccessibleContext()
        .setAccessibleDescription(bundle.getString("AD_CustomizeRun_Run_VM_Options")); // NOI18N

    jLabelVMOptionsExample.setLabelFor(jTextFieldMainClass);
    org.openide.awt.Mnemonics.setLocalizedText(
        jLabelVMOptionsExample,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_VM_Options_Example")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 12, 12, 0);
    mainPanel.add(jLabelVMOptionsExample, gridBagConstraints);
    jLabelVMOptionsExample
        .getAccessibleContext()
        .setAccessibleDescription(
            bundle.getString("LBL_CustomizeRun_Run_VM_Options_Example")); // NOI18N

    org.openide.awt.Mnemonics.setLocalizedText(
        customizeOptionsButton,
        org.openide.util.NbBundle.getMessage(
            CustomizerRun.class, "LBL_CustomizeRun_Run_VM_Options_JButton")); // NOI18N
    customizeOptionsButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            customizeVMOptionsByDialog(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
    mainPanel.add(customizeOptionsButton, gridBagConstraints);
    customizeOptionsButton
        .getAccessibleContext()
        .setAccessibleName(
            org.openide.util.NbBundle.getMessage(
                CustomizerRun.class, "AN_CustomizeRun_Run_VM_Options_JButton")); // NOI18N
    customizeOptionsButton
        .getAccessibleContext()
        .setAccessibleDescription(
            org.openide.util.NbBundle.getMessage(
                CustomizerRun.class, "AD_CustomizeRun_Run_VM_Options_Customize")); // NOI18N

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
    add(mainPanel, gridBagConstraints);

    extPanel.setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(extPanel, gridBagConstraints);
  } // </editor-fold>//GEN-END:initComponents
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    tabPanel = new javax.swing.JTabbedPane();
    commonPanel = new javax.swing.JPanel();
    detailPane = new javax.swing.JPanel();
    certificateHierarchyHeadingLabel = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    certificateChainDNs = new javax.swing.JList();
    certificateLayoutHeadingLabel = new javax.swing.JLabel();
    certificateDetailScrollPanel = new javax.swing.JScrollPane();
    certificateDetail = new javax.swing.JTextPane();

    setLayout(new java.awt.BorderLayout());

    tabPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));

    commonPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    commonPanel.setLayout(new java.awt.BorderLayout());
    tabPanel.addTab(
        org.openide.util.NbBundle.getMessage(
            CertificateChainDisplay.class,
            "CertificateChainDisplay.commonPanel.TabConstraints.tabTitle"),
        commonPanel); // NOI18N

    detailPane.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    detailPane.setLayout(new java.awt.GridBagLayout());

    certificateHierarchyHeadingLabel.setFont(
        certificateHierarchyHeadingLabel
            .getFont()
            .deriveFont(
                certificateHierarchyHeadingLabel.getFont().getStyle() | java.awt.Font.BOLD));
    certificateHierarchyHeadingLabel.setText(
        org.openide.util.NbBundle.getMessage(
            CertificateChainDisplay.class,
            "CertificateChainDisplay.certificateHierarchyHeadingLabel.text")); // NOI18N
    certificateHierarchyHeadingLabel.setBorder(
        javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    detailPane.add(certificateHierarchyHeadingLabel, gridBagConstraints);

    jScrollPane1.setMinimumSize(new java.awt.Dimension(75, 75));
    jScrollPane1.setPreferredSize(new java.awt.Dimension(75, 75));

    certificateChainDNs.setFont(
        certificateChainDNs
            .getFont()
            .deriveFont(certificateChainDNs.getFont().getStyle() | java.awt.Font.BOLD));
    certificateChainDNs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    certificateChainDNs.setMinimumSize(new java.awt.Dimension(22, 22));
    certificateChainDNs.setPreferredSize(new java.awt.Dimension(22, 22));
    certificateChainDNs.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            certificateChainDNsValueChanged(evt);
          }
        });
    jScrollPane1.setViewportView(certificateChainDNs);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    detailPane.add(jScrollPane1, gridBagConstraints);

    certificateLayoutHeadingLabel.setFont(
        certificateLayoutHeadingLabel
            .getFont()
            .deriveFont(certificateLayoutHeadingLabel.getFont().getStyle() | java.awt.Font.BOLD));
    certificateLayoutHeadingLabel.setText(
        org.openide.util.NbBundle.getMessage(
            CertificateChainDisplay.class,
            "CertificateChainDisplay.certificateLayoutHeadingLabel.text")); // NOI18N
    certificateLayoutHeadingLabel.setBorder(
        javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    detailPane.add(certificateLayoutHeadingLabel, gridBagConstraints);

    certificateDetailScrollPanel.setPreferredSize(new java.awt.Dimension(22, 22));
    certificateDetailScrollPanel.setViewportView(certificateDetail);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    detailPane.add(certificateDetailScrollPanel, gridBagConstraints);

    tabPanel.addTab(
        org.openide.util.NbBundle.getMessage(
            CertificateChainDisplay.class,
            "CertificateChainDisplay.detailPane.TabConstraints.tabTitle"),
        detailPane); // NOI18N

    add(tabPanel, java.awt.BorderLayout.CENTER);
  } // </editor-fold>//GEN-END:initComponents
/**
 * Main Corona debugger class
 *
 * @author Jan Jancura, Jaroslav Tulach
 * @version 0.47, May 26, 1998
 */
public class ToolsDebugger extends AbstractDebugger {

  // static ........................................................................

  static final long serialVersionUID = 2791375515739651906L;

  /** bundle to obtain text information from */
  static ResourceBundle bundle = org.openide.util.NbBundle.getBundle(ToolsDebugger.class);

  static final int TIMEOUT = 5000;

  private static CoreBreakpoint.Event[] breakpointEvents;
  private static CoreBreakpoint.Action[] breakpointActions;
  private static String host = "localhost"; // NOI18N

  static {
    breakpointEvents =
        new CoreBreakpoint.Event[] {
          new LineBreakpoint(), new MethodBreakpoint(), new ExceptionBreakpoint()
        };
    breakpointActions = new CoreBreakpoint.Action[] {};
  }

  // variables .................................................................

  /* Helper for synchronizing sun.tools.debug */
  transient RequestSynchronizer synchronizer;
  /* sun.tools.debug main debugger class */
  transient RemoteDebugger remoteDebugger = null;
  /* debugged process */
  private transient Process process;
  private transient String hostName;
  private transient String password;
  private transient String mainClassName;
  private transient String stopClassName;

  // threads
  private transient ToolsThread currentThread = null;
  transient RemoteThread lastCurrentThread = null;
  protected transient ToolsThreadGroup threadGroup = new ToolsThreadGroup(this, null);

  /** Refresh thread. */
  private transient Thread debuggerThread;

  // properties
  private transient String sourcePath = null;
  private transient String[] exceptionCatchList = null;
  private transient DebuggerInfo debuggerInfo;

  transient RequestSynchronizer.RequestWaiter killer;

  transient boolean stopOnMainFlag;

  // init .......................................................................

  public ToolsDebugger() {
    this(false, null);
  }

  public ToolsDebugger(boolean multisession, Validator validator) {
    super(multisession, validator);
    killer =
        new RequestSynchronizer.RequestWaiter() {
          public void run(Thread t) {
            // S ystem.out.println ("KILL!!!"); // NOI18N
            // T hread.dumpStack ();
            if (process != null) {
              if (System.getProperty("netbeans.full.hack") == null) { // [PENDING]
                process.destroy();
                t.stop();
              }
              TopManager.getDefault()
                  .notify(
                      new NotifyDescriptor.Message(
                          new MessageFormat(bundle.getString("EXC_Deadlock"))
                              .format(new Object[] {t.getName()})));
            }
          }
        };
  }

  /** Deserializes debugger. */
  protected void setDebugger(AbstractDebugger debugger) {
    super.setDebugger(debugger);
  }

  // Debugger implementation .................................................................

  /**
   * Starts the debugger. The method stops the current debugging (if any) and takes information from
   * the provided info (containing the class to start and arguments to pass it and name of class to
   * stop debugging in) and starts new debugging session.
   *
   * @param info debugger info about class to start
   * @exception DebuggerException if an error occures during the start of the debugger
   */
  public void startDebugger(DebuggerInfo info) throws DebuggerException {
    debuggerInfo = info;
    if (remoteDebugger != null) finishDebugger();
    // S ystem.out.println("startDebugger " + info); // NOI18N
    // RemoteDebugging support
    hostName = null;
    password = null;
    boolean local = true;
    if (info instanceof ReconnectDebuggerInfo) {
      ReconnectDebuggerInfo rdi = (ReconnectDebuggerInfo) info;
      hostName = rdi.getHostName();
      password = rdi.getPassword();
      local = false;
    } else if (info instanceof RemoteDebuggerInfo) {
      hostName = ((RemoteDebuggerInfo) info).getHostName();
      password = ((RemoteDebuggerInfo) info).getPassword();
      local = false;
    }
    boolean stopOnMain = info.getStopClassName() != null;
    stopOnMainFlag = stopOnMain;
    // S ystem.out.println ("ToolsDebugger.startDebugger " + info.getStopClassName ()); // NOI18N
    // T hread.dumpStack ();

    synchronizer = new RequestSynchronizer();

    // open output window ...
    super.startDebugger(info);

    // start & init remote debugger ................................................
    //    process = null;
    if (local) {
      // create process & read password for local debugging

      // create starting string & NbProcessDescriptor
      NbProcessDescriptor debugerProcess;
      if (info instanceof ProcessDebuggerInfo)
        debugerProcess = ((ProcessDebuggerInfo) info).getDebuggerProcess();
      else debugerProcess = ProcessDebuggerType.DEFAULT_DEBUGGER_PROCESS;
      HashMap map;
      if (info instanceof ToolsDebugger10Info) {
        map =
            Utils.processDebuggerInfo(
                info,
                "-debug", // NOI18N
                "sun.tools.debug.EmptyApp" // NOI18N
                );
        map.put(ToolsDebugger10Type.JAVA_HOME_SWITCH, ((ToolsDebugger10Info) info).getJavaHome());
      } else {
        if (info instanceof ToolsDebugger11Info) {
          String javaHome11 = ((ToolsDebugger11Info) info).getJavaHome();
          if ((javaHome11 == null) || (javaHome11.trim().length() == 0)) {
            finishDebugger();
            throw new DebuggerException(bundle.getString("EXC_JDK11_home_is_not_set"));
          }
          map =
              Utils.processDebuggerInfo(
                  info,
                  "-debug -nojit", // NOI18N
                  "sun.tools.debug.EmptyApp" // NOI18N
                  );
          map.put(ToolsDebugger11Type.JAVA_HOME_SWITCH, javaHome11);
        } else {
          map =
              Utils.processDebuggerInfo(
                  info,
                  "-Xdebug", // NOI18N
                  "sun.tools.agent.EmptyApp" // NOI18N
                  );
        }
      }
      MapFormat format = new MapFormat(map);
      String s =
          format.format(
              debugerProcess.getProcessName() + " " + debugerProcess.getArguments() // NOI18N
              );
      println(s, ERR_OUT);

      // start process & read password ......................................
      try {
        process = debugerProcess.exec(format);
        BufferedReader bufferedreader =
            new BufferedReader(new InputStreamReader(process.getInputStream()));
        password = bufferedreader.readLine();
        showOutput(process, ERR_OUT, ERR_OUT);
        connectInput(process);
      } catch (java.lang.Exception e) {
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_While_create_debuggee"))
                .format(
                    new Object[] {format.format(debugerProcess.getProcessName()), e.toString()}),
            e);
      }
      if (password == null) {
        // no reply
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_While_connect_to_debuggee"))
                .format(new Object[] {format.format(debugerProcess.getProcessName())}));
      }
      if (password.indexOf("=") < 0) { // NOI18N
        // unexpected reply
        println(bundle.getString("CTL_Unexpected_reply") + ": " + password, ERR_OUT);
        showOutput(process, ERR_OUT + STD_OUT, ERR_OUT);
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_Unecpected_debugger_reply"))
                .format(new Object[] {password}));
      }
      password = password.substring(password.indexOf("=") + 1); // NOI18N
      println(bundle.getString("CTL_Password") + ": " + password, ERR_OUT);
      hostName = "127.0.0.1"; // NOI18N
    } // end of local debugging specific
    else if (info instanceof ReconnectDebuggerInfo) {
      println(bundle.getString("CTL_Reconnecting"), ERR_OUT | STD_OUT);
    } else
      println(bundle.getString("CTL_Connecting_to") + ": " + hostName + ":" + password, ERR_OUT);

    // start RemoteDebugger ...................................................
    try {
      remoteDebugger =
          new RemoteDebugger(
              hostName,
              password.length() < 1 ? null : password,
              new ToolsCallback(this),
              isShowMessages());
    } catch (java.net.ConnectException e) {
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_Cannot_connect_to_debuggee"))
              .format(new Object[] {e.toString()}),
          e);
    } catch (Throwable e) {
      if (e instanceof ThreadDeath) throw (ThreadDeath) e;
      // e.printStackTrace ();
      finishDebugger();
      throw new DebuggerException(
          new MessageFormat(bundle.getString("EXC_Cannot_connect_to_debuggee"))
              .format(new Object[] {e.toString()}),
          e);
    }

    // create arguments for main class ...............................................
    mainClassName = info.getClassName();
    RemoteClass cls;
    String[] args = null;
    if ((mainClassName != null) && (mainClassName.length() > 0)) {
      String[] infoArgs = info.getArguments();
      args = new String[infoArgs.length + 1];
      args[0] = mainClassName;
      System.arraycopy(infoArgs, 0, args, 1, infoArgs.length);
      // args[0] = name of class
      // args[...] = parameters

      // find main class .........................................................
      try {
        cls = remoteDebugger.findClass(mainClassName);
      } catch (Throwable e) {
        if (e instanceof ThreadDeath) throw (ThreadDeath) e;
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_Cannot_find_class"))
                .format(new Object[] {mainClassName, e.toString()}),
            e);
      }
      if (cls == null) {
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_Cannot_find_class"))
                .format(new Object[] {mainClassName, new ClassNotFoundException().toString()}));
      }
    }

    // set breakpoint on stop class method ...............................................
    if (stopOnMain) {
      RemoteClass stopClass = null;
      try {
        stopClass = remoteDebugger.findClass(stopClassName = info.getStopClassName());
      } catch (Throwable e) {
        if (e instanceof ThreadDeath) throw (ThreadDeath) e;
        println(
            bundle.getString("MSG_Exc_while_finding_class") + stopClassName + '\n' + e, ERR_OUT);
      }
      if (stopClass == null) {
        println(bundle.getString("CTL_No_such_class") + ": " + stopClassName, ERR_OUT);
      } else {
        try {
          RemoteField[] rf = stopClass.getMethods();
          int i, k = rf.length;
          Type t = Type.tMethod(Type.tVoid, new Type[] {Type.tArray(Type.tString)});
          Type startT = Type.tMethod(Type.tVoid);
          RemoteField startM = null;
          RemoteField initM = null;
          RemoteField constM = null;
          for (i = 0; i < k; i++) {
            if (rf[i].getName().equals("main")
                && // NOI18N
                rf[i].getType().equals(t)) break;
            else if (rf[i].getName().equals("start")
                && // NOI18N
                rf[i].getType().equals(startT)) startM = rf[i];
            else if (rf[i].getName().equals("init")
                && // NOI18N
                rf[i].getType().equals(startT)) initM = rf[i];
            else if (rf[i].getName().equals("<init>")
                && // NOI18N
                rf[i].getType().equals(startT)) constM = rf[i];
          }
          if (i < k) // [PENDING] stop on non main too !!!!!!!!!!!!!!!!!!!!!
          stopClass.setBreakpointMethod(rf[i]); // have main
          else if (initM != null) stopClass.setBreakpointMethod(initM);
          else if (startM != null) stopClass.setBreakpointMethod(startM);
          else if (constM != null) stopClass.setBreakpointMethod(constM);

          // S ystem.out.println ("Stop: " + (i <k) + " " + initM +" " + startM +" " + constM); //
          // NOI18N
          /*          pendingBreakpoints = new RemoteField [1];
          pendingBreakpoints [0] = rf[i];
          pendingBreakpointsClass = stopClass;*/
        } catch (Throwable e) {
          if (e instanceof ThreadDeath) throw (ThreadDeath) e;
          println(bundle.getString("MSG_Exc_while_setting_breakpoint") + '\n' + e, ERR_OUT);
        }
      }
    } // stopOnMain

    setBreakpoints();
    updateWatches();
    println(bundle.getString("CTL_Debugger_running"), STL_OUT);
    setDebuggerState(DEBUGGER_RUNNING);

    // run debugged class ...............................................
    if (args != null) {
      RemoteThreadGroup rtg = null;
      try {
        rtg = remoteDebugger.run(args.length, args);
        //        threadGroup.setRemoteThreadGroup (rtg);
      } catch (Throwable e) {
        if (e instanceof ThreadDeath) throw (ThreadDeath) e;
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_While_calling_run"))
                .format(new Object[] {mainClassName, e.toString()}),
            e);
      }
      if (rtg == null) {
        finishDebugger();
        throw new DebuggerException(
            new MessageFormat(bundle.getString("EXC_While_calling_run"))
                .format(
                    new Object[] {
                      mainClassName, "" // NOI18N
                    }));
      }
    }

    // start refresh thread .................................................
    if (debuggerThread != null) debuggerThread.stop();
    debuggerThread =
        new Thread(
            new Runnable() {
              public void run() {
                for (; ; ) {
                  try {
                    Thread.sleep(5000);
                  } catch (InterruptedException ex) {
                  }
                  if (getState() == DEBUGGER_RUNNING)
                    try {
                      threadGroup.threadChanged();

                    } catch (Throwable e) {
                      if (e instanceof ThreadDeath) throw (ThreadDeath) e;
                      if (e instanceof java.net.SocketException) {
                        debuggerThread = null;
                        try {
                          finishDebugger();
                        } catch (Throwable ee) {
                          if (ee instanceof ThreadDeath) throw (ThreadDeath) ee;
                        }
                        Thread.currentThread().stop();
                      }
                    }
                }
              }
            },
            "Debugger refresh thread"); // NOI18N
    debuggerThread.setPriority(Thread.MIN_PRIORITY);
    debuggerThread.start();
  }

  /** Finishes debugger. */
  public void finishDebugger() throws DebuggerException {
    threadGroup.setRemoteThreadGroup(null);
    if (remoteDebugger != null) {
      remoteDebugger.close();
      remoteDebugger = null;
    }
    if (process != null) process.destroy();
    if (debuggerThread != null) {
      debuggerThread.interrupt();
      debuggerThread.stop();
    }

    super.finishDebugger();

    synchronizer = null;
  }

  /** Trace into. */
  public void traceInto() throws DebuggerException {
    if (currentThread == null) return;

    setLastAction(ACTION_TRACE_INTO);
    currentThread.setLastAction(ACTION_TRACE_INTO);
    new Protector("AbstractDebugger.traceInto") { // NOI18N
      public Object protect() throws Exception {
        currentThread.getRemoteThread().step(true);
        ToolsDebugger.super.traceInto();
        return null;
      }
    }.go(synchronizer, killer);
  }

  /** Trace over. */
  public void traceOver() throws DebuggerException {
    if (currentThread == null) return;

    setLastAction(ACTION_TRACE_OVER);
    currentThread.setLastAction(ACTION_TRACE_OVER);
    new Protector("AbstractDebugger.traceOver") { // NOI18N
      public Object protect() throws Exception {
        currentThread.getRemoteThread().next();
        ToolsDebugger.super.traceOver();
        return null;
      }
    }.go(synchronizer, killer);
  }

  /** Go. */
  public void go() throws DebuggerException {
    if (currentThread == null) return;

    setLastAction(ACTION_GO);
    currentThread.setLastAction(ACTION_GO);
    new Protector("AbstractDebugger.go") { // NOI18N
      public Object protect() throws Exception {
        remoteDebugger.cont();
        ToolsDebugger.super.go();
        return null;
      }
    }.go(synchronizer, killer);

    // threadGroup.setSuspended (false);
  }

  /** Step out. */
  public void stepOut() throws DebuggerException {
    if (currentThread == null) return;

    setLastAction(ACTION_STEP_OUT);
    currentThread.setLastAction(ACTION_STEP_OUT);
    new Protector("AbstractDebugger.stepOut") { // NOI18N
      public Object protect() throws Exception {
        currentThread.getRemoteThread().stepOut();
        ToolsDebugger.super.stepOut();
        return null;
      }
    }.go(synchronizer, killer);
  }

  // WATCHES ..............................................................

  /**
   * Creates new uninitialized watch. The watch is visible (not hidden).
   *
   * @return new uninitialized watch
   */
  public Watch createWatch() {
    ToolsWatch w = new ToolsWatch(this);
    watch.addElement(w);
    fireWatchCreated(w);
    return w;
  }

  /**
   * Creates a watch its expression is set to initial value. Also allows to create a watch not
   * presented to the user, for example for internal usage in the editor to obtain values of
   * variables under the mouse pointer.
   *
   * @param expr expresion to watch for
   * @param hidden allows to specify whether the watch should be presented to the user or not (be
   *     only of internal usage of the IDE).
   * @return new watch
   */
  public Watch createWatch(String expr, boolean hidden) {
    ToolsWatch w = new ToolsWatch(this);
    if (!hidden) watch.addElement(w);
    w.setVariableName(expr);
    if (!hidden) fireWatchCreated(w);
    return w;
  }

  // AbstractDebugger implementation ..................................................

  // properties ........................

  /** Returns version of this debugger. */
  public String getVersion() {
    return bundle.getString("CTL_Debugger_version");
  }

  /** Returns size of memory. */
  public int getTotalMemory() throws DebuggerException {
    if (remoteDebugger == null) return 0;
    try {
      return ((Integer)
              new Protector("AbstractDebugger.getTotalMemory") { // NOI18N
                public Object protect() throws Exception {
                  return new Integer(remoteDebugger.totalMemory());
                }
              }.throwAndWait(synchronizer, killer))
          .intValue();
    } catch (Exception e) {
      throw new DebuggerException(e);
    }
  }

  /** Returns size of free memory. */
  public int getFreeMemory() throws DebuggerException {
    if (remoteDebugger == null) return 0;
    try {
      return ((Integer)
              new Protector("AbstractDebugger.getFreeMemory") { // NOI18N
                public Object protect() throws Exception {
                  return new Integer(remoteDebugger.freeMemory());
                }
              }.throwAndWait(synchronizer, killer))
          .intValue();
    } catch (Exception e) {
      throw new DebuggerException(e);
    }
  }

  /** @return newly constructed string containing classpath obtained from filesystems */
  public String getClasspath() {
    if (remoteDebugger != null) {
      try {
        return remoteDebugger.getSourcePath();
      } catch (Exception e) {
      }
    }
    return ""; // getDefaultClasspath (); // NOI18N
  }

  /** @return Connect Panel for this version of debugger. */
  public JComponent getConnectPanel() {
    return new Connector();
  }

  /** @return name of proces for given DebuggerInfo. */
  public String getProcessName(DebuggerInfo info) {
    String n;
    if (info instanceof RemoteDebuggerInfo)
      return ((RemoteDebuggerInfo) info).getHostName()
          + ":"
          + // NOI18N
          ((RemoteDebuggerInfo) info).getPassword();
    else return (info.getStopClassName() != null) ? info.getStopClassName() : info.getClassName();
  }

  /** @return name of location for given DebuggerInfo. */
  public String getLocationName(DebuggerInfo info) {
    String n;
    if (info instanceof RemoteDebuggerInfo) return ((RemoteDebuggerInfo) info).getHostName();
    else return "localhost";
  }

  /** Returns false, ToolsDebugger does not support evaluation of expressions. */
  public boolean supportsExpressions() {
    return false;
  }

  // breakpoints ........................

  /** Returns events available for this version of debugger. */
  public CoreBreakpoint.Event[] getBreakpointEvents() {
    return breakpointEvents;
  }

  /** Returns actions available for this version of debugger. */
  public CoreBreakpoint.Action[] getBreakpointActions() {
    return breakpointActions;
  }

  // threads ........................

  /** Returns root of all threads. */
  public AbstractThreadGroup getThreadGroupRoot() {
    return threadGroup;
  }

  /** Returns current thread or null. */
  public AbstractThread getCurrentThread() {
    return currentThread;
  }

  /** Sets current thread. If thread is null, unsets curent thread. */
  public void setCurrentThread(AbstractThread thread) {
    if (currentThread == thread) return;
    Object old = currentThread;
    currentThread = (ToolsThread) thread;
    firePropertyChange(PROP_CURRENT_THREAD, old, thread);
  }

  // support for multisession debugging
  // ................................................................

  /** Disconnects from running debugged process. */
  public void disconnect() throws DebuggerException {
    threadGroup.setRemoteThreadGroup(null);
    if (remoteDebugger != null) {
      remoteDebugger.close();
      remoteDebugger = null;
    }
    if (debuggerThread != null) {
      debuggerThread.interrupt();
      debuggerThread.stop();
    }
    super.finishDebugger();
    synchronizer = null;
  }

  /** Reconnects to disconnected Virtual Machine. */
  public void reconnect() throws DebuggerException {
    startDebugger(new ReconnectDebuggerInfo(hostName, password));
  }

  /**
   * Adds breakpoint on the method specified from the RemoteDebugger. Is called from CoreBreakpoint
   * only.
   *
   * @return true if breakpoint is valid.
   */
  boolean addBreakpoint(final String className, final String method) {
    if (synchronizer == null) return false;
    try {
      return ((Boolean)
              new Protector("AbstractDebugger.addBreakpoint1") { // NOI18N
                public Object protect() throws Exception {
                  RemoteClass cls = remoteDebugger.findClass(className);
                  if (cls == null) return new Integer(0);
                  RemoteField m = cls.getMethod(method);
                  if (m == null) return new Integer(0);
                  String s = cls.setBreakpointMethod(m);
                  if (s.trim().equals("")) new Integer(1); // NOI18N
                  println(bundle.getString("CTL_Cannot_set_breakpoint") + ": " + s, ERR_OUT);
                  return new Boolean(false);
                }
              }.throwAndWait(synchronizer, killer))
          .booleanValue();
    } catch (Exception e) {
      return false;
    }
  }

  /**
   * Removes breakpoint on the method specified from the RemoteDebugger. Is called from
   * CoreBreakpoint only.
   */
  boolean removeBreakpoint(final String className, final String method) {
    if (synchronizer == null) return false;

    try {
      return ((Boolean)
              new Protector("AbstractDebugger.removeBreakpoint") { // NOI18N
                public Object protect() throws Exception {
                  RemoteClass cls = remoteDebugger.findClass(className);
                  if (cls == null) return new Boolean(false);
                  RemoteField m = cls.getMethod(method);
                  if (m == null) return new Boolean(false);
                  String s = cls.clearBreakpointMethod(m);
                  if (s.trim().equals("")) return new Boolean(true); // NOI18N
                  println(bundle.getString("CTL_Cannot_clear_breakpoint") + ": " + s, ERR_OUT);
                  return new Boolean(false);
                }
              }.throwAndWait(synchronizer, killer))
          .booleanValue();
    } catch (Exception e) {
      return false;
    }
  }

  /** Sets current line in editor. */
  Line getLine(final RemoteStackFrame stackFrame) {
    return (Line)
        new Protector("AbstractDebugger.showInEditor") { // NOI18N
          public Object protect() throws Exception {
            try {
              return Utils.getLineForSource(
                  stackFrame.getRemoteClass().getName(),
                  stackFrame.getRemoteClass().getSourceFileName(),
                  stackFrame.getLineNumber());
            } catch (Throwable e) {
              if (e instanceof ThreadDeath) throw (ThreadDeath) e;
            }
            return null;
          }
        }.wait(synchronizer, killer);
  }

  /** Performs stop action. */
  void stop(boolean stop, final AbstractThread thread) {
    /*
        int lastAction = null;
        int currentStackDepth = 0;
        int lastStackDepth = 0;
        if (!stop) { // obtain values only if they are really needed
          lastAction = ((ToolsThread)thread).getLastAction ();
          lastStackDepth = ((ToolsThread)thread).getLastStackDepth ();
          try {
            currentStackDepth = ((ToolsThread)thread).getStackDepth ();
          }
          catch (DebuggerException e) {
            currentStackDepth = lastStackDepth + 1; // the condition in the following 'if' will be false
          }
    }
        if (stop || (lastAction == ACTION_TRACE_INTO) ||
          ((lastAction == ACTION_TRACE_OVER) && (currentStackDepth <= lastStackDepth)) ||
          ((lastAction == ACTION_STEP_OUT) && (currentStackDepth < lastStackDepth))
          ) {
        */
    if (stop) {
      setLastAction(ACTION_BREAKPOINT_HIT);
      setDebuggerState(DEBUGGER_STOPPED);
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              try {
                threadGroup.threadChanged();
                // 'thread' could be created by Event.getThread (), but we must use a ToolsThread
                // created by threadChanged method (line above)
                AbstractThread tt = threadGroup.getThread(((ToolsThread) thread).getRemoteThread());
                if (tt == null) tt = thread;
                // **************************************************************************************
                tt.setCurrent(true);
                ((ToolsThread) tt).setLastAction(ACTION_BREAKPOINT_HIT);
              } catch (Throwable e) {
                if (e instanceof ThreadDeath) throw (ThreadDeath) e;
                println(bundle.getString("EXC_Debugger") + ": " + e, ERR_OUT); // NOI18N
                return;
              }
              updateWatches();
            }
          });
    } else {
      int lastAction = ((ToolsThread) thread).getLastAction();
      if ((lastAction == ACTION_TRACE_OVER) || (lastAction == ACTION_STEP_OUT))
        new Protector("AbstractDebugger.stepOut") { // NOI18N
          public Object protect() throws Exception {
            ((ToolsThread) thread).getRemoteThread().stepOut();
            return null;
          }
        }.go(synchronizer, killer);
      else {
        new Protector("AbstractDebugger.go") { // NOI18N
          public Object protect() throws Exception {
            remoteDebugger.cont();
            return null;
          }
        }.go(synchronizer, killer);
      }
    }
  }

  // innerclasses ......................................................................

  private class ReconnectDebuggerInfo extends RemoteDebuggerInfo {
    private ReconnectDebuggerInfo(String hostName, String password) {
      super(hostName, password);
    }
  }

  private class Connector extends JPanel implements DebuggerInfoProducer {

    private JTextField tfHost;
    private JTextField tfPassword;

    private Connector() {
      setLayout(new GridBagLayout());
      //      setBorder (new EmptyBorder (8, 8, 8, 8));
      GridBagConstraints c = new GridBagConstraints();

      c.insets = new Insets(0, 0, 3, 3);
      c.anchor = GridBagConstraints.WEST;
      add(new JLabel(bundle.getString("CTL_HostName")), c);

      tfHost = new JTextField(host, 25);
      c = new GridBagConstraints();
      c.gridwidth = 0;
      c.insets = new Insets(0, 3, 3, 0);
      c.fill = java.awt.GridBagConstraints.HORIZONTAL;
      c.weightx = 1.0;
      add(tfHost, c);

      c = new GridBagConstraints();
      c.insets = new Insets(3, 0, 0, 3);
      c.anchor = GridBagConstraints.WEST;
      add(new JLabel(bundle.getString("CTL_Password")), c);

      tfPassword = new JTextField(25);
      c = new GridBagConstraints();
      c.gridwidth = 0;
      c.fill = java.awt.GridBagConstraints.HORIZONTAL;
      c.weightx = 1.0;
      c.insets = new Insets(3, 3, 0, 0);
      add(tfPassword, c);

      c = new GridBagConstraints();
      c.fill = java.awt.GridBagConstraints.BOTH;
      c.weighty = 1.0;
      JPanel p = new JPanel();
      p.setPreferredSize(new Dimension(1, 1));
      add(p, c);
    }

    /** Returns DebuggerInfo. */
    public DebuggerInfo getDebuggerInfo() {
      return new RemoteDebuggerInfo(tfHost.getText(), tfPassword.getText());
    }
  }
}