mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 06:18:12 +00:00
Merge branch 'master' into bug4495
Change-Id: Ide0a1d66ce595e34aa0e3a628543c70696ab6501
This commit is contained in:
commit
cd454b38b6
6 files changed
+43
-16
No files matched your search
@@ -1,5 +1,19 @@
|
||||
package com.sap.sailing.domain.tracking;
|
||||
|
||||
/**
|
||||
* Can be {@link TrackedRegatta#addRaceListener(RaceListener, java.util.Optional) added to}
|
||||
* and {@link TrackedRegatta#removeRaceListener(RaceListener) removed from} a {@link TrackedRegatta}
|
||||
* to listen for {@link TrackedRace}s being added and removed from the {@link TrackedRegatta}.<p>
|
||||
*
|
||||
* The notifications are processed by a single thread per {@link TrackedRegatta}. This implies
|
||||
* that implementations must not block for events triggered only by other callbacks to implementations
|
||||
* of this interface, or else they risk a deadlock. For example, trying a blocking wait for
|
||||
* another {@link TrackedRace} to appear is a bad idea because the appearance of that other
|
||||
* race may have to be signalled by a {@link #raceAdded(TrackedRace)} callback. *
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface RaceListener {
|
||||
void raceAdded(TrackedRace trackedRace);
|
||||
|
||||
|
||||
+13
-3
@@ -5,19 +5,28 @@ import com.sap.sailing.gwt.autoplay.client.app.AutoPlayClientFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public abstract class AutoPlayConfiguration {
|
||||
|
||||
public abstract void startRootNode(AutoPlayClientFactory cf, AutoPlayContextDefinition context,
|
||||
PerspectiveCompositeSettings<?> settings);
|
||||
|
||||
/**
|
||||
* This method should be pure/standalone, it is not allowed to make any guesses on fields written by startRootNode,
|
||||
* as it can be called before that
|
||||
*/
|
||||
public void openSettingsDialog(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback holder, PerspectiveCompositeSettings<?> settings,AutoPlayContextDefinition apcd) {
|
||||
OnSettingsCallback holder, PerspectiveCompositeSettings<?> settings, AutoPlayContextDefinition apcd,
|
||||
UserService userService) {
|
||||
Window.alert("This configuration does not have settings");
|
||||
|
||||
}
|
||||
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
/**
|
||||
* This method should be pure/standalone, it is not allowed to make any guesses on fields written by startRootNode,
|
||||
* as it can be called before that
|
||||
*/
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard, UserService userService,
|
||||
OnSettingsCallback holder) {
|
||||
holder.newSettings(null);
|
||||
}
|
||||
@@ -25,4 +34,5 @@ public abstract class AutoPlayConfiguration {
|
||||
public interface OnSettingsCallback {
|
||||
void newSettings(PerspectiveCompositeSettings<?> newSettings);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-6
@@ -19,14 +19,13 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.shared.components.LinkWithSettingsGenerator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogForLinkSharing;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
private AutoPlayClientFactory cf;
|
||||
|
||||
@Override
|
||||
public void startRootNode(AutoPlayClientFactory cf, AutoPlayContextDefinition context,
|
||||
PerspectiveCompositeSettings<?> settings) {
|
||||
this.cf = cf;
|
||||
final UUID eventUUID = context.getEventId();
|
||||
AsyncCallback<EventDTO> getEventByIdAsyncCallback = new AsyncCallback<EventDTO>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -53,7 +52,7 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
|
||||
@Override
|
||||
public void openSettingsDialog(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback settingsCallback, PerspectiveCompositeSettings<?> settings,AutoPlayContextDefinition apcd) {
|
||||
OnSettingsCallback settingsCallback, PerspectiveCompositeSettings<?> settings, AutoPlayContextDefinition apcd, UserService userService) {
|
||||
DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> callback = new DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>>() {
|
||||
@Override
|
||||
public void ok(PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> editedObject) {
|
||||
@@ -64,7 +63,7 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
public void cancel() {
|
||||
}
|
||||
};
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, cf.getUserService());
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, userService);
|
||||
PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> autoplayPerspectiveSettings = autoplayLifecycle
|
||||
.createDefaultSettings();
|
||||
LinkWithSettingsGenerator<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> settingsGenerator = new LinkWithSettingsGenerator<>(Window.Location.getPath(), autoplayLifecycle::createDefaultSettings, apcd);
|
||||
@@ -74,8 +73,8 @@ public class AutoPlayClassicConfiguration extends AutoPlayConfiguration {
|
||||
|
||||
@Override
|
||||
public void loadSettingsDefault(EventDTO selectedEvent, StrippedLeaderboardDTO leaderboard,
|
||||
OnSettingsCallback settingsCallback) {
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, cf.getUserService());
|
||||
UserService userService, OnSettingsCallback settingsCallback) {
|
||||
AutoplayPerspectiveLifecycle autoplayLifecycle = new AutoplayPerspectiveLifecycle(leaderboard, userService);
|
||||
settingsCallback.newSettings(autoplayLifecycle.createDefaultSettings());
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -25,6 +25,7 @@ import com.sap.sse.gwt.client.event.LocaleChangeEvent;
|
||||
import com.sap.sse.gwt.client.event.LocaleChangeEventHandler;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.settings.SettingsToUrlSerializer;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class AutoPlayStartPresenterImpl extends AbstractActivity implements AutoPlayStartView.Presenter {
|
||||
public static final String LOAD_EVENTS_DATA_CATEGORY = "loadEventsData";
|
||||
@@ -54,7 +55,7 @@ public class AutoPlayStartPresenterImpl extends AbstractActivity implements Auto
|
||||
StrippedLeaderboardDTO leaderBoard = AutoplayHelper.getSelectedLeaderboard(event,
|
||||
apcd.getLeaderboardName());
|
||||
|
||||
apcd.getType().getConfig().loadSettingsDefault(event, leaderBoard, new OnSettingsCallback() {
|
||||
apcd.getType().getConfig().loadSettingsDefault(event, leaderBoard, clientFactory.getUserService(), new OnSettingsCallback() {
|
||||
|
||||
@Override
|
||||
public void newSettings(PerspectiveCompositeSettings<?> newSettings) {
|
||||
@@ -118,4 +119,9 @@ public class AutoPlayStartPresenterImpl extends AbstractActivity implements Auto
|
||||
AutoPlayConfiguration autoPlayConfiguration = ctxDef.getType().getConfig();
|
||||
autoPlayConfiguration.startRootNode(clientFactory, ctxDef, settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserService getUserService() {
|
||||
return clientFactory.getUserService();
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -6,18 +6,18 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.autoplay.client.configs.AutoPlayContextDefinition;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public interface AutoPlayStartView {
|
||||
public interface Presenter {
|
||||
void startRootNode(AutoPlayContextDefinition ctxDef,
|
||||
PerspectiveCompositeSettings<?> settings);
|
||||
|
||||
void handleLocaleChange(String selectedLocale);
|
||||
UserService getUserService();
|
||||
}
|
||||
|
||||
void setCurrentPresenter(Presenter currentPresenter);
|
||||
Widget asWidget();
|
||||
|
||||
void setEvents(List<EventDTO> events);
|
||||
void showLoading();
|
||||
}
|
||||
+2
-4
@@ -151,7 +151,7 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
settings = newSettings;
|
||||
updateURL();
|
||||
}
|
||||
}, settings, apcd);
|
||||
}, settings, apcd, currentPresenter.getUserService());
|
||||
}
|
||||
|
||||
private boolean validate() {
|
||||
@@ -190,9 +190,8 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
settingsButton.removeStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
startAutoPlayButton.removeStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
apcd = new AutoPlayContextDefinitionImpl(selectedAutoPlayType, selectedEvent.id, selectedLeaderboardName);
|
||||
apcd.getType().getConfig().loadSettingsDefault(selectedEvent, selectedLeaderboard,
|
||||
apcd.getType().getConfig().loadSettingsDefault(selectedEvent, selectedLeaderboard, currentPresenter.getUserService(),
|
||||
new OnSettingsCallback() {
|
||||
|
||||
@Override
|
||||
public void newSettings(PerspectiveCompositeSettings<?> newSettings) {
|
||||
settings = newSettings;
|
||||
@@ -285,5 +284,4 @@ public class AutoPlayStartViewImpl extends Composite implements AutoPlayStartVie
|
||||
public void showLoading() {
|
||||
startAutoPlayButton.setEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user