/*
 * Copyright
 *   2007 axYus - www.axyus.com
 *
 * This file is part of XEMELIOS.
 *
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * XEMELIOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package fr.gouv.finances.dgfip.xemelios.web.gwt.client.widget.search;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author CBO
 */
public class OpenSearchDialogBox extends DialogBox {

    private VerticalPanel mainPanel;

    public OpenSearchDialogBox() {
        super(false, true);
        setText("Ouverture d'une recherche");
        mainPanel = new VerticalPanel();
        ScrollPanel scrollPanel = new ScrollPanel();
        scrollPanel.setSize("200", "140");
        VerticalPanel verticalPanel = new VerticalPanel();
        for (int i=0; i<20; i++) {
            Hyperlink hyperlink = new Hyperlink();
            hyperlink.setText("Recherche " + i);
            hyperlink.addClickListener(new ClickListener() {

                public void onClick(Widget sender) {
                    
                }
            });
            verticalPanel.add(hyperlink);
        }
        scrollPanel.add(verticalPanel);
        mainPanel.add(scrollPanel);
        // Les boutons Valider et Annuler :
        HorizontalPanel horizontalPanel = new HorizontalPanel();
        Button validateButton = new Button();
        validateButton.setText("Valider");
        horizontalPanel.add(validateButton);
        Button cancelButton = new Button();
        cancelButton.setText("Annuler");
        horizontalPanel.add(cancelButton);
        mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        mainPanel.add(horizontalPanel);
        setWidget(mainPanel);
    }

}
