Re: What is the mecanism that initialize the PlaceManager attribute (inside the Presenter's constructor) ?

40 views
Skip to first unread message

Christian Goudreau

unread,
May 27, 2012, 11:48:37 AM5/27/12
to gwt-pl...@googlegroups.com
 - Who (what mecanism or classses) is responsible to initialize the placeManager (for me, it magically appear in the constructor and I use it after...) ?
Google-Gin is responsible. You should read about Inversion of Control pattern AKA Dependency injection.

  - I have a SidebarWidget (let say such as the left menu in Google Circle) but I did it just with UiBinder (it is not a PresenterWidget and some problems are appearing). I need some links (actually I hesitate between using Hyperlinks or MenuItems) and I do not know how to manually reveal other Presenters without the PlaceManager...So should I inject a PlaceManager in my SidebarWidget (but I do not know if it will be the "same" PlaceManger singleton that will be invoked) ?  
You can use hyperlinks with the name token, GWTP binds it's history on name tokens. Placemanager contains functionally to help you build them, else just writing #name in a <a href> is enough.

  - Some links of the SidebarWidget should also call some popupWidgetPresenters, but I cannot call addToPopupSlot() (because SidebarWidget is not a Presenter) and I understood that popupWidgets are not places so I cannot reveal them using PlaceRequest and PlaceManager. So how could I do ?
Throw an event and catch it by a presenter that can show popupPresenter widget.

Cheers,

On Sat, May 26, 2012 at 1:25 PM, regnoult axel <regn...@gmail.com> wrote:
Hello,

Let's give a little example :

        private final PlaceManager placeManager;
        @Inject
public AppPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy, PlaceManager placeManager) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
}

I do not understand :
 - Who (what mecanism or classses) is responsible to initialize the placeManager (for me, it magically appear in the constructor and I use it after...) ?
 
I have 2 others problems :

 - I have a SidebarWidget (let say such as the left menu in Google Circle) but I did it just with UiBinder (it is not a PresenterWidget and some problems are appearing). I need some links (actually I hesitate between using Hyperlinks or MenuItems) and I do not know how to manually reveal other Presenters without the PlaceManager...So should I inject a PlaceManager in my SidebarWidget (but I do not know if it will be the "same" PlaceManger singleton that will be invoked) ?  

 - Some links of the SidebarWidget should also call some popupWidgetPresenters, but I cannot call addToPopupSlot() (because SidebarWidget is not a Presenter) and I understood that popupWidgets are not places so I cannot reveal them using PlaceRequest and PlaceManager. So how could I do ?

Thanks a lot for you for the help,





--
Christian Goudreau
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages