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

Commit

Permalink
added push state to gwtp-hplace-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarop committed Nov 14, 2012
1 parent 23c01c6 commit a3d278b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.google.gwt.uibinder.UiBinder" />
<inherits name="com.google.gwt.inject.Inject" />
<inherits name="de.barop.gwt.PushState" />

<inherits name='com.gwtplatform.dispatch.Dispatch' />
<inherits name="com.gwtplatform.mvp.Mvp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import com.gwtplatform.samples.hplace.client.presenter.BreadcrumbsPresenter;
import com.gwtplatform.samples.hplace.client.presenter.BreadcrumbsPresenter.MyView;

import de.barop.gwt.client.ui.InlineHyperlinkPushState;

/**
* This is the top-level view of the application. Every time another presenter
* wants to reveal itself, {@link BreadcrumbPresenterView} will add its content
Expand Down Expand Up @@ -71,7 +73,7 @@ public void clearBreadcrumbs(int breadcrumbSize) {
if (i > 0) {
breadcrumbs.add(new InlineLabel(" > "));
}
breadcrumbs.add(new InlineHyperlink("Loading title...",
breadcrumbs.add(new InlineHyperlinkPushState("Loading title...",
placeManager.buildRelativeHistoryToken(i + 1)));
}
}
Expand Down Expand Up @@ -103,4 +105,4 @@ private void setMainContent(Widget content) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import com.gwtplatform.samples.hplace.client.presenter.ProductPresenter;
import com.gwtplatform.samples.hplace.shared.Product;

import de.barop.gwt.client.ui.HyperlinkPushState;

import java.util.List;

/**
Expand Down Expand Up @@ -81,7 +83,7 @@ public void setList(List<Product> products) {
for (Product product : products) {
PlaceRequest request = new PlaceRequest(NameTokens.product).with(
ProductPresenter.TOKEN_ID, Integer.toString(product.getId()));
productList.add(new Hyperlink(product.getName(),
productList.add(new HyperlinkPushState(product.getName(),
placeManager.buildRelativeHistoryToken(request)));
}
}
Expand All @@ -96,4 +98,4 @@ public void setMessage(String string) {
public void setTitle(String title) {
this.title.setInnerHTML(title);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.gwtplatform.dispatch.annotation.GenDispatch;
import com.gwtplatform.dispatch.annotation.In;
import com.gwtplatform.dispatch.annotation.Out;
import com.gwtplatform.dispatch.shared.Action;

/**
* This classes uses GWTP annotation processors
Expand All @@ -27,7 +28,7 @@
*
* @author Philippe Beaudoin
*/
@GenDispatch(isSecure = false)
@GenDispatch(isSecure = false, serviceName = "/" + Action.DEFAULT_SERVICE_NAME + "GetProduct")
public class GetProduct {

@In(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.gwtplatform.dispatch.annotation.GenDispatch;
import com.gwtplatform.dispatch.annotation.In;
import com.gwtplatform.dispatch.annotation.Out;
import com.gwtplatform.dispatch.shared.Action;

import java.util.ArrayList;

Expand All @@ -29,7 +30,7 @@
*
* @author Philippe Beaudoin
*/
@GenDispatch(isSecure = false)
@GenDispatch(isSecure = false, serviceName = "/" + Action.DEFAULT_SERVICE_NAME + "GetProductList")
public class GetProductList {
@In(1)
int flags;
Expand Down

0 comments on commit a3d278b

Please sign in to comment.