gwt-mvp

How do you use GWT's SimpleEventBus or EventBus?

99封情书 提交于 2019-12-06 03:55:25
问题 I'm working on developing some simple graphing software which needs to be implemented in both swing and gwt. On the gwt side, I'm going to use gwt-g2d for the canvas. I was hoping to use an eventbus across both implementations to simplify some of the software. My understanding is that it should be something like this: Instantiate EventBus Instantiate Parent Widget, sink the events you want for the EventBus (mouseover or rpc callback, for example) Set EventBus to listen for events from the

GWT MVP - maintaining multiple displays that are separate of one another

守給你的承諾、 提交于 2019-12-05 05:49:58
I have a GWT App and I am using GWT MVP with Places / Activities. My application layout is something like MENU | CONTENT The Menu and the Content displays will change dynamically and one changes separately from the other. What I mean by this is that when the Content display changes I do not want to have to update the Menu display and vice versa. Both displays need to be able to respond to PlaceChangeEvents and update themselves when these occur. The problem is that each display should only update in response to certain PlaceChangeEvents, ignoring PlaceChangeEvents that are directed at the

GWT - Where should i use code splitting while using places/activities/mappers?

夙愿已清 提交于 2019-12-05 01:14:39
问题 "core" refers to the initial piece of the application that is loaded. In order to bind url to places, GWT uses PlaceTokenizer<P extends Place> . When loading the application from the url, it calls the method P getPlace(String token) to retrieve a new instance of the place to call. due to the asynchronous nature of code splitting, I can't create the place inside a runAsync in this method. So I have to put all the places of my app in the core. To link places to activity, GWT calls Activity

GWT 2.2 MVP vs. GWT 2.1 Activities-Places

岁酱吖の 提交于 2019-12-05 01:11:41
I'm starting to develop a large GWT application, and after reading a lot of articles and blog posts, I'm trying to understand what is the difference between the 2.2 Model-View-Presenter and the 2.1 Activities-Places design patterns? Which pattern do you recommend and why? Should I use MVP simply because it is "newer"? On the other hand Places-Activities seems to be more "intuitive"... Or am i totally missing the point and MVP is just an improved version of Activities-Places? Thanks to all GWT gurus out there :-) First I would recommend you reading this: http://code.google.com/webtoolkit/doc

GWT 2.1 Place/Activity technique glitch: URL changes before navigation is confirmed

亡梦爱人 提交于 2019-12-04 16:54:05
I'm reading this google guide and using this sample code provided by google , but there's a glitch: using the back/forth buttons makes the URL change before the confirmation dialog has returned. This means that if the user decides not to navigate away, the URL no longer represents the current Place. Anyone have a solution or workaround? Ideally, the URL would not change until the confirmation is given, but even just switching the URL back in a hurry after a denial would be better. There's no workaround. Your app somehow detects that the URL has changed, which triggers the place change (thus

What is the advantage of the MVP pattern (GWT)

我是研究僧i 提交于 2019-12-03 17:01:28
I just read this article and it did confuse me a lot. Secondly, this model allows us to minimize our use of GWTTestCase, which relies on the presence of a browser, and, for the bulk of our code, write lightweight (and fast) JRE tests (which don't require a browser). [1] Is this the whole benefit, I have from following this design pattern? It seems to make the code more complex... Do you use this pattern? topchef I have to disagree, MVP makes code way less complex, especially in case of GWT. If you plan on medium to large size GWT project then MVP architecture is your primary option. I suggest

Eliminating GWT ActivityMapper boilerplate

佐手、 提交于 2019-12-03 12:44:51
问题 I am using the GWT Activities and Places framework to structure my application and it is turning out nicely. One thing that annoys me though is that the ActivityMapper implementation is (1) receiving all the views in the application (2) contains a giant if/else block for instantiating activities based on the received place. It will only get worse as the number of views increases. I am already using Gin but I don't see how I can use it here. How can I reduce or eliminate the boilerplate from

GWT MVP updating Activity state on Place change

丶灬走出姿态 提交于 2019-12-03 07:33:57
What is the best practise to update Activity state on Place change? Imagine you have an activity with view that displays list of categories and list of items in the category. If different category is selected then app goes to new place with category ID. I want then to only refresh items and not to create new activity that also re-reads category list. My current approach is like this: public class AppActivityMapper implements ActivityMapper { private ItemListActivity itemListActivity; ... public Activity getActivity(final Place place) { final Activity activity; if (place instanceof

Eliminating GWT ActivityMapper boilerplate

跟風遠走 提交于 2019-12-03 02:12:40
I am using the GWT Activities and Places framework to structure my application and it is turning out nicely. One thing that annoys me though is that the ActivityMapper implementation is (1) receiving all the views in the application (2) contains a giant if/else block for instantiating activities based on the received place. It will only get worse as the number of views increases. I am already using Gin but I don't see how I can use it here. How can I reduce or eliminate the boilerplate from my ActivityMapper ? There isn't a great answer yet. I have code generation schemes in mind, but it's all

MVP: Should the View implement a Presenter's interface or vice versa?

為{幸葍}努か 提交于 2019-11-28 20:40:58
I am doing my first steps with GWT . I have a question after reading: Large scale application development and MVP Large scale application development and MVP - Part II In the first example the Presenter defines the interface for the View . public class ContactsPresenter implements Presenter { ... public interface Display extends HasValue<List<String>> { HasClickHandlers getAddButton(); HasClickHandlers getDeleteButton(); HasClickHandlers getList(); void setData(List<String> data); int getClickedRow(ClickEvent event); List<Integer> getSelectedRows(); Widget asWidget(); } } And in the second one