If we think about the ActivityMapper as the one place that knows about both the Place and the Activity and how to bind them together, then each Activity should expose its own API and the ActivityMapper should then call it. In your case, that could be:
// in the activity
public void setFilter(String filter) { ... }
// in the mapper
if (place instanceof CustomersListActivity) {
if (lastPlace instanceof CustomersListActivity) {
lastActivity = createSearchActivity(((CustomersListActivity) place).getFilter());
} else {
((CustomersListActivity) lastActivity).setFilter(((CustomersListActivity) place).getFilter());
}
} else {
// handle other places
}
// keep track of the last seen place
lastPlace = place;
return lastActivity;
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/yym6Yc5763IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment