package addBk.addressBook;

//EditNavPanel

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class EditNavPanel
    extends NavigationPanel
    implements ActionListener {

  PreviousButton prevButton
      = new PreviousButton();

  Button nextButton
      = new NextButton();

  Button indexButton
      = new IndexButton();

  Button doneButton
      = new DoneButton();

  public void
      actionPerformed(ActionEvent e) {
    ((Runnable)
        e.getSource()).run();
  }


  EditNavPanel() {
    setLayout(
        new GridLayout(0, 1));
    add(prevButton);
    add(nextButton);
    add(indexButton);
    add(doneButton);
    prevButton.addActionListener(this);
    nextButton.addActionListener(this);
    indexButton.addActionListener(this);
    editButton.addActionListener(this);
  }

  public class DoneButton extends Button
      implements Runnable {
    DoneButton() {
      super("Done");
    }

    public void run() {
      System.out.println("Run edit");
      AddressDisplay display =
          new AddressDisplay();
      display.toggleEditPanel();
    }
  }

} // end class EditNavPanel