Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Commit a3d278b

Browse files
committed
added push state to gwtp-hplace-sample
1 parent 23c01c6 commit a3d278b

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

src/examples/java/com/gwtplatform/samples/hplace/Gwtphplacesample.gwt.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<inherits name='com.google.gwt.user.User'/>
77
<inherits name="com.google.gwt.uibinder.UiBinder" />
88
<inherits name="com.google.gwt.inject.Inject" />
9+
<inherits name="de.barop.gwt.PushState" />
910

1011
<inherits name='com.gwtplatform.dispatch.Dispatch' />
1112
<inherits name="com.gwtplatform.mvp.Mvp" />

src/examples/java/com/gwtplatform/samples/hplace/client/view/BreadcrumbsView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import com.gwtplatform.samples.hplace.client.presenter.BreadcrumbsPresenter;
3131
import com.gwtplatform.samples.hplace.client.presenter.BreadcrumbsPresenter.MyView;
3232

33+
import de.barop.gwt.client.ui.InlineHyperlinkPushState;
34+
3335
/**
3436
* This is the top-level view of the application. Every time another presenter
3537
* wants to reveal itself, {@link BreadcrumbPresenterView} will add its content
@@ -71,7 +73,7 @@ public void clearBreadcrumbs(int breadcrumbSize) {
7173
if (i > 0) {
7274
breadcrumbs.add(new InlineLabel(" > "));
7375
}
74-
breadcrumbs.add(new InlineHyperlink("Loading title...",
76+
breadcrumbs.add(new InlineHyperlinkPushState("Loading title...",
7577
placeManager.buildRelativeHistoryToken(i + 1)));
7678
}
7779
}
@@ -103,4 +105,4 @@ private void setMainContent(Widget content) {
103105
}
104106
}
105107

106-
}
108+
}

src/examples/java/com/gwtplatform/samples/hplace/client/view/ProductListView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import com.gwtplatform.samples.hplace.client.presenter.ProductPresenter;
3535
import com.gwtplatform.samples.hplace.shared.Product;
3636

37+
import de.barop.gwt.client.ui.HyperlinkPushState;
38+
3739
import java.util.List;
3840

3941
/**
@@ -81,7 +83,7 @@ public void setList(List<Product> products) {
8183
for (Product product : products) {
8284
PlaceRequest request = new PlaceRequest(NameTokens.product).with(
8385
ProductPresenter.TOKEN_ID, Integer.toString(product.getId()));
84-
productList.add(new Hyperlink(product.getName(),
86+
productList.add(new HyperlinkPushState(product.getName(),
8587
placeManager.buildRelativeHistoryToken(request)));
8688
}
8789
}
@@ -96,4 +98,4 @@ public void setMessage(String string) {
9698
public void setTitle(String title) {
9799
this.title.setInnerHTML(title);
98100
}
99-
}
101+
}

src/examples/java/com/gwtplatform/samples/hplace/shared/GetProduct.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.gwtplatform.dispatch.annotation.GenDispatch;
2020
import com.gwtplatform.dispatch.annotation.In;
2121
import com.gwtplatform.dispatch.annotation.Out;
22+
import com.gwtplatform.dispatch.shared.Action;
2223

2324
/**
2425
* This classes uses GWTP annotation processors
@@ -27,7 +28,7 @@
2728
*
2829
* @author Philippe Beaudoin
2930
*/
30-
@GenDispatch(isSecure = false)
31+
@GenDispatch(isSecure = false, serviceName = "/" + Action.DEFAULT_SERVICE_NAME + "GetProduct")
3132
public class GetProduct {
3233

3334
@In(1)

src/examples/java/com/gwtplatform/samples/hplace/shared/GetProductList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.gwtplatform.dispatch.annotation.GenDispatch;
2020
import com.gwtplatform.dispatch.annotation.In;
2121
import com.gwtplatform.dispatch.annotation.Out;
22+
import com.gwtplatform.dispatch.shared.Action;
2223

2324
import java.util.ArrayList;
2425

@@ -29,7 +30,7 @@
2930
*
3031
* @author Philippe Beaudoin
3132
*/
32-
@GenDispatch(isSecure = false)
33+
@GenDispatch(isSecure = false, serviceName = "/" + Action.DEFAULT_SERVICE_NAME + "GetProductList")
3334
public class GetProductList {
3435
@In(1)
3536
int flags;

0 commit comments

Comments
 (0)