package gradertool.view;

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

/****
 *
 * Class WindowMenu is the "Windows" pulldown menu in the GraderToolUI prototype.
 *
 */
public class WindowMenu extends JMenu {

    /**
     * Constructor for WindowMenu
     */
    public WindowMenu() {

        super("Window");

        /*
         * Add this item to the menu, with separators in the
         * appropriate places (per the requirements).
         */
        addWindowsItem();
    }

    /**
     * Add the '<List of open windows>' menu item.
     */
    protected void addWindowsItem() {

        /*
         * Use the standard menu item pattern for the item.
         */
        add(new JMenuItem("<List of open windows")).addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    /*
                     * Print a message
                     */
                    System.out.println("Window-><List of open windows> selected.");
                }
            }
        );
    }
}