package com.byreddy.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.types.HeaderControls;
import com.smartgwt.client.widgets.Button;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class TestGWT implements EntryPoint {
	public void onModuleLoad() {
		final Button submit = new Button();
		submit.setTitle("Click");
		submit.setContents("Click");
		submit.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(final ClickEvent event) {
				final com.smartgwt.client.widgets.Window popUpWindow = new com.smartgwt.client.widgets.Window();
				popUpWindow.setIsModal(true);
				popUpWindow.setShowModalMask(true);
				popUpWindow.setModalMaskOpacity(30);
				popUpWindow.setHeight("90%");
				popUpWindow.setTitle("Document Viewer");
				popUpWindow.setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
				popUpWindow.setWidth("80%");
				popUpWindow.centerInPage();
				popUpWindow.setKeepInParentRect(true);
				popUpWindow.setCanDragReposition(true);
				popUpWindow.setCanDragResize(true);
				final Label label = new Label("Popup content");
				popUpWindow.addChild(label);
				popUpWindow.show();

			}

		});

		RootPanel.get("nameFieldContainer").add(submit);

	}

}
