package caltool.view.schedule;

import caltool.model.schedule.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

/**** 
 *
 *
 */

public class EditCategoriesSelectionListener implements ActionListener {

    /**
     * Construct this with the given Schedule model and parent dialog view.
     * Access to the model is for calling its ScheduleAppointment method.
     * Access to the parent view is for gathering date to be sent to Schedule.
     * ScheduleAppointment.
     */
    public EditCategoriesSelectionListener(/*Schedule schedule,
            ScheduleAppointmentDialog dialog*/ JComboBox comboBox) {
        /*this.schedule = schedule;
        this.dialog = dialog;*/
        this.comboBox = comboBox;
    }

    /**
     */
    public void actionPerformed(ActionEvent e) {
        String selection = (String) comboBox.getSelectedItem();
        if (selection.equals("Edit ...")) {
            comboBox.setSelectedIndex(0);
        }
    }

    /** The parent combo box on which the event is performed. */
    JComboBox comboBox;
}