Closedown
This commit is contained in:
@@ -99,6 +99,7 @@ public class TestingList extends Panel {
|
||||
|
||||
|
||||
public void showResult(String deviceName, String testName, String res, String status){
|
||||
int COL_TIME = 1;
|
||||
int COL_RESULT = 4;
|
||||
int COL_SUCCESS = 5;
|
||||
int COL_ICON = 6;
|
||||
@@ -141,6 +142,7 @@ public class TestingList extends Panel {
|
||||
jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
|
||||
if(colT>0 && rowD>0){
|
||||
jTable1.setValueAt(getNow(), rowD, COL_TIME);
|
||||
jTable1.setValueAt(res, rowD, COL_RESULT);
|
||||
jTable1.setValueAt(status, rowD, COL_SUCCESS);
|
||||
jTable1.getCellEditor(rowD, COL_SUCCESS);
|
||||
@@ -258,24 +260,25 @@ public class TestingList extends Panel {
|
||||
}//GEN-LAST:event_jCheckBox1ActionPerformed
|
||||
|
||||
public void updateStatus(){
|
||||
String sStatus, iconSource;
|
||||
boolean bSelected;
|
||||
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
|
||||
bSelected = (boolean) jTable1.getValueAt(row, 0);
|
||||
if(bSelected){
|
||||
sStatus = "Pending";
|
||||
iconSource = "/icons/button_pause-16px.png";
|
||||
}
|
||||
else{
|
||||
sStatus = "Disabled";
|
||||
iconSource = "/icons/button_stop-16px.png";
|
||||
}
|
||||
ImageIcon icon = new ImageIcon(getClass().getResource(iconSource));
|
||||
String sStatus, iconSource;
|
||||
boolean bSelected;
|
||||
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
|
||||
bSelected = (boolean) jTable1.getValueAt(row, 0);
|
||||
if(bSelected){
|
||||
sStatus = "Pending";
|
||||
iconSource = "/icons/button_pause-16px.png";
|
||||
}
|
||||
else{
|
||||
sStatus = "Disabled";
|
||||
iconSource = "/icons/button_stop-16px.png";
|
||||
}
|
||||
ImageIcon icon = new ImageIcon(getClass().getResource(iconSource));
|
||||
jTable1.setValueAt(bSelected, row, 0);
|
||||
jTable1.setValueAt(icon, row, 6);
|
||||
jTable1.setValueAt(sStatus, row, 5);
|
||||
}
|
||||
}
|
||||
|
||||
private void jTable1InputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jTable1InputMethodTextChanged
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_jTable1InputMethodTextChanged
|
||||
@@ -324,7 +327,7 @@ public class TestingList extends Panel {
|
||||
|
||||
ImageIcon icon = new ImageIcon(getClass().getResource("/icons/button_pause-16px.png"));
|
||||
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
|
||||
model.addRow(new Object[] {false, sDate, deviceName, testName, "No comm", "Pending", icon});
|
||||
model.addRow(new Object[] {false, sDate, deviceName, testName, "", "Pending", icon});
|
||||
jTable1.setModel(model);
|
||||
|
||||
updateStatus();
|
||||
@@ -335,50 +338,17 @@ public class TestingList extends Panel {
|
||||
Date date = new Date();
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
|
||||
/* public void loadTestsfail() throws FileNotFoundException, IOException{
|
||||
Properties prop = new Properties();
|
||||
FileInputStream fc = null;
|
||||
try{
|
||||
|
||||
|
||||
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
//File file = new File(classLoader.getResource("../script/tests/devices/LS/.config").getFile());
|
||||
fc = new FileInputStream(classLoader.getResource("../script/tests/devices/LS/.config").getFile()) ;
|
||||
//fc = new FileInputStream(file);
|
||||
// this.jTextField1.setText(file.toPath().toString());
|
||||
//prop.load(fc);
|
||||
|
||||
|
||||
|
||||
//addToTable(prop.getProperty("name"), prop.getProperty("description"));
|
||||
addToTable(("name"), ("description"));
|
||||
//System.out.println(prop.getProperty("tests"));
|
||||
}
|
||||
catch (IOException e) {
|
||||
this.jTextField1.setText(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if (fc != null)
|
||||
fc.close();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
public void loadTests() throws FileNotFoundException, IOException{
|
||||
Properties prop = new Properties();
|
||||
String fileName = new java.io.File( "." ).getCanonicalPath()+ "\\script\\tests\\devices\\LS\\.config";
|
||||
this.jTextField1.setText(fileName);
|
||||
//InputStream is = new FileInputStream(fileName);
|
||||
Properties prop = new Properties();
|
||||
String fileName = new java.io.File( "." ).getCanonicalPath()+ "\\home\\script\\tests\\devices\\LS\\.config";
|
||||
this.jTextField1.setText(fileName);
|
||||
InputStream is = new FileInputStream(fileName);
|
||||
|
||||
//prop.load(is);
|
||||
prop.load(is);
|
||||
|
||||
//addToTable(prop.getProperty("name"), prop.getProperty("description"));
|
||||
addToTable(prop.getProperty("name"), prop.getProperty("description"));
|
||||
this.jTextField1.setText(prop.getProperty("name"));
|
||||
}
|
||||
|
||||
public void selectFile(){
|
||||
|
||||
Reference in New Issue
Block a user