package transformation.associationtags.buttonlisteners;

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

import javax.swing.JComboBox;
import javax.swing.JTextField;

public class ClearButtonListener implements ActionListener {

	JComboBox protectedAction;
	JTextField roleUser;
	JComboBox roleRole;
	JComboBox rightAction;
	JComboBox rightRole;
	
	public ClearButtonListener(JComboBox protectedAction, JTextField roleUser, 
			JComboBox roleRole, JComboBox rightAction, JComboBox rightRole) {
		this.protectedAction = protectedAction;
		this.roleUser = roleUser;
		this.roleRole = roleRole;
		this.rightAction = rightAction;
		this.rightRole = rightRole;
	}
	
	/**
	 * Resets the values of the adding form to defaults
	 */
	public void actionPerformed(ActionEvent arg0) {
		this.protectedAction.setSelectedIndex(0);
		this.roleUser.setText("");
		this.roleRole.setSelectedIndex(0);
		this.rightAction.setSelectedIndex(0);
		this.rightRole.setSelectedIndex(0);
	}

	
}
