mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 03:43:52 +00:00
Initial data fetch (needs to be stripped down for mobile)
This commit is contained in:
1 parent
fa39d4cb2e
commit
60422d321f
3 files changed
+25
-2
No files matched your search
+16
-2
@@ -3,11 +3,13 @@ package com.sap.sailing.gwt.home.mobile.places.start;
|
||||
import com.google.gwt.activity.shared.AbstractActivity;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.sap.sailing.gwt.home.client.place.start.StartPlace;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobileApplicationClientFactory;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.mobile.places.start.StartView.Presenter;
|
||||
import com.sap.sailing.gwt.ui.shared.start.StartViewDTO;
|
||||
|
||||
public class StartActivity extends AbstractActivity implements Presenter {
|
||||
private final MobileApplicationClientFactory clientFactory;
|
||||
@@ -20,9 +22,21 @@ public class StartActivity extends AbstractActivity implements Presenter {
|
||||
|
||||
@Override
|
||||
public void start(final AcceptsOneWidget panel, EventBus eventBus) {
|
||||
final StartView view = new StartViewImpl(this);
|
||||
panel.setWidget(view.asWidget());
|
||||
Window.setTitle(place.getTitle());
|
||||
clientFactory.getHomeService().getStartView(new AsyncCallback<StartViewDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StartViewDTO result) {
|
||||
final StartView view = new StartViewImpl(StartActivity.this);
|
||||
panel.setWidget(view.asWidget());
|
||||
Window.setTitle(place.getTitle());
|
||||
view.setData(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
@@ -5,6 +5,7 @@ import java.util.Collection;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.general.EventReferenceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.start.StartViewDTO;
|
||||
|
||||
public interface StartView {
|
||||
|
||||
@@ -15,5 +16,7 @@ public interface StartView {
|
||||
public interface Presenter {
|
||||
MobilePlacesNavigator getNavigator();
|
||||
}
|
||||
|
||||
void setData(StartViewDTO data);
|
||||
}
|
||||
|
||||
+6
@@ -9,6 +9,7 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.stage.Stage;
|
||||
import com.sap.sailing.gwt.ui.shared.general.EventReferenceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.start.StartViewDTO;
|
||||
|
||||
public class StartViewImpl extends Composite implements StartView {
|
||||
private static StartPageViewUiBinder uiBinder = GWT.create(StartPageViewUiBinder.class);
|
||||
@@ -27,6 +28,11 @@ public class StartViewImpl extends Composite implements StartView {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(StartViewDTO data) {
|
||||
stage.setFeaturedEvents(data.getStageEvents());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuickFinderValues(Collection<EventReferenceDTO> events) {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user