mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 22:30:56 +00:00
1 parent
5c1c730fa7
commit
edb47feeb2
2 files changed
+96
-125
No files matched your search
+70
-96
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.place.start;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -37,6 +36,7 @@ import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.util.NullSafeComparatorWrapper;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.GWTLocaleUtil;
|
||||
@@ -54,50 +54,36 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
interface StartPageViewUiBinder extends UiBinder<Widget, DesktopStartView> {
|
||||
}
|
||||
|
||||
@UiField(provided = true)
|
||||
SAPHeader sapHeader;
|
||||
@UiField(provided = true)
|
||||
ListBox localeSelectionBox;
|
||||
@UiField(provided = true)
|
||||
ListBox eventSelectionBox;
|
||||
@UiField(provided = true)
|
||||
ListBox leaderboardSelectionBox;
|
||||
@UiField
|
||||
CheckBox startInFullscreenModeBox;
|
||||
@UiField
|
||||
Button startAutoPlayButton;
|
||||
@UiField
|
||||
DivElement leaderboardSelectionUi;
|
||||
@UiField
|
||||
DivElement screenConfigurationUi;
|
||||
@UiField
|
||||
FlowPanel leaderboardPerspectiveSettingsPanel;
|
||||
@UiField
|
||||
FlowPanel raceboardPerspectiveSettingsPanel;
|
||||
|
||||
@UiField
|
||||
CheckBox autoSwitchToRaceboard;
|
||||
@UiField
|
||||
IntegerBox timeToRaceStartInSeconds;
|
||||
|
||||
@UiField(provided=true) SAPHeader sapHeader;
|
||||
@UiField(provided=true) ListBox localeSelectionBox;
|
||||
@UiField(provided=true) ListBox eventSelectionBox;
|
||||
@UiField(provided=true) ListBox leaderboardSelectionBox;
|
||||
@UiField CheckBox startInFullscreenModeBox;
|
||||
@UiField Button startAutoPlayButton;
|
||||
@UiField DivElement leaderboardSelectionUi;
|
||||
@UiField DivElement screenConfigurationUi;
|
||||
@UiField FlowPanel leaderboardPerspectiveSettingsPanel;
|
||||
@UiField FlowPanel raceboardPerspectiveSettingsPanel;
|
||||
|
||||
@UiField CheckBox autoSwitchToRaceboard;
|
||||
@UiField IntegerBox timeToRaceStartInSeconds;
|
||||
|
||||
private final PlaceNavigator navigator;
|
||||
private final EventBus eventBus;
|
||||
private final List<EventDTO> events;
|
||||
|
||||
|
||||
private PerspectiveLifecycleWithAllSettings<LeaderboardWithHeaderPerspectiveLifecycle, LeaderboardWithHeaderPerspectiveSettings> leaderboardPerspectiveLifecyclesAndSettings;
|
||||
private PerspectiveLifecycleWithAllSettings<RaceBoardPerspectiveLifecycle, RaceBoardPerspectiveSettings> raceboardPerspectiveLifecyclesAndSettings;
|
||||
|
||||
|
||||
private final int defaultTimeToRaceStartTimeInSeconds = 180;
|
||||
|
||||
|
||||
public DesktopStartView(PlaceNavigator navigator, EventBus eventBus) {
|
||||
super();
|
||||
this.navigator = navigator;
|
||||
this.eventBus = eventBus;
|
||||
this.events = new ArrayList<EventDTO>();
|
||||
|
||||
// sapHeader = new
|
||||
// SAPHeaderWithAuthentication(StringMessages.INSTANCE.sapSailingAnalytics(),
|
||||
// StringMessages.INSTANCE.autoplayConfiguration());
|
||||
|
||||
// sapHeader = new SAPHeaderWithAuthentication(StringMessages.INSTANCE.sapSailingAnalytics(), StringMessages.INSTANCE.autoplayConfiguration());
|
||||
sapHeader = new SAPHeader(StringMessages.INSTANCE.sapSailingAnalytics());
|
||||
sapHeader.setHeaderTitle(StringMessages.INSTANCE.autoplayConfiguration());
|
||||
eventSelectionBox = new ListBox();
|
||||
@@ -106,7 +92,7 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
leaderboardSelectionBox.setMultipleSelect(false);
|
||||
localeSelectionBox = new ListBox();
|
||||
localeSelectionBox.setMultipleSelect(false);
|
||||
|
||||
|
||||
LocaleInfo currentLocale = LocaleInfo.getCurrentLocale();
|
||||
int i = 0;
|
||||
for (String localeName : GWTLocaleUtil.getAvailableLocales()) {
|
||||
@@ -127,76 +113,67 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
|
||||
leaderboardSelectionUi.getStyle().setVisibility(Visibility.HIDDEN);
|
||||
screenConfigurationUi.getStyle().setVisibility(Visibility.HIDDEN);
|
||||
|
||||
|
||||
startAutoPlayButton.setEnabled(false);
|
||||
startAutoPlayButton.addStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
}
|
||||
|
||||
private void updatePerspectives(AbstractLeaderboardDTO leaderboard) {
|
||||
LeaderboardWithHeaderPerspectiveLifecycle leaderboardPerspectiveLifecycle = new LeaderboardWithHeaderPerspectiveLifecycle(
|
||||
leaderboard, StringMessages.INSTANCE);
|
||||
leaderboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(
|
||||
leaderboardPerspectiveLifecycle, leaderboardPerspectiveLifecycle.createDefaultSettings());
|
||||
RaceBoardPerspectiveLifecycle raceboardPerspectiveLifecycle = new RaceBoardPerspectiveLifecycle(leaderboard,
|
||||
StringMessages.INSTANCE);
|
||||
raceboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(
|
||||
raceboardPerspectiveLifecycle, raceboardPerspectiveLifecycle.createDefaultSettings());
|
||||
LeaderboardWithHeaderPerspectiveLifecycle leaderboardPerspectiveLifecycle = new LeaderboardWithHeaderPerspectiveLifecycle(leaderboard, StringMessages.INSTANCE);
|
||||
leaderboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(leaderboardPerspectiveLifecycle, leaderboardPerspectiveLifecycle.createDefaultSettings());
|
||||
RaceBoardPerspectiveLifecycle raceboardPerspectiveLifecycle = new RaceBoardPerspectiveLifecycle(leaderboard, StringMessages.INSTANCE);
|
||||
raceboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(raceboardPerspectiveLifecycle, raceboardPerspectiveLifecycle.createDefaultSettings());
|
||||
}
|
||||
|
||||
private <PL extends PerspectiveLifecycle<PS>, PS extends Settings> void openPerspectiveSettingsDialog(
|
||||
final PerspectiveLifecycleWithAllSettings<PL, PS> perspectiveLifecycleAndSettings) {
|
||||
PerspectiveCompositeLifecycleTabbedSettingsDialog<PL, PS> dialog = new PerspectiveCompositeLifecycleTabbedSettingsDialog<>(
|
||||
StringMessages.INSTANCE, perspectiveLifecycleAndSettings,
|
||||
perspectiveLifecycleAndSettings.getPerspectiveLifecycle().getLocalizedShortName(),
|
||||
new DialogCallback<PerspectiveCompositeSettings<PS>>() {
|
||||
@Override
|
||||
public void ok(PerspectiveCompositeSettings<PS> newSettings) {
|
||||
perspectiveLifecycleAndSettings.setAllSettings(newSettings);
|
||||
};
|
||||
private <PL extends PerspectiveLifecycle<PS>, PS extends Settings> void openPerspectiveSettingsDialog(final PerspectiveLifecycleWithAllSettings<PL, PS> perspectiveLifecycleAndSettings) {
|
||||
PerspectiveCompositeLifecycleTabbedSettingsDialog<PL,PS> dialog = new PerspectiveCompositeLifecycleTabbedSettingsDialog<>(StringMessages.INSTANCE,
|
||||
perspectiveLifecycleAndSettings, perspectiveLifecycleAndSettings.getPerspectiveLifecycle().getLocalizedShortName(), new DialogCallback<PerspectiveCompositeSettings<PS>>() {
|
||||
@Override
|
||||
public void ok(PerspectiveCompositeSettings<PS> newSettings) {
|
||||
perspectiveLifecycleAndSettings.setAllSettings(newSettings);
|
||||
};
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void cancel() {
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setEvents(List<EventDTO> events) {
|
||||
this.events.clear();
|
||||
this.events.addAll(events);
|
||||
eventSelectionBox.addItem(StringMessages.INSTANCE.pleaseSelectAnEvent());
|
||||
for (EventDTO event : sortEvents(events)) {
|
||||
for(EventDTO event: sortEvents(events)) {
|
||||
eventSelectionBox.addItem(event.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort collection of events alphabetically
|
||||
*
|
||||
* @param events
|
||||
* - collection that is going to be sorted
|
||||
* Sort list of events alphabetically
|
||||
* @param events - collection that is going to be sorted
|
||||
* @return sorted list
|
||||
*/
|
||||
private List<EventDTO> sortEvents(Collection<EventDTO> events) {
|
||||
List<EventDTO> sortedEvents = new ArrayList<>(events);
|
||||
Collections.sort(sortedEvents, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int compare(EventDTO event1, EventDTO event2) {
|
||||
return new NaturalComparator().compare(event1.getName(), event2.getName());
|
||||
}
|
||||
});
|
||||
return sortedEvents;
|
||||
private List<EventDTO> sortEvents(List<EventDTO> events) {
|
||||
List<EventDTO> sortedEvents = new ArrayList<>(events);
|
||||
Collections.sort(sortedEvents, new NullSafeComparatorWrapper<EventDTO>(new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int compare(EventDTO event1, EventDTO event2) {
|
||||
return new NaturalComparator().compare(event1.getName(), event2.getName());
|
||||
}
|
||||
}));
|
||||
return sortedEvents;
|
||||
}
|
||||
|
||||
|
||||
@UiHandler("eventSelectionBox")
|
||||
void onEventSelectionChange(ChangeEvent event) {
|
||||
EventDTO selectedEvent = getSelectedEvent();
|
||||
if (selectedEvent != null) {
|
||||
if(selectedEvent != null) {
|
||||
leaderboardSelectionBox.clear();
|
||||
leaderboardSelectionBox.addItem(StringMessages.INSTANCE.selectALeaderboard());
|
||||
for (LeaderboardGroupDTO leaderboardGroup : selectedEvent.getLeaderboardGroups()) {
|
||||
for (StrippedLeaderboardDTO leaderboard : leaderboardGroup.getLeaderboards()) {
|
||||
for(LeaderboardGroupDTO leaderboardGroup: selectedEvent.getLeaderboardGroups()) {
|
||||
for(StrippedLeaderboardDTO leaderboard: leaderboardGroup.getLeaderboards()) {
|
||||
leaderboardSelectionBox.addItem(leaderboard.name);
|
||||
}
|
||||
}
|
||||
@@ -207,27 +184,25 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
@UiHandler("leaderboardSelectionBox")
|
||||
void onLeaderboardSelectionChange(ChangeEvent event) {
|
||||
String selectedLeaderboardName = getSelectedLeaderboardName();
|
||||
if (selectedLeaderboardName != null) {
|
||||
if(selectedLeaderboardName != null) {
|
||||
startAutoPlayButton.setEnabled(true);
|
||||
startAutoPlayButton.removeStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
|
||||
StrippedLeaderboardDTO selectedLeaderboard = getSelectedLeaderboard();
|
||||
this.updatePerspectives(selectedLeaderboard);
|
||||
|
||||
createPerspectiveSettingsUI(leaderboardPerspectiveLifecyclesAndSettings,
|
||||
leaderboardPerspectiveSettingsPanel);
|
||||
createPerspectiveSettingsUI(leaderboardPerspectiveLifecyclesAndSettings, leaderboardPerspectiveSettingsPanel);
|
||||
createPerspectiveSettingsUI(raceboardPerspectiveLifecyclesAndSettings, raceboardPerspectiveSettingsPanel);
|
||||
} else {
|
||||
startAutoPlayButton.setEnabled(false);
|
||||
startAutoPlayButton.addStyleName(SharedResources.INSTANCE.mainCss().buttoninactive());
|
||||
}
|
||||
screenConfigurationUi.getStyle()
|
||||
.setVisibility(selectedLeaderboardName != null ? Visibility.VISIBLE : Visibility.HIDDEN);
|
||||
screenConfigurationUi.getStyle().setVisibility(selectedLeaderboardName != null ? Visibility.VISIBLE : Visibility.HIDDEN);
|
||||
}
|
||||
|
||||
private <PL extends PerspectiveLifecycle<PS>, PS extends Settings> void createPerspectiveSettingsUI(
|
||||
final PerspectiveLifecycleWithAllSettings<PL, PS> perspectiveLifecycleWithAllSettings,
|
||||
FlowPanel perspectiveSettingsPanel) {
|
||||
final PerspectiveLifecycleWithAllSettings<PL,PS> perspectiveLifecycleWithAllSettings,
|
||||
FlowPanel perspectiveSettingsPanel) {
|
||||
perspectiveSettingsPanel.clear();
|
||||
|
||||
Button perspectiveSettingsButton = new Button(StringMessages.INSTANCE.settings());
|
||||
@@ -241,23 +216,22 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@UiHandler("localeSelectionBox")
|
||||
|
||||
@UiHandler("localeSelectionBox")
|
||||
void onLocaleSelectionChange(ChangeEvent event) {
|
||||
String selectedLocale = getSelectedLocale();
|
||||
LocaleChangeEvent localeChangeEvent = new LocaleChangeEvent(selectedLocale);
|
||||
eventBus.fireEvent(localeChangeEvent);
|
||||
}
|
||||
|
||||
|
||||
@UiHandler("startAutoPlayButton")
|
||||
void startAutoPlayClicked(ClickEvent event) {
|
||||
EventDTO selectedEvent = getSelectedEvent();
|
||||
String selectedLeaderboardName = getSelectedLeaderboardName();
|
||||
|
||||
if (selectedEvent != null && selectedLeaderboardName != null) {
|
||||
navigator.goToPlayer(
|
||||
new AutoPlayerConfiguration(selectedEvent.id.toString(), selectedLeaderboardName,
|
||||
startInFullscreenModeBox.getValue(), timeToRaceStartInSeconds.getValue()),
|
||||
|
||||
if(selectedEvent != null && selectedLeaderboardName != null) {
|
||||
navigator.goToPlayer(new AutoPlayerConfiguration(selectedEvent.id.toString(), selectedLeaderboardName,
|
||||
startInFullscreenModeBox.getValue(), timeToRaceStartInSeconds.getValue()),
|
||||
leaderboardPerspectiveLifecyclesAndSettings, raceboardPerspectiveLifecyclesAndSettings);
|
||||
}
|
||||
}
|
||||
@@ -302,10 +276,10 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
private EventDTO getSelectedEvent() {
|
||||
EventDTO result = null;
|
||||
int selectedIndex = eventSelectionBox.getSelectedIndex();
|
||||
if (events != null && selectedIndex > 0) {
|
||||
if(events != null && selectedIndex > 0) {
|
||||
String selectedItemText = eventSelectionBox.getItemText(selectedIndex);
|
||||
for (EventDTO event : events) {
|
||||
if (event.getName().equals(selectedItemText)) {
|
||||
for(EventDTO event: events) {
|
||||
if(event.getName().equals(selectedItemText)) {
|
||||
result = event;
|
||||
break;
|
||||
}
|
||||
|
||||
+26
-29
@@ -17,6 +17,7 @@ import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.CourseAreaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.util.NullSafeComparatorWrapper;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
|
||||
@@ -30,8 +31,7 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
protected final StringMessages stringMessages;
|
||||
protected final Collection<StrippedLeaderboardDTO> existingLeaderboards;
|
||||
|
||||
public LeaderboardParameterValidator(StringMessages stringConstants,
|
||||
Collection<StrippedLeaderboardDTO> existingLeaderboards) {
|
||||
public LeaderboardParameterValidator(StringMessages stringConstants, Collection<StrippedLeaderboardDTO> existingLeaderboards) {
|
||||
super();
|
||||
this.stringMessages = stringConstants;
|
||||
this.existingLeaderboards = existingLeaderboards;
|
||||
@@ -43,17 +43,16 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
boolean nonEmpty = leaderboardToValidate.getName() != null && leaderboardToValidate.getName().length() > 0;
|
||||
boolean unique = true;
|
||||
for (StrippedLeaderboardDTO dao : existingLeaderboards) {
|
||||
if (dao.name.equals(leaderboardToValidate.getName())) {
|
||||
if(dao.name.equals(leaderboardToValidate.getName())){
|
||||
unique = false;
|
||||
}
|
||||
}
|
||||
if (!nonEmpty) {
|
||||
errorMessage = stringMessages.pleaseEnterAName();
|
||||
} else if (!unique) {
|
||||
} else if(!unique){
|
||||
errorMessage = stringMessages.leaderboardWithThisNameAlreadyExists();
|
||||
} else {
|
||||
String discardThresholdErrorMessage = DiscardThresholdBoxes
|
||||
.getErrorMessage(leaderboardToValidate.getDiscardThresholds(), stringMessages);
|
||||
String discardThresholdErrorMessage = DiscardThresholdBoxes.getErrorMessage(leaderboardToValidate.getDiscardThresholds(), stringMessages);
|
||||
if (discardThresholdErrorMessage != null) {
|
||||
errorMessage = discardThresholdErrorMessage;
|
||||
} else {
|
||||
@@ -64,9 +63,9 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
}
|
||||
}
|
||||
|
||||
public FlexibleLeaderboardDialog(String title, LeaderboardDescriptor leaderboardDTO, StringMessages stringMessages,
|
||||
Collection<EventDTO> existingEvents, ErrorReporter errorReporter, LeaderboardParameterValidator validator,
|
||||
DialogCallback<LeaderboardDescriptor> callback) {
|
||||
public FlexibleLeaderboardDialog(String title, LeaderboardDescriptor leaderboardDTO, StringMessages stringMessages,
|
||||
Collection<EventDTO> existingEvents,
|
||||
ErrorReporter errorReporter, LeaderboardParameterValidator validator, DialogCallback<LeaderboardDescriptor> callback) {
|
||||
super(title, leaderboardDTO, stringMessages, validator, callback);
|
||||
this.existingEvents = existingEvents;
|
||||
courseAreaListBox = createListBox(false);
|
||||
@@ -94,11 +93,11 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
@Override
|
||||
protected Widget getAdditionalWidget() {
|
||||
FlowPanel mainPanel = new FlowPanel();
|
||||
Grid formGrid = new Grid(5, 3);
|
||||
Grid formGrid = new Grid(5,3);
|
||||
formGrid.setCellSpacing(3);
|
||||
formGrid.setWidget(0, 0, createLabel(stringMessages.name()));
|
||||
formGrid.setWidget(0, 0, createLabel(stringMessages.name()));
|
||||
formGrid.setWidget(0, 1, nameTextBox);
|
||||
formGrid.setWidget(1, 0, createLabel(stringMessages.displayName()));
|
||||
formGrid.setWidget(1, 0, createLabel(stringMessages.displayName()));
|
||||
formGrid.setWidget(1, 1, displayNameTextBox);
|
||||
formGrid.setWidget(2, 0, createLabel(stringMessages.scoringSystem()));
|
||||
formGrid.setWidget(2, 1, scoringSchemeListBox);
|
||||
@@ -115,7 +114,7 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
protected ListBox createSailingEventListBox() {
|
||||
ListBox eventListBox = createListBox(false);
|
||||
eventListBox.addItem("Please select a sailing event...");
|
||||
for (EventDTO event : sortEvents(existingEvents)) {
|
||||
for (EventDTO event: sortEvents(existingEvents)) {
|
||||
eventListBox.addItem(event.getName());
|
||||
}
|
||||
eventListBox.addChangeHandler(new ChangeHandler() {
|
||||
@@ -126,23 +125,21 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
});
|
||||
return eventListBox;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort collection of events alphabetically
|
||||
*
|
||||
* @param events
|
||||
* - collection that is going to be sorted
|
||||
* @param events - collection that is going to be sorted
|
||||
* @return sorted list
|
||||
*/
|
||||
private List<EventDTO> sortEvents(Collection<EventDTO> events) {
|
||||
List<EventDTO> sortedEvents = new ArrayList<>(events);
|
||||
Collections.sort(sortedEvents, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int compare(EventDTO event1, EventDTO event2) {
|
||||
return new NaturalComparator().compare(event1.getName(), event2.getName());
|
||||
}
|
||||
});
|
||||
return sortedEvents;
|
||||
List<EventDTO> sortedEvents = new ArrayList<>(events);
|
||||
Collections.sort(sortedEvents, new NullSafeComparatorWrapper<EventDTO>(new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int compare(EventDTO event1, EventDTO event2) {
|
||||
return new NaturalComparator().compare(event1.getName(), event2.getName());
|
||||
}
|
||||
}));
|
||||
return sortedEvents;
|
||||
}
|
||||
|
||||
protected void onEventSelectionChanged() {
|
||||
@@ -153,7 +150,7 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
fillCourseAreaListBox(selectedEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void fillCourseAreaListBox(EventDTO selectedEvent) {
|
||||
courseAreaListBox.addItem(stringMessages.pleaseSelectACourseArea());
|
||||
for (CourseAreaDTO courseArea : selectedEvent.venue.getCourseAreas()) {
|
||||
@@ -165,10 +162,10 @@ public abstract class FlexibleLeaderboardDialog extends AbstractLeaderboardDialo
|
||||
public EventDTO getSelectedEvent() {
|
||||
EventDTO result = null;
|
||||
int selIndex = sailingEventsListBox.getSelectedIndex();
|
||||
if (selIndex > 0) { // the zero index represents the 'no selection' text
|
||||
if(selIndex > 0) { // the zero index represents the 'no selection' text
|
||||
String itemText = sailingEventsListBox.getItemText(selIndex);
|
||||
for (EventDTO eventDTO : existingEvents) {
|
||||
if (eventDTO.getName().equals(itemText)) {
|
||||
for(EventDTO eventDTO: existingEvents) {
|
||||
if(eventDTO.getName().equals(itemText)) {
|
||||
result = eventDTO;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user