litesoft
@ 512
litesoft / trunk / GWT_Sandbox / MultiModule / main / src / org / litesoft / sandbox / multimodule / main / client / Main.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
package org.litesoft.sandbox.multimodule.main.client; import org.litesoft.sandbox.multimodule.common.client.infrastructure.*; import com.google.gwt.activity.shared.*; import com.google.gwt.core.client.*; import com.google.gwt.event.shared.*; import com.google.gwt.place.shared.*; import com.google.gwt.user.client.ui.*; /** * Entry point classes define <code>onModuleLoad()</code> */ public class Main implements EntryPoint { @Override public void onModuleLoad() { System.out.println( "Main.onModuleLoad" ); SimplePanel zAppWidget = new SimplePanel(); RootPanel.get( "CenteredContent" ).add( zAppWidget ); // zCenteredContent.add( new CubeFace( null, "FrontGroup", Places.Front, Places.Top, Places.Right, Places.Left, Places.Bottom ) ); ClientFactory clientFactory = new ClientFactoryImpl(); // GWT.create( ClientFactory.class ); // todo: need to have our Application Window support MessageUserSink and set it into the clientFactory EventBus eventBus = clientFactory.getEventBus(); PlaceController placeController = clientFactory.getPlaceController(); // Start ActivityManager for the main widget with our ActivityMapper ActivityMapper activityMapper = new ActivityFactoryRegistry( clientFactory ); ActivityManager activityManager = new ActivityManager( activityMapper, eventBus ); activityManager.setDisplay( zAppWidget ); // Start PlaceHistoryHandler with our PlaceHistoryMapper PlaceHistoryHandler historyHandler = new PlaceHistoryHandler( new PlaceRegistry( clientFactory ) ); historyHandler.register( placeController, eventBus, PlaceRegistry.getDefaultPlace() ); RootPanel.get().add( zAppWidget ); // Goes to the place represented on URL else default place historyHandler.handleCurrentHistory(); } } |