/* $Id: GUIShowSpreadSelectionListsAction.java 125 2011-03-09 09:49:51Z ohura $ */
package smart_gs.spread_selection;

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

import javax.swing.JButton;
import javax.swing.JTextField;

public class GUIShowSpreadSelectionListsAction implements ActionListener {
	JButton showButton;
	JTextField scopetextfield;
	boolean calledFromSearchScopePanel = false;
	
	public GUIShowSpreadSelectionListsAction (JButton bttn) {
		showButton = bttn;
	}
	
	public GUIShowSpreadSelectionListsAction (JButton bttn, JTextField textfield) {
		showButton = bttn;
		scopetextfield = textfield;
		calledFromSearchScopePanel = true;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		showButton.setEnabled(false);
		if (! calledFromSearchScopePanel)		
			(new SpreadSelectionListsInTable(showButton)).show();
		else
			(new SpreadSelectionListsInTable(showButton,scopetextfield)).show();
	}

}
