diff --git a/plugins/TestingList.form b/plugins/TestingList.form index 015558b..f0a1550 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -1,6 +1,6 @@ -
+ @@ -11,46 +11,10 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -59,29 +23,76 @@ + + + + + + + + + + - +
+ - + +
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="10" resizable="false"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> </Properties> </Component> </SubComponents> </Container> - <Component class="ch.psi.pshell.swing.DeviceStatePanel" name="deviceStatePanel1"> - </Component> </SubComponents> </Form> diff --git a/plugins/TestingList.java b/plugins/TestingList.java index b949d2c..357e638 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -24,6 +24,7 @@ import java.util.Date; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; @@ -84,8 +85,9 @@ public class TestingList extends Panel { public void showResult(String deviceName, String testName, String res, String success){ - int COL_RESULT = 3; - int COL_SUCCESS = 4; + int COL_RESULT = 4; + int COL_SUCCESS = 5; + int COL_ICON = 6; int rowD=-1, colT=-1; //search for device name in table @@ -112,6 +114,10 @@ public class TestingList extends Panel { if(colT>0 && rowD>0){ jTable1.setValueAt(res, rowD, COL_RESULT); jTable1.setValueAt(success, rowD, COL_SUCCESS); + jTable1.getCellEditor(rowD, COL_SUCCESS); +ImageIcon icon = new ImageIcon("icons/button_reload.png"); +jTable1.setValueAt(icon, rowD, COL_ICON); + } } @@ -121,7 +127,8 @@ public class TestingList extends Panel { jButton1 = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); - deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel(); + + setLayout(new java.awt.BorderLayout()); jButton1.setText("Test PS"); jButton1.addActionListener(new java.awt.event.ActionListener() { @@ -129,49 +136,43 @@ public class TestingList extends Panel { jButton1ActionPerformed(evt); } }); + add(jButton1, java.awt.BorderLayout.CENTER); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { - {null, null, null, null}, - {null, null, null, null}, - {null, null, null, null}, - {null, null, null, null} + {null, null, null, null, null, null}, + {null, null, null, null, null, null}, + {null, null, null, null, null, null}, + {null, null, null, null, null, null} }, new String [] { - "Title 1", "Title 2", "Title 3", "Title 4" + "Select", "Title 1", "Title 3", "Title 4", "Title 5", "Icon" } - )); - jScrollPane2.setViewportView(jTable1); + ) { + 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 + }; + boolean[] canEdit = new boolean [] { + false, true, true, true, true, false + }; - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(244, 244, 244) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(213, 213, 213) - .addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jButton1))) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 783, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(25, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(42, 42, 42) - .addComponent(jButton1) - .addGap(28, 28, 28) - .addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(90, 90, 90) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(18, Short.MAX_VALUE)) - ); + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + jScrollPane2.setViewportView(jTable1); + if (jTable1.getColumnModel().getColumnCount() > 0) { + jTable1.getColumnModel().getColumn(0).setResizable(false); + jTable1.getColumnModel().getColumn(0).setPreferredWidth(1); + jTable1.getColumnModel().getColumn(5).setResizable(false); + jTable1.getColumnModel().getColumn(5).setPreferredWidth(10); + } + + add(jScrollPane2, java.awt.BorderLayout.PAGE_END); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed @@ -194,7 +195,6 @@ public class TestingList extends Panel { }//GEN-LAST:event_jButton1ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables - private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel1; private javax.swing.JButton jButton1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable1;