Closedown

This commit is contained in:
boccioli_m
2015-08-18 14:46:02 +02:00
parent 59cb0c34ac
commit d80fb06a4e
4 changed files with 378 additions and 0 deletions

View File

@@ -335,6 +335,7 @@ public class TestingList extends Panel {
jButtonOpenLog = new javax.swing.JButton();
jButtonOpen = new javax.swing.JButton();
jButtonSave = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jCheckBox1 = new javax.swing.JCheckBox();
jButtonMoveDown = new javax.swing.JButton();
@@ -432,6 +433,14 @@ public class TestingList extends Panel {
});
jPanel3.add(jButtonSave, java.awt.BorderLayout.LINE_END);
jButton1.setText("+");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jPanel3.add(jButton1, java.awt.BorderLayout.LINE_START);
jPanel1.add(jPanel3, java.awt.BorderLayout.EAST);
jPanel2.setLayout(new java.awt.BorderLayout());
@@ -588,8 +597,17 @@ public class TestingList extends Panel {
saveSettings();
}//GEN-LAST:event_jButtonSaveActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try {
openListEditor();
} catch (Exception ex) {
Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton1ActionPerformed
//<editor-fold defaultstate="collapsed" desc="Witget Variables declaration">
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButtonMoveDown;
private javax.swing.JButton jButtonMoveUp;
private javax.swing.JButton jButtonOpen;
@@ -684,6 +702,48 @@ public class TestingList extends Panel {
dlg.setVisible(true);
}
/**
* open details of the selected row in a new panel
*
* @throws exception
*/
private void openListEditor() throws Exception {
//pick details from the clicked row
/* int row = jTable1.getSelectedRow();
String sDeviceName = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
String sTestName = jTable1.getValueAt(row, COL.TESTNAME.ordinal()).toString();
String sTestPath = String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal()));
String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
String sTestDescription = jTable1.getValueAt(row, COL.TESTDESCR.ordinal()).toString();
String sDeviceDescription = jTable1.getValueAt(row, COL.DEVICEDESCR.ordinal()).toString();
String sLastResult = jTable1.getValueAt(row, COL.RESULT.ordinal()).toString();
String sResultTime = jTable1.getValueAt(row, COL.TIME.ordinal()).toString();
String sTestHelp = String.valueOf(jTable1.getValueAt(row, COL.TESTHELP.ordinal()));
HashMap mParameters = getTestParameters(sTestPath);
//create map for passing details to Details Panel
HashMap details = new HashMap();
details.put("deviceName", sDeviceName);
details.put("deviceDescription", sDeviceDescription);
details.put("testDescription", sTestDescription);
details.put("testSuite", sTestCaseName);
details.put("testName", sTestName);
details.put("testResult", sLastResult);
details.put("time", sResultTime);
details.put("parameters", mParameters);
details.put("testHelp", sTestHelp);
details.put("testPath", sTestPath);
*/ //open details panel
JDialog dlg = new JDialog(getView(), "Add/remove tests", true);
//create a class to visualise the details panel
Class editTestingListClass = getController().getClassByName("EditTestingList");
JPanel detailsPanel = (JPanel) editTestingListClass.getConstructor(new Class[]{HashMap.class}).newInstance(jTable1.getModel());
dlg.getContentPane().add(detailsPanel);
//dlg.add(new TestingListDetails());
dlg.pack();
dlg.setVisible(true);
}
/**
* put the test result in table
*