package szakdolgozat.client.ui;

import szakdolgozat.client.UI;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class WaitingDialog extends DialogBox {

	public static Label lblAnswer;

	public WaitingDialog() {
		setGlassEnabled(true);
		setAnimationEnabled(true);

		VerticalPanel verticalPanel = new VerticalPanel();
		verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		verticalPanel
				.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		setWidget(verticalPanel);
		verticalPanel.setSize("100%", "100%");

		Label lblVrakozsAzEllenfl = new Label(
				"Várakozás az ellenfél válaszára...");
		verticalPanel.add(lblVrakozsAzEllenfl);
		verticalPanel.setCellHorizontalAlignment(lblVrakozsAzEllenfl,
				HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel.setCellVerticalAlignment(lblVrakozsAzEllenfl,
				HasVerticalAlignment.ALIGN_MIDDLE);
		lblVrakozsAzEllenfl.setSize("100%", "100%");

		lblAnswer = new Label("");
		verticalPanel.add(lblAnswer);
		verticalPanel.setCellHorizontalAlignment(lblAnswer,
				HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel.setCellVerticalAlignment(lblAnswer,
				HasVerticalAlignment.ALIGN_MIDDLE);
		lblAnswer.setSize("100%", "100%");

		Button closeButton = new Button("Bezárás");
		verticalPanel.add(closeButton);
		closeButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				hide();
				UI.userListWindow.userListGrid.show();
			}
		});

	}
}
