New feature: show custom panel (if its class is enabled as plugin)

Working on Kollimators.java custom panel
This commit is contained in:
boccioli_m
2015-10-08 16:36:24 +02:00
parent c604bc6533
commit a6f36fc60e
6 changed files with 267 additions and 104 deletions

View File

@@ -17,7 +17,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
@@ -66,14 +66,14 @@
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="32" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jButton1" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
@@ -100,7 +100,7 @@
</Group>
</Group>
</Group>
<EmptySpace pref="16" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>

View File

@@ -88,7 +88,7 @@ public class Kollimators extends javax.swing.JPanel {
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7)
@@ -128,12 +128,12 @@ public class Kollimators extends javax.swing.JPanel {
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addContainerGap(32, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGap(0, 0, 0)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
@@ -156,7 +156,7 @@ public class Kollimators extends javax.swing.JPanel {
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(16, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents

View File

@@ -48,6 +48,14 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemNewDeviceActionPerformed"/>
</Events>
</MenuItem>
<Menu class="javax.swing.JMenu" name="jMenuLoadCustomPanel">
<Properties>
<Property name="text" type="java.lang.String" value="Load Custom Panel"/>
</Properties>
<Events>
<EventHandler event="menuSelected" listener="javax.swing.event.MenuListener" parameters="javax.swing.event.MenuEvent" handler="jMenuLoadCustomPanelMenuSelected"/>
</Events>
</Menu>
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator2">
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemEditScript">
@@ -180,43 +188,6 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</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.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="jTable1">
<Properties>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<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" postCode="jTable1.getTableHeader().setReorderingAllowed(false);">
<Connection code="new javax.swing.table.DefaultTableModel(&#xa; new Object [][] {&#xa;&#xa; },&#xa; new String [] {&#xa; &quot;Enable&quot;, &quot;Start&quot;, &quot;Time&quot;, &quot;Device Name&quot;, &quot;Device Description&quot;, &quot;Test Suite&quot;, &quot;Test Name&quot;, &quot;Test Peth&quot;, &quot;Test Parameters&quot;, &quot;Test Description&quot;, &quot;Test Help&quot;, &quot;Last Test Result&quot;, &quot;Status&quot;, &quot;&quot;&#xa; }&#xa;) {&#xa; Class[] types = new Class [] {&#xa; 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, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class&#xa; };&#xa; boolean[] canEdit = new boolean [] {&#xa; true, true, false, false, false, false, false, false, false, false, false, false, false, false&#xa; };&#xa;&#xa; public Class getColumnClass(int columnIndex) {&#xa; return types [columnIndex];&#xa; }&#xa;&#xa; public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa; return canEdit [columnIndex];&#xa; }&#xa;}" type="code"/>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>
</Property>
<Property name="dragEnabled" type="boolean" value="true"/>
<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>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -444,14 +415,99 @@
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanelCustom">
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Last"/>
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="jTable1">
<Properties>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<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" postCode="jTable1.getTableHeader().setReorderingAllowed(false);">
<Connection code="new javax.swing.table.DefaultTableModel(&#xa; new Object [][] {&#xa;&#xa; },&#xa; new String [] {&#xa; &quot;Enable&quot;, &quot;Start&quot;, &quot;Time&quot;, &quot;Device Name&quot;, &quot;Device Description&quot;, &quot;Test Suite&quot;, &quot;Test Name&quot;, &quot;Test Peth&quot;, &quot;Test Parameters&quot;, &quot;Test Description&quot;, &quot;Test Help&quot;, &quot;Last Test Result&quot;, &quot;Status&quot;, &quot;&quot;&#xa; }&#xa;) {&#xa; Class[] types = new Class [] {&#xa; 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, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class&#xa; };&#xa; boolean[] canEdit = new boolean [] {&#xa; true, true, false, false, false, false, false, false, false, false, false, false, false, false&#xa; };&#xa;&#xa; public Class getColumnClass(int columnIndex) {&#xa; return types [columnIndex];&#xa; }&#xa;&#xa; public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa; return canEdit [columnIndex];&#xa; }&#xa;}" type="code"/>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>
</Property>
<Property name="dragEnabled" type="boolean" value="true"/>
<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>
<Container class="javax.swing.JPanel" name="jPanelCustom">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 100]"/>
</Property>
</Properties>
<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">
<Component id="jPanelCustomFrame" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="382" max="32767" attributes="0"/>
<Component id="jButtonX" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jButtonX" pref="17" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jPanelCustomFrame" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="253" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanelCustomFrame">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
<Component class="javax.swing.JButton" name="jButtonX">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="8" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/x-8px.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Close this custom panel"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[8, 8]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonXActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@@ -295,9 +295,9 @@ public class TestingList extends Panel {
*/
private void initialise(){
initComponents();
addCustomPanel();
initLogger();
buildTable();
closeCustomPanel();
try {
loadTests();
//if not administrator, then show only enabled tests
@@ -313,32 +313,69 @@ public class TestingList extends Panel {
}
}
/**
* add custom panel if specified
* close the custom panel if present
*/
private void closeCustomPanel(){
jPanelCustomFrame.removeAll();
jPanelCustom.setVisible(false);
repaint();
}
/**
* load plugins available excluding the plugins used directly by TestingList
* @return list of plugins assumed to be custom panels
*/
private void addCustomPanel(){
private List<String> getCustomPanels(){
Path pluginsPath = Paths.get(".", "home", "config", "plugins.properties");
List<String> stringBuffer =new ArrayList<String>() ;
try {
File file = new File(pluginsPath.toString());
FileReader fileReader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(fileReader);
StringBuffer stringBuffer = new StringBuffer();
String line;
String line, fileName;
while ((line = bufferedReader.readLine()) != null) {
stringBuffer.append(line);
stringBuffer.append("\n");
if(line.contains("=enabled")){
fileName = line.replace(".java=enabled", "");
fileName = (Paths.get(fileName)).getFileName().toString();
if( !(fileName.contains("TestingListDetails") ||
fileName.contains("TestingList") ||
fileName.contains("NewTest"))){
stringBuffer.add(fileName);
}
}
}
fileReader.close();
System.out.println("Contents of file:");
System.out.println(stringBuffer.toString());
//System.out.println("Contents of file:");
//System.out.println(stringBuffer.toString());
} catch (IOException e) {
e.printStackTrace();
}
return stringBuffer;
}
/**
* add custom panel if specified.
* Custom panels are java classes. To add a new custom panel MyNewPanel:
* - create a panel and save it as MyNewPanel.java
* - add MyNewPanel.java file in the pshell plugins folder
* - on pshell, open Plugins and enable MyNewPanel.java
* - restart pshell
* To show the new panel, open the enu Advanced/Load Custom Panel
*
*/
private void loadCustomPanel(String sPanelClassName){
try {
closeCustomPanel();
//create a class to visualise the details panel
Class panelClass = getController().getClassByName("Kollimators");
Class panelClass = getController().getClassByName(sPanelClassName);
JPanel detailsPanel = (JPanel) panelClass.getConstructor(new Class[]{String.class}).newInstance(new Object[]{""});
this.jPanelCustom.add(detailsPanel);
this.jPanelCustomFrame.add(detailsPanel);
repaint();
revalidate();
jPanelCustom.setVisible(true);
} catch (ClassNotFoundException ex) {
Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex);
} catch (NoSuchMethodException ex) {
@@ -413,6 +450,7 @@ public class TestingList extends Panel {
jMenuAdvanced = new javax.swing.JMenu();
jMenuItemNewTest = new javax.swing.JMenuItem();
jMenuItemNewDevice = new javax.swing.JMenuItem();
jMenuLoadCustomPanel = new javax.swing.JMenu();
jSeparator2 = new javax.swing.JPopupMenu.Separator();
jMenuItemEditScript = new javax.swing.JMenuItem();
jMenuItemOpenLog = new javax.swing.JMenuItem();
@@ -430,8 +468,6 @@ public class TestingList extends Panel {
jSeparator4 = new javax.swing.JPopupMenu.Separator();
jCheckBoxMenuShowSelectedTests1 = new javax.swing.JCheckBoxMenuItem();
jMenuItemReload1 = new javax.swing.JMenuItem();
jScrollPane2 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanel1 = new javax.swing.JPanel();
jPanelTopCommands = new javax.swing.JPanel();
jPanelButtons = new javax.swing.JPanel();
@@ -443,7 +479,11 @@ public class TestingList extends Panel {
jCheckBoxEnableDisable = new javax.swing.JCheckBox();
jButtonMoveDown = new javax.swing.JButton();
jButtonMoveUp = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanelCustom = new javax.swing.JPanel();
jPanelCustomFrame = new javax.swing.JPanel();
jButtonX = new javax.swing.JButton();
jCheckBoxMenuShowSelectedTests.setSelected(true);
jCheckBoxMenuShowSelectedTests.setText("Show enabled tests only");
@@ -480,6 +520,18 @@ public class TestingList extends Panel {
}
});
jMenuAdvanced.add(jMenuItemNewDevice);
jMenuLoadCustomPanel.setText("Load Custom Panel");
jMenuLoadCustomPanel.addMenuListener(new javax.swing.event.MenuListener() {
public void menuCanceled(javax.swing.event.MenuEvent evt) {
}
public void menuDeselected(javax.swing.event.MenuEvent evt) {
}
public void menuSelected(javax.swing.event.MenuEvent evt) {
jMenuLoadCustomPanelMenuSelected(evt);
}
});
jMenuAdvanced.add(jMenuLoadCustomPanel);
jMenuAdvanced.add(jSeparator2);
jMenuItemEditScript.setText("Edit selected test");
@@ -574,48 +626,6 @@ public class TestingList extends Panel {
setLayout(new java.awt.BorderLayout());
jTable1.setAutoCreateRowSorter(true);
jTable1.setFont(new java.awt.Font("Tahoma", 0, 15)); // NOI18N
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Enable", "Start", "Time", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", ""
}
) {
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, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class
};
boolean[] canEdit = new boolean [] {
true, true, false, false, false, false, false, false, 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.getTableHeader().setReorderingAllowed(false);
jTable1.setDragEnabled(true);
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);
}
});
jScrollPane2.setViewportView(jTable1);
add(jScrollPane2, java.awt.BorderLayout.CENTER);
jPanel1.setMinimumSize(new java.awt.Dimension(100, 200));
jPanel1.setPreferredSize(new java.awt.Dimension(110, 110));
jPanel1.setLayout(new java.awt.BorderLayout());
@@ -717,7 +727,80 @@ public class TestingList extends Panel {
jPanel1.add(jPanelTopCommands, java.awt.BorderLayout.CENTER);
add(jPanel1, java.awt.BorderLayout.NORTH);
add(jPanelCustom, java.awt.BorderLayout.PAGE_END);
jTable1.setAutoCreateRowSorter(true);
jTable1.setFont(new java.awt.Font("Tahoma", 0, 15)); // NOI18N
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Enable", "Start", "Time", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", ""
}
) {
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, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class
};
boolean[] canEdit = new boolean [] {
true, true, false, false, false, false, false, false, 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.getTableHeader().setReorderingAllowed(false);
jTable1.setDragEnabled(true);
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);
}
});
jScrollPane2.setViewportView(jTable1);
add(jScrollPane2, java.awt.BorderLayout.CENTER);
jPanelCustom.setPreferredSize(new java.awt.Dimension(400, 100));
jButtonX.setFont(new java.awt.Font("Tahoma", 0, 8)); // NOI18N
jButtonX.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/x-8px.png"))); // NOI18N
jButtonX.setToolTipText("Close this custom panel");
jButtonX.setPreferredSize(new java.awt.Dimension(8, 8));
jButtonX.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonXActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanelCustomLayout = new javax.swing.GroupLayout(jPanelCustom);
jPanelCustom.setLayout(jPanelCustomLayout);
jPanelCustomLayout.setHorizontalGroup(
jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelCustomFrame, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCustomLayout.createSequentialGroup()
.addGap(0, 382, Short.MAX_VALUE)
.addComponent(jButtonX, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanelCustomLayout.setVerticalGroup(
jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelCustomLayout.createSequentialGroup()
.addComponent(jButtonX, javax.swing.GroupLayout.DEFAULT_SIZE, 17, Short.MAX_VALUE)
.addGap(0, 0, 0)
.addComponent(jPanelCustomFrame, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(253, 253, 253))
);
add(jPanelCustom, java.awt.BorderLayout.SOUTH);
}// </editor-fold>//GEN-END:initComponents
private void jButtonRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRunActionPerformed
@@ -985,6 +1068,27 @@ public class TestingList extends Panel {
jButtonRunActionPerformed( evt);
}//GEN-LAST:event_jMenuItemRunSingleTestActionPerformed
private void jMenuLoadCustomPanelMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_jMenuLoadCustomPanelMenuSelected
// TODO add your handling code here:
List<String> menuList = getCustomPanels();
jMenuLoadCustomPanel.removeAll();
for(int u = 0; u < menuList.size(); u++){
JMenuItem menuItem = new JMenuItem(menuList.get(u));
menuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
loadCustomPanel(((JMenuItem)evt.getSource()).getText());
}
});
jMenuLoadCustomPanel.add(menuItem);
}
}//GEN-LAST:event_jMenuLoadCustomPanelMenuSelected
private void jButtonXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonXActionPerformed
// TODO add your handling code here:
closeCustomPanel();
}//GEN-LAST:event_jButtonXActionPerformed
//<editor-fold defaultstate="collapsed" desc="Witget Variables declaration">
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonMoveDown;
@@ -993,6 +1097,7 @@ public class TestingList extends Panel {
private javax.swing.JButton jButtonOptions;
private javax.swing.JButton jButtonRun;
private javax.swing.JButton jButtonSave;
private javax.swing.JButton jButtonX;
private javax.swing.JCheckBox jCheckBoxEnableDisable;
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuShowSelectedTests;
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuShowSelectedTests1;
@@ -1009,10 +1114,12 @@ public class TestingList extends Panel {
private javax.swing.JMenuItem jMenuItemSelectNone;
private javax.swing.JMenuItem jMenuItemSelectSelection;
private javax.swing.JMenuItem jMenuItemShowDetails;
private javax.swing.JMenu jMenuLoadCustomPanel;
private javax.swing.JMenu jMenuSelect;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanelButtons;
private javax.swing.JPanel jPanelCustom;
private javax.swing.JPanel jPanelCustomFrame;
private javax.swing.JPanel jPanelSelection;
private javax.swing.JPanel jPanelTopCommands;
private javax.swing.JPopupMenu jPopupMenuConfigs;

BIN
plugins/icons/x-8px.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
plugins/icons/x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB