Subversion Repository Public Repository

litesoft

Diff Revisions 506 vs 512 for /trunk/GWT_Sandbox/MultiModule/main/src/org/litesoft/sandbox/multimodule/main/client/Main.java

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