import java.awt.*;
import java.awt.event.*;

class CardSearch extends Panel implements ActionListener {
	private CompanyPresentation parent;
	private CheckboxGroup type	= new CheckboxGroup();
	private Checkbox byName = new Checkbox("By Name", type, true);
	private Checkbox byNumber = new Checkbox("By Number", type, false);
	private Button search = new Button("Search");

	CardSearch(CompanyPresentation parent) {
		this.parent = parent;

		setLayout(new FlowLayout());
		add(byNumber);
		add(byName);
		add(search);
		search.addActionListener(this);
	}

	public void actionPerformed(ActionEvent evt) {
		Checkbox cb = type.getSelectedCheckbox();

		if (cb == byName)
			parent.findCardByName();
		else if (cb == byNumber)
			parent.findCardByNumber();
	}
}
