Closedown
This commit is contained in:
@@ -1,196 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[963, 556]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[963, 556]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,2,91"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Center"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[4000, 32767]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[100, 27]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[100, 146]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JList" name="jList2">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
|
||||
<StringArray count="5">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
<StringItem index="4" value="Item 5"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane5">
|
||||
<Properties>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[300, 300]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="jTable1">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Tahoma" size="15" style="0"/>
|
||||
</Property>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new javax.swing.table.DefaultTableModel(
 new Object [][] {

 },
 new String [] {
 "Select", "Start", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Description", 
 }
) {
 Class[] types = new Class [] {
 java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
 };
 boolean[] canEdit = new boolean [] {
 true, true, false, false, false, false, false, false
 };

 public Class getColumnClass(int columnIndex) {
 return types [columnIndex];
 }

 public boolean isCellEditable(int rowIndex, int columnIndex) {
 return canEdit [columnIndex];
 }
}" type="code"/>
|
||||
</Property>
|
||||
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||
<TableColumnModel selectionModel="1"/>
|
||||
</Property>
|
||||
<Property name="columnSelectionAllowed" type="boolean" value="true"/>
|
||||
<Property name="dragEnabled" type="boolean" value="true"/>
|
||||
<Property name="dropMode" type="javax.swing.DropMode" editor="org.netbeans.modules.form.editors.EnumEditor">
|
||||
<Value id="INSERT"/>
|
||||
</Property>
|
||||
<Property name="rowHeight" type="int" value="22"/>
|
||||
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTable1MouseClicked"/>
|
||||
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTable1KeyReleased"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[263, 50]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,2,91"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="South"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="cmDefault" min="-2" pref="204" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="223" max="32767" attributes="0"/>
|
||||
<Component id="cmOk" min="-2" pref="73" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
|
||||
<Component id="cmCancel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cmCancel" alignment="3" min="-2" pref="31" max="-2" attributes="0"/>
|
||||
<Component id="cmOk" alignment="3" min="-2" pref="31" max="-2" attributes="0"/>
|
||||
<Component id="cmDefault" alignment="3" min="-2" pref="31" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="cmDefault">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Save as Default"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmDefaultActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
this.cmDefault.setVisible(false);
"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="cmCancel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmCancelActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="cmOk">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Ok"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="this.cmCancel.setVisible(false);
this.cmOk.setVisible(false);
"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -1,250 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author boccioli_m
|
||||
*/
|
||||
public class EditTestingList extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Creates new form TestingListDetails
|
||||
*/
|
||||
public EditTestingList() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public EditTestingList(TableModel hDetails) {
|
||||
initComponents();
|
||||
fillComponents(hDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
jList2 = new javax.swing.JList();
|
||||
jScrollPane5 = new javax.swing.JScrollPane();
|
||||
jTable1 = new javax.swing.JTable();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
cmDefault = new javax.swing.JButton();
|
||||
cmCancel = new javax.swing.JButton();
|
||||
cmOk = new javax.swing.JButton();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(963, 556));
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
jPanel1.setPreferredSize(new java.awt.Dimension(963, 556));
|
||||
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));
|
||||
|
||||
jScrollPane2.setMaximumSize(new java.awt.Dimension(4000, 32767));
|
||||
jScrollPane2.setMinimumSize(new java.awt.Dimension(100, 27));
|
||||
jScrollPane2.setPreferredSize(new java.awt.Dimension(100, 146));
|
||||
|
||||
jList2.setModel(new javax.swing.AbstractListModel() {
|
||||
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
|
||||
public int getSize() { return strings.length; }
|
||||
public Object getElementAt(int i) { return strings[i]; }
|
||||
});
|
||||
jList2.setMaximumSize(new java.awt.Dimension(0, 0));
|
||||
jList2.setMinimumSize(new java.awt.Dimension(0, 0));
|
||||
jScrollPane2.setViewportView(jList2);
|
||||
|
||||
jPanel1.add(jScrollPane2);
|
||||
|
||||
jScrollPane5.setMinimumSize(new java.awt.Dimension(300, 300));
|
||||
|
||||
jTable1.setFont(new java.awt.Font("Tahoma", 0, 15)); // NOI18N
|
||||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
|
||||
},
|
||||
new String [] {
|
||||
"Select", "Start", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Description",
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
|
||||
};
|
||||
boolean[] canEdit = new boolean [] {
|
||||
true, true, false, false, false, false, false, false
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
return types [columnIndex];
|
||||
}
|
||||
|
||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||
return canEdit [columnIndex];
|
||||
}
|
||||
});
|
||||
jTable1.setColumnSelectionAllowed(true);
|
||||
jTable1.setDragEnabled(true);
|
||||
jTable1.setDropMode(javax.swing.DropMode.INSERT);
|
||||
jTable1.setRowHeight(22);
|
||||
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
jTable1MouseClicked(evt);
|
||||
}
|
||||
});
|
||||
jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyReleased(java.awt.event.KeyEvent evt) {
|
||||
jTable1KeyReleased(evt);
|
||||
}
|
||||
});
|
||||
jScrollPane5.setViewportView(jTable1);
|
||||
jTable1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
|
||||
jPanel1.add(jScrollPane5);
|
||||
|
||||
add(jPanel1, java.awt.BorderLayout.CENTER);
|
||||
|
||||
jPanel2.setPreferredSize(new java.awt.Dimension(263, 50));
|
||||
|
||||
cmDefault.setText("Save as Default");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
this.cmDefault.setVisible(false);
|
||||
cmDefault.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmDefaultActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
cmCancel.setText("Cancel");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
cmCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmCancelActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
cmOk.setText("Ok");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(cmDefault, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 223, Short.MAX_VALUE)
|
||||
.addComponent(cmOk, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(32, 32, 32)
|
||||
.addComponent(cmCancel))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cmCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cmOk, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cmDefault, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(25, 25, 25))
|
||||
);
|
||||
|
||||
add(jPanel2, java.awt.BorderLayout.SOUTH);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void fillComponents(TableModel hDetails) {
|
||||
jTable1.setModel(hDetails);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load test list from file
|
||||
*
|
||||
* @param file file containing the settings
|
||||
*/
|
||||
private void loadSettings(String sFileName) {
|
||||
final JFileChooser fc = new JFileChooser();
|
||||
File file = new File(sFileName);
|
||||
if (file.isFile()){
|
||||
DefaultTableModel tableModel = (DefaultTableModel) jTable1.getModel();
|
||||
try {
|
||||
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
|
||||
Vector rowData = (Vector) in.readObject();
|
||||
Iterator itr = rowData.iterator();
|
||||
//clear table
|
||||
tableModel.getDataVector().removeAllElements();
|
||||
tableModel.fireTableDataChanged();
|
||||
//rewrite table
|
||||
while (itr.hasNext()) {
|
||||
tableModel.addRow((Vector) itr.next());
|
||||
}
|
||||
in.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
SwingUtils.showMessage(this, "loadSettings()", ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
|
||||
if (this.jTable1.isEnabled()) {
|
||||
try {
|
||||
switch (evt.getClickCount()) {
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jTable1MouseClicked
|
||||
|
||||
private void jTable1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable1KeyReleased
|
||||
|
||||
}//GEN-LAST:event_jTable1KeyReleased
|
||||
|
||||
private void cmCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmCancelActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cmCancelActionPerformed
|
||||
|
||||
private void cmDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmDefaultActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cmDefaultActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton cmCancel;
|
||||
private javax.swing.JButton cmDefault;
|
||||
private javax.swing.JButton cmOk;
|
||||
private javax.swing.JList jList2;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JScrollPane jScrollPane5;
|
||||
private javax.swing.JTable jTable1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -1,351 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableModel;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author boccioli_m
|
||||
*/
|
||||
public class EditTestingListNew extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Creates new form TestingListDetails
|
||||
*/
|
||||
public EditTestingListNew() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public EditTestingListNew(TableModel hDetails) {
|
||||
initComponents();
|
||||
//fillComponents(hDetails);
|
||||
loadTests();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
jList2 = new javax.swing.JList();
|
||||
jScrollPane5 = new javax.swing.JScrollPane();
|
||||
jTable1 = new javax.swing.JTable();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
cmDefault = new javax.swing.JButton();
|
||||
cmCancel = new javax.swing.JButton();
|
||||
cmOk = new javax.swing.JButton();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(963, 556));
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
jPanel1.setPreferredSize(new java.awt.Dimension(963, 556));
|
||||
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));
|
||||
|
||||
jScrollPane2.setMaximumSize(new java.awt.Dimension(4000, 32767));
|
||||
jScrollPane2.setMinimumSize(new java.awt.Dimension(100, 27));
|
||||
jScrollPane2.setPreferredSize(new java.awt.Dimension(100, 146));
|
||||
|
||||
jList2.setModel(new javax.swing.AbstractListModel() {
|
||||
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
|
||||
public int getSize() { return strings.length; }
|
||||
public Object getElementAt(int i) { return strings[i]; }
|
||||
});
|
||||
jList2.setMaximumSize(new java.awt.Dimension(0, 0));
|
||||
jList2.setMinimumSize(new java.awt.Dimension(0, 0));
|
||||
jScrollPane2.setViewportView(jList2);
|
||||
|
||||
jPanel1.add(jScrollPane2);
|
||||
|
||||
jScrollPane5.setMinimumSize(new java.awt.Dimension(300, 300));
|
||||
|
||||
jTable1.setFont(new java.awt.Font("Tahoma", 0, 15)); // NOI18N
|
||||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
|
||||
},
|
||||
new String [] {
|
||||
"Select", "Start", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Description",
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
|
||||
};
|
||||
boolean[] canEdit = new boolean [] {
|
||||
true, true, false, false, false, false, false, false
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
return types [columnIndex];
|
||||
}
|
||||
|
||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||
return canEdit [columnIndex];
|
||||
}
|
||||
});
|
||||
jTable1.setColumnSelectionAllowed(true);
|
||||
jTable1.setDragEnabled(true);
|
||||
jTable1.setDropMode(javax.swing.DropMode.INSERT);
|
||||
jTable1.setRowHeight(22);
|
||||
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
jTable1MouseClicked(evt);
|
||||
}
|
||||
});
|
||||
jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyReleased(java.awt.event.KeyEvent evt) {
|
||||
jTable1KeyReleased(evt);
|
||||
}
|
||||
});
|
||||
jScrollPane5.setViewportView(jTable1);
|
||||
jTable1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
|
||||
jPanel1.add(jScrollPane5);
|
||||
|
||||
add(jPanel1, java.awt.BorderLayout.CENTER);
|
||||
|
||||
jPanel2.setPreferredSize(new java.awt.Dimension(263, 50));
|
||||
|
||||
cmDefault.setText("Save as Default");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
this.cmDefault.setVisible(false);
|
||||
cmDefault.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmDefaultActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
cmCancel.setText("Cancel");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
cmCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmCancelActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
cmOk.setText("Ok");
|
||||
this.cmCancel.setVisible(false);
|
||||
this.cmOk.setVisible(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(cmDefault, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 223, Short.MAX_VALUE)
|
||||
.addComponent(cmOk, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(32, 32, 32)
|
||||
.addComponent(cmCancel))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cmCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cmOk, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cmDefault, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(25, 25, 25))
|
||||
);
|
||||
|
||||
add(jPanel2, java.awt.BorderLayout.SOUTH);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void fillComponents(TableModel hDetails) {
|
||||
jTable1.setModel(hDetails);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load test list from file
|
||||
*
|
||||
* @param file file containing the settings
|
||||
*/
|
||||
private void loadSettings(String sFileName) {
|
||||
final JFileChooser fc = new JFileChooser();
|
||||
File file = new File(sFileName);
|
||||
if (file.isFile()){
|
||||
DefaultTableModel tableModel = (DefaultTableModel) jTable1.getModel();
|
||||
try {
|
||||
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
|
||||
Vector rowData = (Vector) in.readObject();
|
||||
Iterator itr = rowData.iterator();
|
||||
//clear table
|
||||
tableModel.getDataVector().removeAllElements();
|
||||
tableModel.fireTableDataChanged();
|
||||
//rewrite table
|
||||
while (itr.hasNext()) {
|
||||
tableModel.addRow((Vector) itr.next());
|
||||
}
|
||||
in.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
SwingUtils.showMessage(this, "loadSettings()", ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* scan tests directory, scan devices directory, search for their test cases
|
||||
* and scan for tests.
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* @throws IOException
|
||||
*/
|
||||
public void loadTests() {
|
||||
try {
|
||||
Properties propDevice = new Properties();
|
||||
Properties propTest = new Properties();
|
||||
//String fileName = TESTS_DEVICES_DEFAULT_DIR;
|
||||
//File folder = new File(fileName);
|
||||
TestingList testingList = new TestingList();
|
||||
|
||||
File testsFolder = null;
|
||||
String sTestName;
|
||||
int iCounter = 0;
|
||||
//search devices and their tests
|
||||
//Scan the list of devices
|
||||
File[] listOfFiles = (testingList.TESTS_DEVICES_DEFAULT_DIR.toFile()).listFiles();
|
||||
for (File listOfFile : listOfFiles) {
|
||||
propDevice.clear();
|
||||
if (listOfFile.isFile()) {
|
||||
} else if (listOfFile.isDirectory()) {
|
||||
File configFile = new File(listOfFile.getPath() + FilenameUtils.separatorsToSystem("/.config"));
|
||||
if (configFile.exists() && !configFile.isDirectory()) {
|
||||
InputStream is = null;
|
||||
try {
|
||||
is = new FileInputStream(configFile);
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(EditTestingList.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
if(is != null){
|
||||
try {
|
||||
propDevice.load(is);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(EditTestingList.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
//config of device was loaded. now load the config of each test belonging to the device
|
||||
//sTestName = TESTS_TESTS_DEFAULT_DIR + propDevice.getProperty("tests");
|
||||
//testsFolder = new File(sTestName);
|
||||
testsFolder = Paths.get(testingList.TESTS_TESTS_DEFAULT_DIR.toString(), propDevice.getProperty("tests")).toFile();
|
||||
if (testsFolder.exists() && testsFolder.isDirectory()) {
|
||||
File[] listOfTests = testsFolder.listFiles();
|
||||
for (File listOfTest : listOfTests) {
|
||||
propTest.clear();
|
||||
if (listOfTest.isDirectory()) {
|
||||
configFile = new File(listOfTest.getPath() + FilenameUtils.separatorsToSystem("/.config"));
|
||||
if (configFile.exists() && !configFile.isDirectory()) {
|
||||
InputStream ist = null;
|
||||
try {
|
||||
ist = new FileInputStream(configFile);
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(EditTestingList.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
try {
|
||||
propTest.load(ist);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(EditTestingList.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
addToTable("",
|
||||
propDevice.getProperty("name"),
|
||||
propDevice.getProperty("description"),
|
||||
propDevice.getProperty("tests"),
|
||||
"path",
|
||||
propTest.getProperty("name"),
|
||||
propTest.getProperty("parameters"));
|
||||
iCounter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
SwingUtils.showMessage(this, "loadTests()", "Could not find any test");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(EditTestingList.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
|
||||
if (this.jTable1.isEnabled()) {
|
||||
try {
|
||||
switch (evt.getClickCount()) {
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jTable1MouseClicked
|
||||
|
||||
private void jTable1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable1KeyReleased
|
||||
|
||||
}//GEN-LAST:event_jTable1KeyReleased
|
||||
|
||||
private void cmCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmCancelActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cmCancelActionPerformed
|
||||
|
||||
private void cmDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmDefaultActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cmDefaultActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton cmCancel;
|
||||
private javax.swing.JButton cmDefault;
|
||||
private javax.swing.JButton cmOk;
|
||||
private javax.swing.JList jList2;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JScrollPane jScrollPane5;
|
||||
private javax.swing.JTable jTable1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private void addToTable(String property, String property0, String property1, String property2, String property3, String property4, String property5) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
}
|
||||
+27
-17
@@ -73,22 +73,7 @@ public class TestingList extends Panel {
|
||||
};
|
||||
|
||||
public TestingList() throws Exception {
|
||||
initComponents();
|
||||
initLogger();
|
||||
buildTable();
|
||||
try {
|
||||
loadTests();
|
||||
//if not administrator, then show only enabled tests
|
||||
boolean bShow = Controller.getInstance().getLevel()==AccessLevel.administrator;
|
||||
showSelectedTestsOnly(bShow);
|
||||
jCheckBoxMenuShowSelectedTests1.setState(bShow);
|
||||
if(bShow){
|
||||
//if tests are not shown, then show the load tests dialog
|
||||
loadSettings();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
getLogger().severe(ex.getMessage());
|
||||
}
|
||||
initialise();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,6 +287,27 @@ public class TestingList extends Panel {
|
||||
public static String TESTS_CONFIG_FILENAME = ".config";
|
||||
public static String TESTS_HELP_FILENAME = "help.html";
|
||||
|
||||
/**
|
||||
* initialise panel
|
||||
*/
|
||||
private void initialise(){
|
||||
initComponents();
|
||||
initLogger();
|
||||
buildTable();
|
||||
try {
|
||||
loadTests();
|
||||
//if not administrator, then show only enabled tests
|
||||
boolean bShow = Controller.getInstance().getLevel()==AccessLevel.administrator;
|
||||
showSelectedTestsOnly(bShow);
|
||||
jCheckBoxMenuShowSelectedTests1.setState(bShow);
|
||||
if(bShow){
|
||||
//if tests are not shown, then show the load tests dialog
|
||||
loadSettings();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
getLogger().severe(ex.getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* write info into a log file
|
||||
* @param text the info to be logged
|
||||
@@ -1425,6 +1431,8 @@ public class TestingList extends Panel {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!isTestRunAllowed())
|
||||
return;
|
||||
if (selectedTestsRows.length > 0) { //at least one test is selected: launch it (or them)
|
||||
System.out.println("\n===================================================\n");
|
||||
executeParallelTestsGroup(selectedTestsRows); //last execution did not find a test file. Continue with next execution
|
||||
@@ -1516,7 +1524,7 @@ public class TestingList extends Panel {
|
||||
RunTest runTest;
|
||||
String sTestName = "", sDeviceName = "", sTestPath = "";
|
||||
for (int row : rowsToExecute) {
|
||||
//System.out.println(String.valueOf(row) + "\t" + sDeviceName + "\t" + sTestName + "\t" + sTestCaseName + "\t" + String.valueOf(rowsToExecute.length));
|
||||
//System.out.println(String.valueOf(row) + "\t" + sDeviceName + "\t" + sTestName + "\t" + sTestCaseName + "\t" + String.valueOf(rowsToExecute.length));
|
||||
try {
|
||||
testArgs = buildMapFromTableRow(row);
|
||||
sTestName = (String) testArgs.get(testArgNames.TEST.toString());
|
||||
@@ -1579,6 +1587,8 @@ public class TestingList extends Panel {
|
||||
}
|
||||
}
|
||||
//System.out.println(sParallelizeCommand);
|
||||
if(!isTestRunAllowed())
|
||||
return iRet;
|
||||
Object ret = eval(sParallelizeCommand);
|
||||
//System.out.println(ret);
|
||||
String sTestResult, sTestStatus;
|
||||
|
||||
Reference in New Issue
Block a user