package org.gcube.portlets.user.geoportaldataviewer.client; import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.TabLayoutPanel; /** * Entry point classes define onModuleLoad(). */ public class GeoportalDataViewer implements EntryPoint { /** * The message displayed to the user when the server cannot be reached or * returns an error. */ private static final String SERVER_ERROR = "An error occurred while " + "attempting to contact the server. Please check your network " + "connection and try again."; /** * Create a remote service proxy to talk to the server-side Greeting service. */ private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class); private final Messages messages = GWT.create(Messages.class); public final static String APP_DIV = "geoportal-data-viewer"; private boolean initialized = false; /** * This is the entry point method. */ public void onModuleLoad() { // HTMLPanel htmlPanel = new HTMLPanel(""); // htmlPanel.setWidth("500px"); // htmlPanel.setHeight("500px"); // htmlPanel.getElement().setId("map"); // GeonaDataViewMainPanel mainPanel = new GeonaDataViewMainPanel(); RootPanel.get(APP_DIV).add(mainPanel); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { new OsmExample(mainPanel.getMapPanel().getElement().getId()); //new OsmExample(htmlPanel.getElement().getId()); } }); // SimplePanel sp = new SimplePanel() { // // @Override // public void setVisible(boolean visible) { // if (visible && !initialized) { // Scheduler.get().scheduleDeferred(() -> example.getExample().show(example.getExample().toString())); // initialized = true; // } // super.setVisible(visible); // // if (visible) { // History.newItem(example.name()); // } // } // }; } }