mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
extracted highcharts to own splitpoint
This commit is contained in:
1 parent
04777c0e84
commit
1cd894be61
4 files changed
+50
-15
No files matched your search
-5
@@ -19,8 +19,6 @@ import com.sap.sailing.gwt.ui.client.ServerConfigurationServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.client.mvp.AbstractMvpEntryPoint;
|
||||
import com.sap.sse.gwt.resources.CommonControlsCSS;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
|
||||
/**
|
||||
* Desktop/tablet EntryPoint for the Home module. Be aware that this EntryPoint isn't directly started but instead the
|
||||
@@ -33,9 +31,6 @@ public class DesktopEntryPoint extends AbstractMvpEntryPoint<StringMessages, Des
|
||||
public void doOnModuleLoad() {
|
||||
Document.get().getBody().addClassName(SharedResources.INSTANCE.mainCss().desktop());
|
||||
|
||||
CommonControlsCSS.ensureInjected();
|
||||
Highcharts.ensureInjected();
|
||||
|
||||
ServerConfigurationServiceAsync serverConfigService = GWT.create(ServerConfigurationService.class);
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) serverConfigService, RemoteServiceMappingConstants.serverConfigurationServiceRemotePath);
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.sap.sailing.gwt.home.desktop;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.RunAsyncCallback;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.sap.sse.gwt.resources.CommonControlsCSS;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
|
||||
public class HighChartInjector {
|
||||
public static void loadHighCharts(Runnable afterLoad){
|
||||
GWT.runAsync(new RunAsyncCallback() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
CommonControlsCSS.ensureInjected();
|
||||
Highcharts.ensureInjected();
|
||||
afterLoad.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable reason) {
|
||||
Window.alert(reason.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+15
-8
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.home.desktop.places.event;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.domain.common.dto.EventType;
|
||||
import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.home.desktop.HighChartInjector;
|
||||
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.desktop.app.WithHeader;
|
||||
import com.sap.sailing.gwt.home.desktop.places.event.multiregatta.AbstractMultiregattaEventPlace;
|
||||
@@ -34,14 +35,20 @@ public class EventActivityProxy extends AbstractEventActivityProxy<EventClientFa
|
||||
GWT.runAsync(new AbstractRunAsyncCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (place instanceof AbstractEventRegattaPlace) {
|
||||
super.onSuccess(new EventRegattaActivity((AbstractEventRegattaPlace) place, event, clientFactory,
|
||||
homePlacesNavigator, getNavigationPathDisplay()));
|
||||
}
|
||||
if (place instanceof AbstractMultiregattaEventPlace) {
|
||||
super.onSuccess(new EventMultiregattaActivity((AbstractMultiregattaEventPlace) place, event,
|
||||
clientFactory, homePlacesNavigator, getNavigationPathDisplay()));
|
||||
}
|
||||
HighChartInjector.loadHighCharts(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (place instanceof AbstractEventRegattaPlace) {
|
||||
onSuccess(new EventRegattaActivity((AbstractEventRegattaPlace) place, event, clientFactory,
|
||||
homePlacesNavigator, getNavigationPathDisplay()));
|
||||
}
|
||||
if (place instanceof AbstractMultiregattaEventPlace) {
|
||||
onSuccess(new EventMultiregattaActivity((AbstractMultiregattaEventPlace) place, event,
|
||||
clientFactory, homePlacesNavigator, getNavigationPathDisplay()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+9
-2
@@ -6,6 +6,7 @@ import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.gwt.home.client.place.event.legacy.SeriesClientFactory;
|
||||
import com.sap.sailing.gwt.home.communication.fakeseries.EventSeriesViewDTO;
|
||||
import com.sap.sailing.gwt.home.communication.fakeseries.GetEventSeriesViewAction;
|
||||
import com.sap.sailing.gwt.home.desktop.HighChartInjector;
|
||||
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.desktop.app.WithHeader;
|
||||
import com.sap.sailing.gwt.home.desktop.places.fakeseries.eventstab.SeriesEventsPlace;
|
||||
@@ -60,8 +61,14 @@ public class SeriesActivityProxy extends AbstractActivityProxy implements Provid
|
||||
place = getRealPlace(series);
|
||||
}
|
||||
place = verifyAndAdjustPlace();
|
||||
super.onSuccess(new SeriesActivity((AbstractSeriesTabPlace) place, series, clientFactory,
|
||||
homePlacesNavigator, navigationPathDisplay));
|
||||
HighChartInjector.loadHighCharts(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
onSuccess(new SeriesActivity((AbstractSeriesTabPlace) place, series, clientFactory,
|
||||
homePlacesNavigator, navigationPathDisplay));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user