mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
Merge branch 'bug2970'
This commit is contained in:
commit
a6e0abdc9f
8 files changed
+100
-72
No files matched your search
@@ -1,47 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
@@ -216,7 +216,7 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
}
|
||||
|
||||
public static String getDefaultName(String baseName, String boatClassName) {
|
||||
return baseName+(boatClassName==null?"":" ("+boatClassName+")");
|
||||
return baseName+(boatClassName==null?"":" ("+boatClassName+")").replace('/', '_');
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+31
@@ -3,6 +3,9 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.dom.client.NodeList;
|
||||
import com.google.gwt.dom.client.OptionElement;
|
||||
import com.google.gwt.dom.client.SelectElement;
|
||||
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||
import com.google.gwt.user.client.ui.CheckBox;
|
||||
@@ -11,9 +14,11 @@ import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.ListBox;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.gwt.ui.client.DataEntryDialogWithBootstrap;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.RankingMetricTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.ScoringSchemeTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.shared.BetterDateTimeBox;
|
||||
import com.sap.sailing.gwt.ui.shared.CourseAreaDTO;
|
||||
@@ -43,6 +48,7 @@ public abstract class AbstractRegattaWithSeriesAndFleetsDialog<T> extends DataEn
|
||||
protected final ListBox sailingEventsListBox;
|
||||
protected final CheckBox useStartTimeInferenceCheckBox;
|
||||
private final ListEditorComposite<SeriesDTO> seriesEditor;
|
||||
private final ListBox rankingMetricListBox;
|
||||
|
||||
protected final List<EventDTO> existingEvents;
|
||||
|
||||
@@ -52,6 +58,13 @@ public abstract class AbstractRegattaWithSeriesAndFleetsDialog<T> extends DataEn
|
||||
this.stringMessages = stringMessages;
|
||||
this.regatta = regatta;
|
||||
this.existingEvents = existingEvents;
|
||||
rankingMetricListBox = createListBox(/* isMultipleSelect */ false);
|
||||
for (RankingMetrics rankingMetricType : RankingMetrics.values()) {
|
||||
rankingMetricListBox.addItem(RankingMetricTypeFormatter.format(rankingMetricType, stringMessages), rankingMetricType.name());
|
||||
final SelectElement selectElement = rankingMetricListBox.getElement().cast();
|
||||
final NodeList<OptionElement> options = selectElement.getOptions();
|
||||
options.getItem(options.getLength()-1).setTitle(RankingMetricTypeFormatter.getDescription(rankingMetricType, stringMessages));
|
||||
}
|
||||
startDateBox = createDateTimeBox(regatta.startDate);
|
||||
startDateBox.setFormat("dd/mm/yyyy hh:ii");
|
||||
endDateBox = createDateTimeBox(regatta.endDate);
|
||||
@@ -78,6 +91,24 @@ public abstract class AbstractRegattaWithSeriesAndFleetsDialog<T> extends DataEn
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses that want to display a list box for the ranking metric can use this method to create a tab
|
||||
* panel that can be inserted into the grid panel in the {@link #setupAdditionalWidgetsOnPanel(VerticalPanel, Grid)} method.
|
||||
*/
|
||||
protected void insertRankingMetricTabPanel(Grid formGrid) {
|
||||
int gridRow = formGrid.insertRow(formGrid.getRowCount());
|
||||
formGrid.setWidget(gridRow, 0, new Label(stringMessages.rankingMetric()));
|
||||
formGrid.setWidget(gridRow, 1, rankingMetricListBox);
|
||||
}
|
||||
|
||||
protected void setRankingMetrics(RegattaDTO dto) {
|
||||
dto.rankingMetricType = RankingMetrics.valueOf(getRankingMetricListBox().getValue(getRankingMetricListBox().getSelectedIndex()));
|
||||
}
|
||||
|
||||
protected ListBox getRankingMetricListBox() {
|
||||
return rankingMetricListBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param panel
|
||||
* the panel holding dialog elements
|
||||
* @param formGrid
|
||||
|
||||
+9
-2
@@ -16,7 +16,6 @@ import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.controls.listedit.ListEditorComposite;
|
||||
|
||||
public class DefaultRegattaCreateDialog extends AbstractRegattaWithSeriesAndFleetsDialog<EventAndRegattaDTO> {
|
||||
|
||||
public DefaultRegattaCreateDialog(List<EventDTO> existingEvents, RegattaDTO selectedRegatta,
|
||||
SailingServiceAsync sailingService, ErrorReporter errorReporter, StringMessages stringMessages,
|
||||
com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback<EventAndRegattaDTO> callback) {
|
||||
@@ -30,6 +29,11 @@ public class DefaultRegattaCreateDialog extends AbstractRegattaWithSeriesAndFlee
|
||||
sailingEventsListBox.setSelectedIndex(1);
|
||||
sailingEventsListBox.setEnabled(false);
|
||||
setCourseAreaSelection();
|
||||
for (int i=0; i<getRankingMetricListBox().getItemCount(); i++) {
|
||||
if (getRankingMetricListBox().getValue(i).equals(selectedRegatta.rankingMetricType.name())) {
|
||||
getRankingMetricListBox().setSelectedIndex(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ListEditorComposite<SeriesDTO> createSeriesEditor(Iterable<SeriesDTO> series) {
|
||||
@@ -37,6 +41,7 @@ public class DefaultRegattaCreateDialog extends AbstractRegattaWithSeriesAndFlee
|
||||
}
|
||||
|
||||
protected void setupAdditionalWidgetsOnPanel(final VerticalPanel panel, Grid formGrid) {
|
||||
insertRankingMetricTabPanel(formGrid);
|
||||
TabPanel tabPanel = new TabPanel();
|
||||
tabPanel.setWidth("100%");
|
||||
tabPanel.add(getSeriesEditor(), stringMessages.series());
|
||||
@@ -46,7 +51,9 @@ public class DefaultRegattaCreateDialog extends AbstractRegattaWithSeriesAndFlee
|
||||
|
||||
@Override
|
||||
protected EventAndRegattaDTO getResult() {
|
||||
EventAndRegattaDTO eventAndRegatta = new EventAndRegattaDTO(getSelectedEvent(), getRegattaDTO());
|
||||
final RegattaDTO regattaDTO = getRegattaDTO();
|
||||
EventAndRegattaDTO eventAndRegatta = new EventAndRegattaDTO(getSelectedEvent(), regattaDTO);
|
||||
setRankingMetrics(regattaDTO);
|
||||
return eventAndRegatta;
|
||||
}
|
||||
}
|
||||
+6
@@ -6,6 +6,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.SeriesDTO;
|
||||
@@ -27,6 +28,7 @@ import com.sap.sailing.gwt.ui.shared.SeriesDTO;
|
||||
class RegattaStructure {
|
||||
private final Iterable<String> seriesNamesInOrder;
|
||||
private final Map<String, LinkedHashSet<String>> seriesNamesToFleetNames;
|
||||
private final RankingMetrics rankingMetricType;
|
||||
|
||||
public RegattaStructure(RegattaDTO regatta) {
|
||||
seriesNamesToFleetNames = new HashMap<>();
|
||||
@@ -40,6 +42,7 @@ class RegattaStructure {
|
||||
fleetNames.add(fleet.getName());
|
||||
}
|
||||
}
|
||||
this.rankingMetricType = regatta.rankingMetricType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,6 +65,7 @@ class RegattaStructure {
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((rankingMetricType == null) ? 0 : rankingMetricType.hashCode());
|
||||
result = prime * result + ((seriesNamesInOrder == null) ? 0 : seriesNamesInOrder.hashCode());
|
||||
result = prime * result + ((seriesNamesToFleetNames == null) ? 0 : seriesNamesToFleetNames.hashCode());
|
||||
return result;
|
||||
@@ -76,6 +80,8 @@ class RegattaStructure {
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
RegattaStructure other = (RegattaStructure) obj;
|
||||
if (rankingMetricType != other.rankingMetricType)
|
||||
return false;
|
||||
if (seriesNamesInOrder == null) {
|
||||
if (other.seriesNamesInOrder != null)
|
||||
return false;
|
||||
|
||||
+3
-21
@@ -8,17 +8,10 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.dom.client.NodeList;
|
||||
import com.google.gwt.dom.client.OptionElement;
|
||||
import com.google.gwt.dom.client.SelectElement;
|
||||
import com.google.gwt.user.client.ui.Grid;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.ListBox;
|
||||
import com.google.gwt.user.client.ui.TabPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.RankingMetricTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.SeriesDTO;
|
||||
@@ -26,8 +19,6 @@ import com.sap.sailing.gwt.ui.shared.SeriesDTO;
|
||||
public class RegattaWithSeriesAndFleetsCreateDialog extends RegattaWithSeriesAndFleetsDialog {
|
||||
protected static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
private final ListBox rankingMetricListBox;
|
||||
|
||||
protected static class RegattaParameterValidator implements Validator<RegattaDTO> {
|
||||
private StringMessages stringMessages;
|
||||
private ArrayList<RegattaDTO> existingRegattas;
|
||||
@@ -112,13 +103,6 @@ public class RegattaWithSeriesAndFleetsCreateDialog extends RegattaWithSeriesAnd
|
||||
List<EventDTO> existingEvents, StringMessages stringMessages, DialogCallback<RegattaDTO> callback) {
|
||||
super(new RegattaDTO(), Collections.<SeriesDTO>emptySet(), existingEvents, stringMessages.addRegatta(), stringMessages.ok(),
|
||||
stringMessages, new RegattaParameterValidator(stringMessages, existingRegattas), callback);
|
||||
rankingMetricListBox = createListBox(/* isMultipleSelect */ false);
|
||||
for (RankingMetrics rankingMetricType : RankingMetrics.values()) {
|
||||
rankingMetricListBox.addItem(RankingMetricTypeFormatter.format(rankingMetricType, stringMessages), rankingMetricType.name());
|
||||
final SelectElement selectElement = rankingMetricListBox.getElement().cast();
|
||||
final NodeList<OptionElement> options = selectElement.getOptions();
|
||||
options.getItem(options.getLength()-1).setTitle(RankingMetricTypeFormatter.getDescription(rankingMetricType, stringMessages));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,10 +113,8 @@ public class RegattaWithSeriesAndFleetsCreateDialog extends RegattaWithSeriesAnd
|
||||
@Override
|
||||
protected void setupAdditionalWidgetsOnPanel(final VerticalPanel panel, Grid formGrid) {
|
||||
super.setupAdditionalWidgetsOnPanel(panel, formGrid);
|
||||
int gridRow = formGrid.insertRow(formGrid.getRowCount());
|
||||
formGrid.setWidget(gridRow, 0, new Label(stringMessages.rankingMetric()));
|
||||
formGrid.setWidget(gridRow, 1, rankingMetricListBox);
|
||||
TabPanel tabPanel = new TabPanel();
|
||||
insertRankingMetricTabPanel(formGrid);
|
||||
final TabPanel tabPanel = new TabPanel();
|
||||
tabPanel.setWidth("100%");
|
||||
tabPanel.add(getSeriesEditor(), stringMessages.series());
|
||||
tabPanel.selectTab(0);
|
||||
@@ -148,7 +130,7 @@ public class RegattaWithSeriesAndFleetsCreateDialog extends RegattaWithSeriesAnd
|
||||
@Override
|
||||
protected RegattaDTO getResult() {
|
||||
RegattaDTO dto = super.getResult();
|
||||
dto.rankingMetricType = RankingMetrics.valueOf(rankingMetricListBox.getValue(rankingMetricListBox.getSelectedIndex()));
|
||||
setRankingMetrics(dto);
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -30,6 +30,7 @@ import com.google.gwt.user.client.ui.TextBox;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.dto.BoatClassDTO;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.StructureImportListComposite.RegattaStructureProvider;
|
||||
@@ -324,6 +325,7 @@ public class StructureImportManagementPanel extends FlowPanel implements Regatta
|
||||
RegattaDTO result = new RegattaDTO("Default", ScoringSchemeType.LOW_POINT);
|
||||
result.boatClass = new BoatClassDTO(BoatClassDTO.DEFAULT_NAME, /* hull length in meters */ 5);
|
||||
result.series = regatta.series;
|
||||
result.rankingMetricType = RankingMetrics.ONE_DESIGN;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class TestLeaderboardEditing extends AbstractSeleniumTest {
|
||||
private static final TrackableRaceDescriptor TRACKABLE_RACE = new TrackableRaceDescriptor(
|
||||
BMW_CUP_REGATTA, BMW_CUP_RACE_8, BMW_CUP_BOAT_CLASS);
|
||||
private static final TrackedRaceDescriptor TRACKED_RACE = new TrackedRaceDescriptor(
|
||||
BMW_CUP_REGATTA + " (" + BMW_CUP_BOAT_CLASS + ")", BMW_CUP_BOAT_CLASS, BMW_CUP_RACE_8);
|
||||
(BMW_CUP_REGATTA + " (" + BMW_CUP_BOAT_CLASS + ")").replace('/', '_'), BMW_CUP_BOAT_CLASS, BMW_CUP_RACE_8);
|
||||
private static final RaceDescriptor RACE_COLUMN = new RaceDescriptor("R1", "Default", false, false, 0.0);
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user