Here you go:
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
public class BasicPlace extends Place {
public class BasicPlaceTokenizer implements PlaceTokenizer
{
// Instance of a BasicPlace that will be returned
// for a null token
private BasicPlace place;
// Init this tokenizer with a subclass of BasicPlace
public BasicPlaceTokenizer(BasicPlace basicPlace) {
this.place = basicPlace;
}
@Override
public Place getPlace(String token) {
return this.place;
}
@Override
public String getToken(Place place) {
// BasicPlaces have no state so we can always
// return null. By default, GWT creates a
// URL containing the class name of the Place
// so we don't have to worry about that part.
return null;
}
}
}
Along with this, you'll have to use a TokenizerFactory which provides
a method to obtain the BasicPlaceTokenizer for each sub-class,
something like this:
PlaceTokenizer<MyBasicPlaceSubclass> getMySubclassPlaceTokenizer()
{
return new BasicPlaceTokenizer(new MyBasicPlaceSubclass());
}
In retrospect, BasicPlace likely doesn't buy you much. It's probably
just as easy to create a PlaceTokenizer for each Place in your app as
shown in the article.
/dmc
On Fri, Nov 12, 2010 at 2:58 AM, MBKG <[email protected]> wrote:
> I read the article:
> http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html
>
> Quote:"Many Places in your app might not save any state to the URL, so
> they could just extend a BasicPlace which declares a PlaceTokenizer
> that returns a null token."
>
> Where can I find BasicPlace?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
--
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.