package test;

import javax.swing.*;
import java.awt.*;

public class TestSelectorView extends JPanel {
   public TestSelectorView(JFrame main) {
      mainFrame = main;
      main.add(this);

      String[] selectTestTableColumnNames = {
         "Class",
         "Test",
         "# of Questions",
      };
      Object[][] selectTestTableData = {};
      selectTestTable = new JTable(selectTestTableData, selectTestTableColumnNames);
      JScrollPane selectTestTableScrollPane = new JScrollPane(selectTestTable);
      this.add(selectTestTableScrollPane);
      this.add(createButton);
      this.add(openButton);
      this.add(deleteButton);
   }

   private JFrame mainFrame;
   private JTable selectTestTable;

   /**
    * Generates a new, untitled test, and the user is taken to the basic test
    * creation wizard.
    */
   private JButton createButton = new JButton("Create");

   /**
    * Takes the user to the test customization for the currently highlighted
    * test.
    */
   private JButton openButton = new JButton("Open");

   /**
    * Causes a yes/no confirmation popup appears. If the user selects 'yes',
    * the test is deleted from the test bank.
    */
   private JButton deleteButton = new JButton("Delete");
}