package aji;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
//import org.eclipse.swt.graphics.Color;
//import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.*;
//import org.eclipse.swt.layout.*;
//import org.eclipse.swt.events.SelectionListener;
//import org.eclipse.swt.events.SelectionEvent;

public class SearchEtcList implements SelectionListener{
	Composite comp;
	Singleton instance = Singleton.getInstance();
	private List list;
	public SearchEtcList(){
		
	}
	public void visiWin(){
		comp.setVisible(false);
	}
	public void trueSearchEtcList(){
		instance.getComp().setVisible(true);
	}
	public void make_SearchNameList(){
		
		comp = new Composite(instance.getShell(), SWT.NONE);
		comp.setSize(800,535);
		String [] str ;
		
		list = new List(comp,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
		
		list.setBounds(10,10,300,300);
		int i;
		for(i=0;i<20;i++){
			list.add("レシピ名"+Integer.toString(i));
		}
		list.select(0);
		

		
		Button b1 = new Button(comp, SWT.PUSH);
		b1.setBounds(350, 300, 100,100);
		b1.setText("レシピ表示");
		b1.addSelectionListener(this);


	}
	public void widgetDefaultSelected(SelectionEvent e){
    }

    public void widgetSelected(SelectionEvent e){
        System.out.print("選択項目を表示：");
        String[] items = list.getSelection();
        for (int i = 0 ; i < items.length ; i++){
            System.out.println(items[i]);
        }
        instance.setComp(comp);
        visiWin();
        new ResultEtc().make_Result();
    }

}