/*
 * Created on Jul 21, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package zemplen;

import java.util.List;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ListDialog;

import zemplen.model.Verseny;

/**
 * @author espakm
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class VersenyValasztoDialog extends ListDialog {
    
    public VersenyValasztoDialog(Shell arg0) {
        super(arg0);
        
        setMessage("Válassza ki a kívánt versenyt:");
        
        setContentProvider(new IStructuredContentProvider() {
            public Object[] getElements(Object inputElement) {
                return ((List) inputElement).toArray();
            }
            public void dispose() {}
            public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
        });
        setLabelProvider(new LabelProvider() {
            public String getText(Object arg0) {
                return ((Verseny) arg0).getElnevezes();
            }
        });
    }
}
