gwt-mvp

GWT 2.2 MVP vs. GWT 2.1 Activities-Places

£可爱£侵袭症+ 提交于 2020-01-13 08:10:14
问题 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

GWT MVP updating Activity state on Place change

て烟熏妆下的殇ゞ 提交于 2020-01-01 03:17:09
问题 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; ...

How to use UiHandlers of GWT Platform?

别说谁变了你拦得住时间么 提交于 2019-12-25 14:29:10
问题 I've been trying to write contacts. example using gwt-platform I've successfully got the contacts view using manual reveal to obtain contacts list, I'm trying to use UiHandlers for add button but it is not calling the method in my ContactsPresenter's onAddButtonClicked(). fallowing is the code snippet of my view public class ContactsView extends ViewWithUiHandlers<ContactsViewUiHandlers> implements ContactsPresenter.MyView { private final Widget widget; @UiField Button addButton; @UiHandler(

Model-View-Presenter with Google Web Toolkit (GWT)

不打扰是莪最后的温柔 提交于 2019-12-24 10:56:03
问题 I am thinking about developing a new application using web toolkit. I decided that the best option is going to be to use the Model-View-Presenter Design Pattern. After doing plenty of research, I found two different ways of implementing the skeleton code. (I am still trying to learn MVP and how to best utilize the disjunction between the model and the view) Here are the two links discussing GWT MVP https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces https:/

Connecting gwt-dispatch with guice and mvp4g

与世无争的帅哥 提交于 2019-12-13 04:09:23
问题 I have some questions regarding gwt-dispatch and guice. I'm using Guice 2.0, gwt-dispatch 1.1.0 snapshot, mvp4g 1.1.0 and GIN 1.0 First of all, I have defined simple action, result and handler: ListContactsAction.java public class ListContactsAction implements Action<ListContactsResult>{ public ListContactsAction() { } } ListContactsResult.java public class ListContactsResult implements Result { private List<Contact> contactList; public ListContactsResult() { } public ListContactsResult(List

What is the advantage of the MVP pattern (GWT)

ぐ巨炮叔叔 提交于 2019-12-09 13:13:12
问题 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? 回答1: I have to disagree, MVP makes code way less complex, especially in case of GWT. If

mocking GWT EventBus with mockito

谁说胖子不能爱 提交于 2019-12-08 02:03:36
问题 I have some problems spying on a real SimpleEventBus implementation of EventBus: I have an activity which is also a handler for a specific event. This event is fired by a service. The code: @Mock private AssetCellList view; @Mock private AcceptsOneWidget panel; @Mock private SelectionModel<Asset> selectionModel; @Mock private HasData<Asset> cellList; @Mock private AssetService service; @Mock private Asset asset; @Mock private List<Asset> list; @Mock private AssetListDTOClientImpl assetDTO;

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

丶灬走出姿态 提交于 2019-12-07 00:31: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

mocking GWT EventBus with mockito

会有一股神秘感。 提交于 2019-12-06 11:17:14
I have some problems spying on a real SimpleEventBus implementation of EventBus: I have an activity which is also a handler for a specific event. This event is fired by a service. The code: @Mock private AssetCellList view; @Mock private AcceptsOneWidget panel; @Mock private SelectionModel<Asset> selectionModel; @Mock private HasData<Asset> cellList; @Mock private AssetService service; @Mock private Asset asset; @Mock private List<Asset> list; @Mock private AssetListDTOClientImpl assetDTO; @Mock private AssetEvent event; @Before public void setUp() throws Exception { MockitoAnnotations

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

≯℡__Kan透↙ 提交于 2019-12-06 10:23:45
问题 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. 回答1: There's