diff --git a/plugins/TestingList.form b/plugins/TestingList.form index fec3bf8..dbfcc43 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -75,7 +75,7 @@ - + @@ -97,31 +97,73 @@ - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -149,7 +191,7 @@ - + @@ -174,7 +216,7 @@ - + @@ -196,32 +238,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 5f9d151..5bca6c1 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -298,13 +298,14 @@ public class TestingList extends Panel { jTable1 = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); jButtonRun = new javax.swing.JButton(); + jPanel3 = new javax.swing.JPanel(); jButtonOpenLog = new javax.swing.JButton(); + jButtonOpen = new javax.swing.JButton(); + jButtonSave = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jCheckBox1 = new javax.swing.JCheckBox(); jButtonMoveDown = new javax.swing.JButton(); jButtonMoveUp = new javax.swing.JButton(); - jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); setLayout(new java.awt.BorderLayout()); @@ -354,7 +355,7 @@ public class TestingList extends Panel { jPanel1.setPreferredSize(new java.awt.Dimension(110, 110)); jPanel1.setLayout(new java.awt.BorderLayout()); - jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/button_play-64px.png"))); // NOI18N + jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/play-circled-64-000000.png"))); // NOI18N jButtonRun.setToolTipText("Run selected tests"); jButtonRun.setMaximumSize(new java.awt.Dimension(33, 39)); jButtonRun.setMinimumSize(new java.awt.Dimension(90, 90)); @@ -366,17 +367,38 @@ public class TestingList extends Panel { }); jPanel1.add(jButtonRun, java.awt.BorderLayout.CENTER); - jButtonOpenLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/log-icon-64px.png"))); // NOI18N + jPanel3.setLayout(new java.awt.BorderLayout()); + + jButtonOpenLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/logbook-64px.png"))); // NOI18N jButtonOpenLog.setToolTipText("Open current sessions Log"); jButtonOpenLog.setMaximumSize(new java.awt.Dimension(80, 39)); jButtonOpenLog.setMinimumSize(new java.awt.Dimension(90, 90)); - jButtonOpenLog.setPreferredSize(new java.awt.Dimension(90, 39)); + jButtonOpenLog.setPreferredSize(new java.awt.Dimension(90, 70)); jButtonOpenLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonOpenLogActionPerformed(evt); } }); - jPanel1.add(jButtonOpenLog, java.awt.BorderLayout.EAST); + jPanel3.add(jButtonOpenLog, java.awt.BorderLayout.SOUTH); + + jButtonOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/folder-open-24-000000.png"))); // NOI18N + jButtonOpen.setToolTipText(""); + jButtonOpen.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonOpenActionPerformed(evt); + } + }); + jPanel3.add(jButtonOpen, java.awt.BorderLayout.CENTER); + + jButtonSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/android-save-24-000000.png"))); // NOI18N + jButtonSave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonSaveActionPerformed(evt); + } + }); + jPanel3.add(jButtonSave, java.awt.BorderLayout.LINE_END); + + jPanel1.add(jPanel3, java.awt.BorderLayout.EAST); jPanel2.setLayout(new java.awt.BorderLayout()); @@ -390,7 +412,7 @@ public class TestingList extends Panel { }); jPanel2.add(jCheckBox1, java.awt.BorderLayout.WEST); - jButtonMoveDown.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/ArrowDown - 24.png"))); // NOI18N + jButtonMoveDown.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/chevron-down-16-000000.png"))); // NOI18N jButtonMoveDown.setToolTipText("Move the highlighted tests down"); jButtonMoveDown.setMaximumSize(new java.awt.Dimension(25, 25)); jButtonMoveDown.setMinimumSize(new java.awt.Dimension(25, 25)); @@ -402,7 +424,7 @@ public class TestingList extends Panel { }); jPanel2.add(jButtonMoveDown, java.awt.BorderLayout.SOUTH); - jButtonMoveUp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/ArrowUp - 24.png"))); // NOI18N + jButtonMoveUp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/chevron-up-16-000000.png"))); // NOI18N jButtonMoveUp.setToolTipText("Move the highlighted tests up"); jButtonMoveUp.setMaximumSize(new java.awt.Dimension(25, 25)); jButtonMoveUp.setMinimumSize(new java.awt.Dimension(25, 25)); @@ -414,22 +436,6 @@ public class TestingList extends Panel { }); jPanel2.add(jButtonMoveUp, java.awt.BorderLayout.PAGE_START); - jButton1.setText("jButton1"); - jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); - } - }); - jPanel2.add(jButton1, java.awt.BorderLayout.CENTER); - - jButton2.setText("jButton2"); - jButton2.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton2ActionPerformed(evt); - } - }); - jPanel2.add(jButton2, java.awt.BorderLayout.LINE_END); - jPanel1.add(jPanel2, java.awt.BorderLayout.LINE_START); add(jPanel1, java.awt.BorderLayout.NORTH); @@ -448,13 +454,13 @@ public class TestingList extends Panel { private void setButtonToStop() { abort(); this.jButtonRun.setToolTipText("Run selected tests"); - jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/button_play-64px.png"))); + jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/play-circled-64-000000.png"))); this.jTable1.setEnabled(true); } private void setButtonToStart() { this.jButtonRun.setToolTipText("Stop tests"); - jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/button_stop-64px.png"))); + jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/stop-circled-64-000000.png"))); this.jTable1.clearSelection(); this.jTable1.setEnabled(false); } @@ -531,8 +537,8 @@ public class TestingList extends Panel { moveUp(); }//GEN-LAST:event_jButtonMoveUpActionPerformed - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - + private void jButtonOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpenActionPerformed + this.loadSettings(); new Thread(() -> { try { //Object ret = eval("parallelize((run,('testLocalVar1',globals(),{'a':'21', 'b':34})), (run,('testLocalVar2',globals(),{'a':231, 'b':234})))"); @@ -548,24 +554,24 @@ public class TestingList extends Panel { } }).start(); - }//GEN-LAST:event_jButton1ActionPerformed + }//GEN-LAST:event_jButtonOpenActionPerformed - private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed - // TODO add your handling code here: - this.loadSettings(); - }//GEN-LAST:event_jButton2ActionPerformed + private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed + saveSettings(); + }//GEN-LAST:event_jButtonSaveActionPerformed // // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; - private javax.swing.JButton jButton2; private javax.swing.JButton jButtonMoveDown; private javax.swing.JButton jButtonMoveUp; + private javax.swing.JButton jButtonOpen; private javax.swing.JButton jButtonOpenLog; private javax.swing.JButton jButtonRun; + private javax.swing.JButton jButtonSave; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable1; // End of variables declaration//GEN-END:variables @@ -1244,23 +1250,6 @@ public class TestingList extends Panel { return mParameters; } - /** - *Open file selector - */ - public void selectFile() { - final JFileChooser fc = new JFileChooser(); - - int returnVal = fc.showOpenDialog(NetbeansPluginPanel.this); - - if (returnVal == JFileChooser.APPROVE_OPTION) { - File file = fc.getSelectedFile(); - //This is where a real application would open the file. - System.out.println("Opening: " + file.getName() + "."); - } else { - System.out.println("Open command cancelled by user."); - } - } - /** * Save current setup in a file. * The current position of table rows is also saved. @@ -1268,7 +1257,7 @@ public class TestingList extends Panel { public void saveSettings() { final JFileChooser fc = new JFileChooser(); - int returnVal = fc.showOpenDialog(NetbeansPluginPanel.this); + int returnVal = fc.showSaveDialog(NetbeansPluginPanel.this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); @@ -1319,9 +1308,10 @@ public class TestingList extends Panel { ObjectInputStream in = new ObjectInputStream(new FileInputStream(file)); Vector rowData = (Vector) in.readObject(); Iterator itr = rowData.iterator(); - for (int row = 0; row < jTable1.getRowCount(); row++) { - tableModel.removeRow(row); - } + //clear table + tableModel.getDataVector().removeAllElements(); + tableModel.fireTableDataChanged(); + //rewrite table while (itr.hasNext()) { tableModel.addRow((Vector) itr.next()); } @@ -1331,6 +1321,7 @@ public class TestingList extends Panel { SwingUtils.showMessage(this, "loadSettings()", ex.toString()); } } + //end of class }