// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/AnalyticsActivity.java
// public class AnalyticsActivity extends AbstractActivity implements AnalyticsView.Presenter {
// 
//     private final ClientFactory clientFactory;
//     private String name;
// 
//     private AnalyticsView view;
// 
//     public AnalyticsActivity(AnalyticsPlace place, ClientFactory clientFactory) {
//         this.name = place.getAnalyticsName();
//         this.clientFactory = clientFactory;
//     }
// 
//     @Override
//     public void start(AcceptsOneWidget panel, EventBus eventBus) {
//         view = clientFactory.getAnalyticsView();
//         view.setPresenter(this);
//         panel.setWidget(view.asWidget());
// 
//     }
// 
//     @Override
//     public void onDateSubmit(Date startDate, Date endDate, String account) {
// 
//         DateTimeFormat fmt = DateTimeFormat.getFormat("/yyyy/M/d");
// 
//         if (startDate.getTime() > endDate.getTime()) {
// 
//             MaterialToast.fireToast("Whoops! Invalid date range.", 1000);
//         } else {
//             String fromDate = fmt.format(startDate);
//             String toDate = fmt.format(endDate);
//             String dateRange = fromDate + toDate;
// 
//             clientFactory.getEventBus().fireEvent(new DateSubmitEvent(dateRange, startDate, endDate, account));
//         }
// 
//     }
// 
//     @Override
//     public EventBus getEventBus() {
//         return clientFactory.getEventBus();
//     }
// 
// 
// 
// }
// 
// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/AnalyticsPlace.java
// public class AnalyticsPlace extends Place {
//     private String AnalyticsName;
// 
//     public AnalyticsPlace(String token) {
//         this.AnalyticsName = token;
//     }
// 
//     public String getAnalyticsName() {
//         return AnalyticsName;
//     }
// 
//     public static class AnalyticsPlaceTokenizer implements PlaceTokenizer<AnalyticsPlace> {
// 
//         @Override
//         public String getToken(AnalyticsPlace place) {
//             return place.getAnalyticsName();
//         }
// 
//         @Override
//         public AnalyticsPlace getPlace(String token) {
//             return new AnalyticsPlace(token);
//         }
//     }
// }


import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import gov.wa.wsdot.apps.analytics.client.activities.twitter.AnalyticsActivity;
import gov.wa.wsdot.apps.analytics.client.activities.twitter.AnalyticsPlace;
/*
 * Copyright (c) 2016 Washington State Department of Transportation
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
package gov.wa.wsdot.apps.analytics.client;


public class AppActivityMapper implements ActivityMapper {
    private ClientFactory clientFactory;

    public AppActivityMapper(ClientFactory clientFactory) {
        super();
        this.clientFactory = clientFactory;
    }

    @Override
    public Activity getActivity(Place place) {
// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/AnalyticsActivity.java
// public class AnalyticsActivity extends AbstractActivity implements AnalyticsView.Presenter {
// 
//     private final ClientFactory clientFactory;
//     private String name;
// 
//     private AnalyticsView view;
// 
//     public AnalyticsActivity(AnalyticsPlace place, ClientFactory clientFactory) {
//         this.name = place.getAnalyticsName();
//         this.clientFactory = clientFactory;
//     }
// 
//     @Override
//     public void start(AcceptsOneWidget panel, EventBus eventBus) {
//         view = clientFactory.getAnalyticsView();
//         view.setPresenter(this);
//         panel.setWidget(view.asWidget());
// 
//     }
// 
//     @Override
//     public void onDateSubmit(Date startDate, Date endDate, String account) {
// 
//         DateTimeFormat fmt = DateTimeFormat.getFormat("/yyyy/M/d");
// 
//         if (startDate.getTime() > endDate.getTime()) {
// 
//             MaterialToast.fireToast("Whoops! Invalid date range.", 1000);
//         } else {
//             String fromDate = fmt.format(startDate);
//             String toDate = fmt.format(endDate);
//             String dateRange = fromDate + toDate;
// 
//             clientFactory.getEventBus().fireEvent(new DateSubmitEvent(dateRange, startDate, endDate, account));
//         }
// 
//     }
// 
//     @Override
//     public EventBus getEventBus() {
//         return clientFactory.getEventBus();
//     }
// 
// 
// 
// }
// 
// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/AnalyticsPlace.java
// public class AnalyticsPlace extends Place {
//     private String AnalyticsName;
// 
//     public AnalyticsPlace(String token) {
//         this.AnalyticsName = token;
//     }
// 
//     public String getAnalyticsName() {
//         return AnalyticsName;
//     }
// 
//     public static class AnalyticsPlaceTokenizer implements PlaceTokenizer<AnalyticsPlace> {
// 
//         @Override
//         public String getToken(AnalyticsPlace place) {
//             return place.getAnalyticsName();
//         }
// 
//         @Override
//         public AnalyticsPlace getPlace(String token) {
//             return new AnalyticsPlace(token);
//         }
//     }
// }


// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/AppActivityMapper.java
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import gov.wa.wsdot.apps.analytics.client.activities.twitter.AnalyticsActivity;
import gov.wa.wsdot.apps.analytics.client.activities.twitter.AnalyticsPlace;

/*
 * Copyright (c) 2016 Washington State Department of Transportation
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
package gov.wa.wsdot.apps.analytics.client;


public class AppActivityMapper implements ActivityMapper {
    private ClientFactory clientFactory;

    public AppActivityMapper(ClientFactory clientFactory) {
        super();
        this.clientFactory = clientFactory;
    }

    @Override
    public Activity getActivity(Place place) {
        if (place instanceof AnalyticsPlace)