package net.sourceforge.javydreamercsw.client.ui.nodes.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;

/**
 *
 * @author Javier A. Ortiz Bultron <javier.ortiz.78@gmail.com>
 */
public class CreateTestAction extends AbstractAction {

    public CreateTestAction() {
        super("Create Test",
                new ImageIcon("com/validation/manager/resources/icons/Signage/Add Square.png"));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                final CreateTestDialog dialog =
                        new CreateTestDialog(new javax.swing.JFrame(), true);
                dialog.setLocationRelativeTo(null);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        dialog.dispose();
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
}

@@ -58,16 +58,64 @@
 tions;%0A%0A
+import com.validation.manager.core.db.TestPlan;%0A
 import j
@@ -205,16 +205,51 @@
 ageIcon;
+%0Aimport org.openide.util.Utilities;
 %0A%0A/**%0A *
@@ -877,24 +877,117 @@
 e(), true);%0A
+                dialog.setTestPlan(Utilities.actionsGlobalContext().lookup(TestPlan.class));%0A
             

Fix NPE while creating tests.