title: GWT Activity : How to use an activity, place, eventbus and uibinder
body: <p>I'm new at GWT and I wonder myself how to use an Activity, Place ,EventBus and UIbinder.
  The layout of my app is smth like this :</p>
  
  <p>Widget 1:</p>
  
  <pre><code>&lt;g:DockLayoutPanel ui:field="myPanel" unit='PX'&gt;
      &lt;g:north size='60'&gt;
          &lt;m:HeaderPanelImpl styleName='{res.style.panelBorder}' ui:field='headerPanel' /&gt;
      &lt;/g:north&gt;
      &lt;g:south size='60'&gt;
          &lt;g:HTMLPanel styleName='{res.style.panelBorder}' ui:field='footerPanel' /&gt;
      &lt;/g:south&gt;
      &lt;g:center&gt;
          &lt;g:SimpleLayoutPanel styleName='{res.style.panelBorder}' ui:field='centerPanel' /&gt;
      &lt;/g:center&gt;
  &lt;/g:DockLayoutPanel&gt;
  </code></pre>
  
  <p>Here in "widget1.headerPanel" a have navigation which controls which widget to be shown in “widget1.centerPanel”.
  The widgets which have to be shown in  “widget1.centerPanel” are “widget2.0” and ”widget2.1”.</p>
  
  <p>Widget2.0</p>
  
  <pre><code>&lt;g:DockLayoutPanel unit='PX'&gt;
      &lt;g:north size='100'&gt;
          &lt;g:HTMLPanel styleName='{res.style.panelBorder}'&gt;
              &lt;g:Label&gt;TopPanel&lt;/g:Label&gt;
          &lt;/g:HTMLPanel&gt;
      &lt;/g:north&gt;
      &lt;g:west size='200'&gt;
          &lt;g:HTMLPanel styleName='{res.style.panelBorder}'&gt;
              &lt;g:Label&gt;LeftPanel&lt;/g:Label&gt;
          &lt;/g:HTMLPanel&gt;
      &lt;/g:west&gt;
      &lt;g:east size='200'&gt;
          &lt;g:HTMLPanel styleName='{res.style.panelBorder}'&gt;
              &lt;g:Label&gt;RightPanel&lt;/g:Label&gt;
          &lt;/g:HTMLPanel&gt;
      &lt;/g:east&gt;
      &lt;g:center&gt;
          &lt;g:SimpleLayoutPanel styleName='{res.style.panelBorder}' ui:field='centerPanel' /&gt;
      &lt;/g:center&gt;
  &lt;/g:DockLayoutPanel&gt;
  </code></pre>
  
  <p>Widget2.1</p>
  
  <pre><code>&lt;g:HTMLPanel&gt;
      &lt;g:Label&gt;Settings&lt;/g:Label&gt;
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>In ”widget2.0.topPanel” I have navigation which controls which widget will be shown  in “widget2.0.centerPanel”
  The widgets which have to be shown in  “widget2.centerPanel” are “widget3.0” and ”widget3.1”.</p>
  
  <p>Widget3.0</p>
  
  <pre><code>&lt;g:HTMLPanel&gt;
      &lt;g:Label&gt;Content 1&lt;/g:Label&gt;
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>Widget3.1</p>
  
  <pre><code>&lt;g:HTMLPanel&gt;
      &lt;g:Label&gt;Content 2&lt;/g:Label&gt;
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>My question is how to handle "onPlaceChangeEvent" ?</p>
  
  <p>In example if url is mydomain.com/myapp.html#home:content1<br>
  the app has to show widget 1, widget 2.0 and widget 3.0 </p>
  
  <p>If the url is mydomain.com/myapp.html#home:content2<br>
  the app has to show widget1,  widget 2.0 and widget 3.1 </p>
  
  <p>If the url is mydomain.com/myapp.html#settings<br>
  the app has to show widget1 and  widget 2.1 </p>
  
  <p>I'm wondering between two variants :</p>
  
  <ol>
  <li>To create to 2 ActivityManagers. One for the activities from widget1.navigation and one for the activites from  widget2.navigation.  But what happens if widget2 is created before widget 1 ?</li>
  <li>To create one Activity which creates couple views.</li>
  </ol>
  
  <p>Code:example</p>
  
  <pre><code>public class MonthlyViewActivity extends AbstractActivity implements MonthlyView.Presenter {
  
      private Widget2_0 widget2_0;
      private Widget3_0 widget3_0;
  
      ......
      public void start(AcceptsOneWidget panel, EventBus eventBus) {
          widget2_0 = new Widget2_0();
          widget3_0 = new Widget3_0();
      ..........
      }
      .... 
  }
  </code></pre>
  
  <p>What is the best practice for this case ? </p>