Places を介してプロジェクトの履歴を管理しています。
私がすることはこれです:
- 最上位に PlaceRequestHandler を実装します (AppController など)。
- 登録 -> eventBus.addHandler(PlaceRequestEvent.getType(), this);
- プロジェクトナビゲーションを行うメソッド「onPlaceRequest」を実装します。
私は GWT プレゼンターを使用しており、プロジェクト内のすべてのプレゼンターがonPlaceRequest
メソッドをオーバーライドしています。
すべてのリクエストがトップレベルの「onPlaceRequest」メソッドから処理されるのに、なぜこれが必要なのですか?
例を挙げます:
public class AppController implements Presenter, PlaceRequestHandler
...........
public void bind()
{
eventBus.addHandler(PlaceRequestEvent.getType(), this);
...
}
public void onPlaceRequest(PlaceRequestEvent event)
{
// here is the project navigation tree
}
発表者を 1 人選びましょう
public class SomePresenter extends Presenter<SomePresenter.Display>
{
... here some methods are overriden and
@Override
protected void onPlaceRequest(PlaceRequest request)
{
// what should I do here?
}
}
アイデアは何ですか、そしてそれをどのように使用するべきですか?