diff --git a/plugins/TestingList.form b/plugins/TestingList.form index 58ad9de..ed41b17 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -104,5 +104,20 @@ + + + + + + + + + + + + + + + diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 4e1be6f..39fe58f 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -6,6 +6,7 @@ import ch.psi.utils.swing.MonitoredPanel; import ch.psi.pshell.ui.Panel; import ch.psi.utils.swing.SwingUtils; import ch.psi.wsaf.Task; +import java.awt.Desktop; import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -176,6 +177,7 @@ public class TestingList extends Panel { jCheckBox1 = new javax.swing.JCheckBox(); jScrollPane1 = new javax.swing.JScrollPane(); jTextField1 = new javax.swing.JTextArea(); + jButtonOpenLog = new javax.swing.JButton(); setLayout(new java.awt.BorderLayout(10, 10)); @@ -248,6 +250,14 @@ public class TestingList extends Panel { jScrollPane1.setViewportView(jTextField1); add(jScrollPane1, java.awt.BorderLayout.PAGE_START); + + jButtonOpenLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/log-icon.png"))); // NOI18N + jButtonOpenLog.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonOpenLogActionPerformed(evt); + } + }); + add(jButtonOpenLog, java.awt.BorderLayout.LINE_END); }// //GEN-END:initComponents private void jButtonRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRunActionPerformed @@ -317,8 +327,30 @@ public class TestingList extends Panel { updateStatus(); // TODO add your handling code here: }//GEN-LAST:event_jTable1KeyTyped + + private void jButtonOpenLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpenLogActionPerformed + // TODO add your handling code here: + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + String cmd; + cmd = "rundll32 url.dll,FileProtocolHandler " + TESTS_LOG_DEFAULT_DIR; + try { + Runtime.getRuntime().exec(cmd); + } catch (IOException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } + } + else { + File log = new File(TESTS_LOG_DEFAULT_DIR); + try { + Desktop.getDesktop().edit(log); + } catch (IOException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_jButtonOpenLogActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonOpenLog; private javax.swing.JButton jButtonRun; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JScrollPane jScrollPane1;