fixed several i18n issues around DeviceConfigurations in AdminConsole; use MarkedAsyncCallback in more places

Change-Id: Ifb0ba3fde55340595d3c87ed951d94d262e5ef48
This commit is contained in:
Axel Uhl committed 2016-01-30 11:35:43 +01:00
1 parent cf25ce90fa
commit cb3e6aa94e
8 files changed
+50 -16

No files matched your search

@@ -64,33 +64,35 @@ public class DeviceConfigurationCreateMatcherDialog extends DataEntryDialog<Devi
}
private ListBox typeBox;
private List<TextBox> devicesBoxes;
private final List<TextBox> devicesBoxes;
private final StringMessages stringMessages;
public DeviceConfigurationCreateMatcherDialog(StringMessages stringMessages,
Validator<DeviceConfigurationMatcherDTO> validator,
com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback<DeviceConfigurationMatcherDTO> callback) {
super("Create Device Configuration", "Specify for which devices the new configuration should apply",
"Create", stringMessages.cancel(), validator, callback);
super(stringMessages.createDeviceConfiguration(), stringMessages.forWhichDevicesShouldConfigurationApply(),
stringMessages.create(), stringMessages.cancel(), validator, callback);
this.devicesBoxes = new ArrayList<TextBox>();
this.stringMessages = stringMessages;
}
@Override
protected Widget getAdditionalWidget() {
final Grid valueGrid = new Grid(2, 2);
valueGrid.setWidget(0, 0, createLabel("Matcher type"));
valueGrid.setWidget(0, 0, createLabel(stringMessages.matcherType()));
typeBox = createListBox(false);
typeBox.addItem(DeviceConfigurationMatcherType.SINGLE.name());
typeBox.addItem(DeviceConfigurationMatcherType.MULTI.name());
valueGrid.setWidget(0, 1, typeBox);
valueGrid.setWidget(1, 0, createLabel("Matching devices"));
valueGrid.setWidget(1, 0, createLabel(stringMessages.matchingDevices()));
final Grid devicesGrid = new Grid(2, 2);
TextBox firstDeviceBox = createTextBox("");
devicesGrid.setWidget(0, 0, firstDeviceBox);
devicesBoxes.add(firstDeviceBox);
final Button addDeviceButton = new Button("Add Device");
final Button addDeviceButton = new Button(stringMessages.addDevice());
addDeviceButton.setVisible(false);
addDeviceButton.addClickHandler(new ClickHandler() {
@Override
@@ -30,6 +30,7 @@ import com.sap.sailing.gwt.ui.shared.DeviceConfigurationDTO.RegattaConfiguration
import com.sap.sailing.gwt.ui.shared.DeviceConfigurationMatcherDTO;
import com.sap.sse.gwt.client.ErrorReporter;
import com.sap.sse.gwt.client.IconResources;
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
import com.sap.sse.gwt.client.controls.listedit.ListEditorComposite;
import com.sap.sse.gwt.client.controls.listedit.StringListEditorComposite;
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
@@ -285,7 +286,7 @@ public class DeviceConfigurationDetailComposite extends Composite {
}
DeviceConfigurationDTO dto = getResult();
sailingService.createOrUpdateDeviceConfiguration(matcher, dto,
new AsyncCallback<DeviceConfigurationMatcherDTO>() {
new MarkedAsyncCallback<>(new AsyncCallback<DeviceConfigurationMatcherDTO>() {
@Override
public void onSuccess(DeviceConfigurationMatcherDTO matcher) {
markAsDirty(false);
@@ -295,7 +296,7 @@ public class DeviceConfigurationDetailComposite extends Composite {
public void onFailure(Throwable caught) {
errorReporter.reportError(caught.getMessage());
}
});
}));
}
private KeyUpHandler dirtyMarker = new KeyUpHandler() {
@@ -21,6 +21,7 @@ import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.DeviceConfigurationDTO;
import com.sap.sailing.gwt.ui.shared.DeviceConfigurationMatcherDTO;
import com.sap.sse.gwt.client.ErrorReporter;
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
@@ -136,7 +137,7 @@ public class DeviceConfigurationPanel extends SimplePanel implements DeviceConfi
}
private void createConfiguration(final DeviceConfigurationDTO configuration) {
sailingService.getDeviceConfigurationMatchers(new AsyncCallback<List<DeviceConfigurationMatcherDTO>>() {
sailingService.getDeviceConfigurationMatchers(new MarkedAsyncCallback<>(new AsyncCallback<List<DeviceConfigurationMatcherDTO>>() {
@Override
public void onSuccess(List<DeviceConfigurationMatcherDTO> allMatchers) {
createConfiguration(allMatchers, configuration);
@@ -146,7 +147,7 @@ public class DeviceConfigurationPanel extends SimplePanel implements DeviceConfi
public void onFailure(Throwable caught) {
errorReporter.reportError(caught.getMessage());
}
});
}));
}
private void createConfiguration(final List<DeviceConfigurationMatcherDTO> allMatchers, final DeviceConfigurationDTO configuration) {
@@ -156,7 +157,7 @@ public class DeviceConfigurationPanel extends SimplePanel implements DeviceConfi
@Override
public void ok(DeviceConfigurationMatcherDTO createdMatcher) {
sailingService.createOrUpdateDeviceConfiguration(createdMatcher, configuration,
new AsyncCallback<DeviceConfigurationMatcherDTO>() {
new MarkedAsyncCallback<>(new AsyncCallback<DeviceConfigurationMatcherDTO>() {
@Override
public void onSuccess(DeviceConfigurationMatcherDTO newMatcher) {
listComposite.refreshTable();
@@ -168,7 +169,7 @@ public class DeviceConfigurationPanel extends SimplePanel implements DeviceConfi
public void onFailure(Throwable caught) {
errorReporter.reportError(caught.getMessage());
}
});
}));
}
@Override
@@ -1466,4 +1466,10 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String confirmLosingCompetitorEditsWhenTogglingLogBasedView();
String removalOfMarkDisabledMayBeUsedInRaces(String raceNames);
String pleaseCreateAtLeastOneMappingBy();
String matcherType();
String matchingDevices();
String addDevice();
String createDeviceConfiguration();
String forWhichDevicesShouldConfigurationApply();
String create();
}
@@ -1432,4 +1432,10 @@ bufferLineStrokeWeight=Buffer line stroke weight
showOnlyCompetitorsOfLog=Show only competitors registered in Log
confirmLosingCompetitorEditsWhenTogglingLogBasedView=This will reset your current, unsaved changes to the competitors.\nDo you really want to continue?
removalOfMarkDisabledMayBeUsedInRaces=Removal deavticated, marks are used in races {0}
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
matcherType=Matcher type
matchingDevices=Matching devices
addDevice=Add Device
createDeviceConfiguration=Create Device Configuration
forWhichDevicesShouldConfigurationApply=Specify for which devices the new configuration should apply
create=Create
@@ -1423,4 +1423,10 @@ scoringSchemeHighPointFirstGetsTwelveOrEight=High-Point System 12 Punkte
scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Scores als Punkte. Der Gewinner bekommt 12 Punkte.
scoringSchemeHighPointEssOverall12=High Point System ESS Gesamtwertung (12)
scoringSchemeHighPointEssOverall12Description=High Point System, der Gewinner eines Acts erhält 12 Punkte, der Zweite 11 und so weiter.
pleaseCreateAtLeastOneMappingBy=Bitte erstellen Sie mindestens eine Zuordnung, indem Sie zunächst einen Track auf der linken Seite und anschließend einen Teilnehmer oder eine Tonne auf der rechten Seite auswählen
pleaseCreateAtLeastOneMappingBy=Bitte erstellen Sie mindestens eine Zuordnung, indem Sie zunächst einen Track auf der linken Seite und anschließend einen Teilnehmer oder eine Tonne auf der rechten Seite auswählen
matcherType=Matcher-Typ
matchingDevices=Passende Geräte
addDevice=Gerät hinzufügen
createDeviceConfiguration=Gerätekonfiguration anlegen
forWhichDevicesShouldConfigurationApply=Für welche Geräte soll die neue Konfiguration gelten?
create=Anlegen
@@ -1354,4 +1354,10 @@ scoringSchemeHighPointFirstGetsTwelveOrEight=High Point, winner gets 12 points (
scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored.
scoringSchemeHighPointEssOverall12=High Point System ESS Overall (12)
scoringSchemeHighPointEssOverall12Description=Score in points. Winner of an act scores 12 points, 2nd - 11 points, .... Any tie in the overall Extreme Sailing Series is broken in favour of the competitor with the most Act wins. If that does not break the tie, the result in the last Act will be used.
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
matcherType=Matcher type
matchingDevices=Matching devices
addDevice=Add Device
createDeviceConfiguration=Create Device Configuration
forWhichDevicesShouldConfigurationApply=Specify for which devices the new configuration should apply
create=Create
@@ -1369,4 +1369,10 @@ scoringSchemeHighPointFirstGetsTwelveOrEight=High Point, winner gets 12 points (
scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored.
scoringSchemeHighPointEssOverall12=High Point System ESS Overall (12)
scoringSchemeHighPointEssOverall12Description=Score in points. Winner of an act scores 12 points, 2nd - 11 points, .... Any tie in the overall Extreme Sailing Series is broken in favour of the competitor with the most Act wins. If that does not break the tie, the result in the last Act will be used.
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
pleaseCreateAtLeastOneMappingBy=Plase create at list one mapping by first selecting a track on the left hand side and then selecting a mark or competitor on the right hand side
matcherType=Matcher type
matchingDevices=Matching devices
addDevice=Add Device
createDeviceConfiguration=Create Device Configuration
forWhichDevicesShouldConfigurationApply=Specify for which devices the new configuration should apply
create=Create