2 * Copyright (C) 2011 Openismus GmbH
4 * This file is part of GWT-Glom.
6 * GWT-Glom is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
11 * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with GWT-Glom. If not, see <http://www.gnu.org/licenses/>.
20 package org.glom.web.client.activity;
22 import org.glom.web.client.ClientFactory;
23 import org.glom.web.client.place.DetailsPlace;
24 import org.glom.web.client.ui.DetailsView;
26 import com.google.gwt.activity.shared.AbstractActivity;
27 import com.google.gwt.event.shared.EventBus;
28 import com.google.gwt.place.shared.Place;
29 import com.google.gwt.user.client.ui.AcceptsOneWidget;
32 * @author Ben Konrath <ben@bagu.org>
35 public class DetailsActivity extends AbstractActivity implements DetailsView.Presenter {
36 private final String documentTitle;
37 private final ClientFactory clientFactory;
38 private final DetailsView detailsView;
43 public DetailsActivity(DetailsPlace place, ClientFactory clientFactory) {
44 this.documentTitle = place.getDocumentTitle();
45 this.clientFactory = clientFactory;
46 detailsView = clientFactory.getDetailsView();
52 * @see com.google.gwt.activity.shared.Activity#start(com.google.gwt.user.client.ui.AcceptsOneWidget,
53 * com.google.gwt.event.shared.EventBus)
56 public void start(AcceptsOneWidget panel, EventBus eventBus) {
57 // register this class as the presenter
58 detailsView.setPresenter(this);
60 // TODO RPC and / or EventBus code goes here
62 // indicate that the view is ready to be displayed
63 panel.setWidget(detailsView.asWidget());
69 * @see com.google.gwt.activity.shared.Activity#onCancel()
72 public void onCancel() {
73 // TODO detailsView.clear();
79 * @see com.google.gwt.activity.shared.Activity#onStop()
82 public void onStop() {
83 // TODO detailsView.clear();
89 * @see org.glom.web.client.ui.DetailsView.Presenter#goTo(com.google.gwt.place.shared.Place)
92 public void goTo(Place place) {
93 clientFactory.getPlaceController().goTo(place);