From d83304867a8ddcc4db11699863ed1814f42b66bd Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Wed, 10 Jun 2015 15:24:19 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 47 +++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 5f321f6..050db4c 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -112,15 +112,15 @@ public class TestingList extends Panel { private final String TESTS_LOG_DEFAULT_DIR = new java.io.File(".").getCanonicalPath() + FilenameUtils.separatorsToSystem("/home/script/tests/log/TestsLog" + getnow() + ".txt"); //table1 columns indexes - private final int COL_CHECK = 0; - private final int COL_TIME = 1; - private final int COL_DEVICENAME = 2; + private final int COL_CHECK = 0; + private final int COL_TIME = 1; + private final int COL_DEVICENAME = 2; private final int COL_DEVICEDESCR = 3; - private final int COL_TESTSUITE = 4; - private final int COL_TESTNAME = 5; - private final int COL_RESULT = 6; - private final int COL_STATUS = 7; - private final int COL_ICON = 8; + private final int COL_TESTSUITE = 4; + private final int COL_TESTNAME = 5; + private final int COL_RESULT = 6; + private final int COL_STATUS = 7; + private final int COL_ICON = 8; private void initLogger() { try { @@ -132,9 +132,9 @@ public class TestingList extends Panel { fh.setFormatter(formatter); logger.log(Level.INFO, "New Testing Session"); } catch (SecurityException e) { - SwingUtils.showMessage(this, "", e.toString()); + SwingUtils.showMessage(this, "", "initLogger() "+e.toString()); } catch (IOException e) { - SwingUtils.showMessage(this, "", e.toString()); + SwingUtils.showMessage(this, "", "initLogger() "+ e.toString()); } } @@ -256,12 +256,21 @@ public class TestingList extends Panel { private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed boolean bSelected = jCheckBox1.isSelected(); - for (int row = 0; row <= jTable1.getRowCount() - 1; row++) { - for(int selRow=0 ; selRow <= jTable1.getSelectedRowCount()-1 ; selRow++){ - if(row == jTable1.getSelectedRows()[selRow]) - jTable1.setValueAt(bSelected, row, 0); + int iSelRows = jTable1.getSelectedRowCount(); + + if(iSelRows>0){// if some rows are selected, check/uncheck selected rows + for (int row = 0; row <= jTable1.getRowCount()-1; row++) { + for(int selRow=0 ; selRow <= jTable1.getSelectedRowCount()-1 ; selRow++){ + if(row == jTable1.getSelectedRows()[selRow]) + jTable1.setValueAt(bSelected, row, 0); + } } } + else{//if none of the rows are selected, check/uncheck all + for (int row = 0; row <= jTable1.getRowCount()-1; row++) { + jTable1.setValueAt(bSelected, row, 0); + } + } updateStatus(); }//GEN-LAST:event_jCheckBox1ActionPerformed @@ -286,10 +295,11 @@ public class TestingList extends Panel { SwingUtils.showMessage(this, "", deviceName[0]); */ if (System.getProperty("os.name").toLowerCase().contains("windows")) { String cmd; - cmd = "notepad.exe " + TESTS_LOG_DEFAULT_DIR; + cmd = "notepad3.exe " + TESTS_LOG_DEFAULT_DIR; try { Runtime.getRuntime().exec(cmd); } catch (IOException ex) { + SwingUtils.showMessage(this, "", "jButtonOpenLogActionPerformed() "+ ex.toString() + " Please open the file manually (file dir: "+TESTS_LOG_DEFAULT_DIR); Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); } } else { @@ -297,6 +307,7 @@ public class TestingList extends Panel { try { Desktop.getDesktop().edit(log); } catch (IOException ex) { + SwingUtils.showMessage(this, "", "jButtonOpenLogActionPerformed() "+ ex.toString() + " Please open the file manually (file dir: "+TESTS_LOG_DEFAULT_DIR); Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); } } @@ -333,15 +344,15 @@ public class TestingList extends Panel { switch (status) { case "Success": iconSource = "/icons/button_ok-16px.png"; - logger.log(Level.INFO, "Device: " + testName + "Test: " + testName + " Result: " + res + " (" + status + ")"); + logger.log(Level.INFO, "Device: " + testName + "; Test: " + testName + " Result: " + res + " (" + status + ")"); break; case "Failed": iconSource = "/icons/button_close-16px.png"; - logger.log(Level.SEVERE, "Device: " + testName + "Test: " + testName + " Result: " + res + " (" + status + ")"); + logger.log(Level.SEVERE, "Device: " + testName + "; Test: " + testName + " Result: " + res + " (" + status + ")"); break; case "Running": iconSource = "/icons/button_play-16px.png"; - logger.log(Level.INFO, "Running Test: " + testName + " ... "); + logger.log(Level.INFO, "Running Test: " + testName + "."); break; } ImageIcon icon = new ImageIcon(getClass().getResource(iconSource));