diff --git a/plugins/TestingList.form b/plugins/TestingList.form index e817974..49ac59c 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -81,15 +81,25 @@ - - - - + + + + - + - + + + + + + + + + + + diff --git a/plugins/TestingList.java b/plugins/TestingList.java index d72cbae..8e7170f 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -39,6 +39,8 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Properties; import javax.swing.JFileChooser; @@ -162,7 +164,8 @@ public class TestingList extends Panel { jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jCheckBox1 = new javax.swing.JCheckBox(); - jTextField1 = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + jTextField1 = new javax.swing.JTextArea(); setLayout(new java.awt.BorderLayout()); @@ -229,8 +232,11 @@ public class TestingList extends Panel { }); add(jCheckBox1, java.awt.BorderLayout.LINE_START); - jTextField1.setText("jTextField1"); - add(jTextField1, java.awt.BorderLayout.PAGE_START); + jTextField1.setColumns(20); + jTextField1.setRows(5); + jScrollPane1.setViewportView(jTextField1); + + add(jScrollPane1, java.awt.BorderLayout.LINE_END); }// //GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed @@ -300,9 +306,10 @@ public class TestingList extends Panel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JCheckBox jCheckBox1; + private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable1; - private javax.swing.JTextField jTextField1; + private javax.swing.JTextArea jTextField1; // End of variables declaration//GEN-END:variables //table management @@ -339,7 +346,7 @@ public class TestingList extends Panel { return dateFormat.format(date); } - public void loadTests() throws FileNotFoundException, IOException{ + public void loadTest() throws FileNotFoundException, IOException{ Properties prop = new Properties(); String fileName = new java.io.File( "." ).getCanonicalPath()+ "\\home\\script\\tests\\devices\\LS\\.config"; this.jTextField1.setText(fileName); @@ -347,6 +354,25 @@ public class TestingList extends Panel { prop.load(is); + addToTable(prop.getProperty("name"), prop.getProperty("description")); + this.jTextField1.setText(prop.getProperty("name")); + } + + public void loadTests() throws FileNotFoundException, IOException{ + Properties prop = new Properties(); + String fileName = new java.io.File( "." ).getCanonicalPath()+ "\\home\\script\\tests\\devices\\"; + this.jTextField1.setText(fileName + "\n"); + Files.walk(Paths.get(fileName)).forEach(filePath -> { + if (Files.isRegularFile(filePath)) { + this.jTextField1.append(fileName); + System.out.println(filePath); + } + }); + + InputStream is = new FileInputStream(fileName); + + prop.load(is); + addToTable(prop.getProperty("name"), prop.getProperty("description")); this.jTextField1.setText(prop.getProperty("name")); }