package com.limegroup.gnutella.gui.init;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import com.limegroup.gnutella.gui.GUIMediator;
/**
* This class displays a button in the setup window for going
* back to the previous window. it also handles responding to
* mouse clicks and forwarding the appropriate message.
*/
final class BackButton extends JButton implements ActionListener {
/**
* Reference to the manager to forward events to.
*/
private SetupManager _setupManager;
/**
* The constructor set the reference to the setup mediator
* class and adds the action listener.
*
* @param setupManager the setup mediator class
*/
BackButton(SetupManager setupManager) {
super(GUIMediator.getStringResource("GENERAL_BACK_BUTTON_LABEL"));
addActionListener(this);
_setupManager = setupManager;
}
/**
* Implements the <tt>ActionListener</tt> interface.
*
* Notifies the setup manager that it should take
* the appropriate action.
*/
public void actionPerformed(ActionEvent e) {
_setupManager.previous();
}
}