/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.icentricApp.client;

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

/**
 * Main entry point.
 *
 * @author jeni
 */
public class MainEntryPoint implements EntryPoint {
    /**
     * Creates a new instance of MainEntryPoint
     */
    public MainEntryPoint() {
    }

    /**
     * The entry point method, called automatically by loading a module that
     * declares an implementing class as an entry-point
     */
    public void onModuleLoad() {

        Button button = new Button("Open Window");
        button.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                final Window window = new Window();
                window.setWidth("90%");
                window.setHeight("90%");
                window.centerInPage();
                window.setTitle("Create Test");
                TestPanel testPanel = new TestPanel();
                window.addItem(testPanel);
                window.show();
            }
        });
        
        RootPanel.get().add(button);
    }
}
