mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-16 07:10:48 +00:00
using escape/enter key handling for SwissTiming connector dialogs
Change-Id: Ia5fd61c2cfa38326231205ffa380a593614745b4
This commit is contained in:
1 parent
ff7ee95654
commit
bfcbb9f2b7
6 files changed
+50
-103
No files matched your search
-2
@@ -74,8 +74,6 @@ public interface TracTracAdapter {
|
||||
* described above will be created and used.
|
||||
* @param offsetToStartTimeOfSimulatedRace
|
||||
* if non-<code>null</code>, the {@link Simulator} will be used with this duration as start offset
|
||||
* @param trackWind TODO
|
||||
* @param correctWindDirectionByMagneticDeclination TODO
|
||||
*/
|
||||
RaceHandle addTracTracRace(TrackerManager trackerManager, RegattaIdentifier regattaToAddTo, URL paramURL,
|
||||
URI liveURI, URI storedURI, URI courseDesignUpdateURI, TimePoint trackingStartTime,
|
||||
|
||||
-32
@@ -142,34 +142,26 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
});
|
||||
listRacesButton.setEnabled(false);
|
||||
removeButton.setEnabled(false);
|
||||
|
||||
connectionsTable.getSelectionModel().addSelectionChangeHandler(e -> {
|
||||
final boolean objectSelected = connectionsTable.getSelectionModel().getSelectedObject() != null;
|
||||
listRacesButton.setEnabled(objectSelected);
|
||||
removeButton.setEnabled(objectSelected);
|
||||
});
|
||||
|
||||
|
||||
HorizontalPanel racesSplitPanel = new HorizontalPanel();
|
||||
mainPanel.add(racesSplitPanel);
|
||||
|
||||
CaptionPanel trackableRacesCaptionPanel = new CaptionPanel(stringConstants.trackableRaces());
|
||||
racesSplitPanel.add(trackableRacesCaptionPanel);
|
||||
trackableRacesCaptionPanel.setWidth("50%");
|
||||
|
||||
CaptionPanel trackedRacesCaptionPanel = new CaptionPanel(stringConstants.trackedRaces());
|
||||
racesSplitPanel.add(trackedRacesCaptionPanel);
|
||||
trackedRacesCaptionPanel.setWidth("50%");
|
||||
|
||||
VerticalPanel trackableRacesPanel = new VerticalPanel();
|
||||
trackableRacesCaptionPanel.setContentWidget(trackableRacesPanel);
|
||||
trackableRacesCaptionPanel.setStyleName("bold");
|
||||
|
||||
VerticalPanel trackedRacesPanel = new VerticalPanel();
|
||||
trackedRacesPanel.setWidth("100%");
|
||||
trackedRacesCaptionPanel.setContentWidget(trackedRacesPanel);
|
||||
trackedRacesCaptionPanel.setStyleName("bold");
|
||||
|
||||
// Regatta selection
|
||||
HorizontalPanel regattaPanel = new HorizontalPanel();
|
||||
regattaPanel.setSpacing(5);
|
||||
@@ -178,39 +170,31 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
regattaPanel.add(regattaForTrackingLabel);
|
||||
regattaPanel.add(getAvailableRegattasListBox());
|
||||
trackableRacesPanel.add(regattaPanel);
|
||||
|
||||
Label lblTrackSettings = new Label(stringConstants.trackSettings());
|
||||
trackableRacesPanel.add(lblTrackSettings);
|
||||
|
||||
final CheckBox trackWindCheckbox = new CheckBox(stringConstants.trackWind());
|
||||
trackWindCheckbox.setWordWrap(false);
|
||||
trackWindCheckbox.setValue(true);
|
||||
trackableRacesPanel.add(trackWindCheckbox);
|
||||
|
||||
final CheckBox declinationCheckbox = new CheckBox(stringConstants.declinationCheckbox());
|
||||
declinationCheckbox.setWordWrap(false);
|
||||
declinationCheckbox.setValue(true);
|
||||
trackableRacesPanel.add(declinationCheckbox);
|
||||
|
||||
final CheckBox simulateWithStartTimeNow = new CheckBox(stringMessages.simulateAsLiveRace());
|
||||
simulateWithStartTimeNow.setWordWrap(false);
|
||||
simulateWithStartTimeNow.setValue(false);
|
||||
trackableRacesPanel.add(simulateWithStartTimeNow);
|
||||
|
||||
final CheckBox useInternalMarkPassingAlgorithmCheckbox = new CheckBox(stringMessages.useInternalAlgorithm());
|
||||
useInternalMarkPassingAlgorithmCheckbox.setWordWrap(false);
|
||||
useInternalMarkPassingAlgorithmCheckbox.setValue(Boolean.FALSE);
|
||||
trackableRacesPanel.add(useInternalMarkPassingAlgorithmCheckbox);
|
||||
|
||||
// text box for filtering the cell table
|
||||
HorizontalPanel filterPanel = new HorizontalPanel();
|
||||
filterPanel.setSpacing(5);
|
||||
trackableRacesPanel.add(filterPanel);
|
||||
|
||||
Label lblFilterEvents = new Label(stringConstants.filterRaces() + ":");
|
||||
filterPanel.add(lblFilterEvents);
|
||||
filterPanel.setCellVerticalAlignment(lblFilterEvents, HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
|
||||
raceTable = new FlushableCellTable<SwissTimingRaceRecordDTO>(/* pageSize */10000, tableRes);
|
||||
raceTable.setWidth("300px");
|
||||
raceList = new ListDataProvider<SwissTimingRaceRecordDTO>();
|
||||
@@ -236,7 +220,6 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
return raceTable;
|
||||
}
|
||||
};
|
||||
|
||||
final EntityIdentityComparator<SwissTimingRaceRecordDTO> entityIdentityComparator = new EntityIdentityComparator<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public boolean representSameEntity(SwissTimingRaceRecordDTO dto1, SwissTimingRaceRecordDTO dto2) {
|
||||
@@ -247,21 +230,18 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
return t.raceId.hashCode();
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> raceNameColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.getName();
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> regattaNameColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.regattaName;
|
||||
}
|
||||
};
|
||||
|
||||
SelectionCheckboxColumn<SwissTimingRaceRecordDTO> selectionColumn = new SelectionCheckboxColumn<SwissTimingRaceRecordDTO>(
|
||||
tableRes.cellTableStyle().cellTableCheckboxSelected(),
|
||||
tableRes.cellTableStyle().cellTableCheckboxDeselected(),
|
||||
@@ -273,42 +253,36 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
return object.seriesName;
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> raceIdColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.raceId;
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> boatClassColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.boatClass != null ? object.boatClass : "";
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> genderColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.gender != null ? object.gender : "";
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> raceStatusColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.raceStatus != null ? object.raceStatus : "";
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<SwissTimingRaceRecordDTO> raceStartTimeColumn = new TextColumn<SwissTimingRaceRecordDTO>() {
|
||||
@Override
|
||||
public String getValue(SwissTimingRaceRecordDTO object) {
|
||||
return object.raceStartTime==null?"":dateFormatter.render(object.raceStartTime) + " " + timeFormatter.render(object.raceStartTime);
|
||||
}
|
||||
};
|
||||
|
||||
raceNameColumn.setSortable(true);
|
||||
raceStartTimeColumn.setSortable(true);
|
||||
boatClassColumn.setSortable(true);
|
||||
@@ -317,8 +291,6 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
raceStatusColumn.setSortable(true);
|
||||
regattaNameColumn.setSortable(true);
|
||||
seriesNameColumn.setSortable(true);
|
||||
|
||||
|
||||
raceTable.addColumn(selectionColumn, selectionColumn.getHeader());
|
||||
raceTable.addColumn(regattaNameColumn, stringConstants.regatta());
|
||||
raceTable.addColumn(seriesNameColumn, stringConstants.series());
|
||||
@@ -328,20 +300,16 @@ public class SwissTimingEventManagementPanel extends AbstractEventManagementPane
|
||||
raceTable.addColumn(boatClassColumn, stringConstants.boatClass());
|
||||
raceTable.addColumn(genderColumn, stringConstants.gender());
|
||||
raceTable.addColumn(raceStartTimeColumn, stringConstants.startTime());
|
||||
|
||||
raceTable.setSelectionModel(selectionColumn.getSelectionModel(), selectionColumn.getSelectionManager());
|
||||
|
||||
trackableRacesPanel.add(raceTable);
|
||||
raceList.addDataDisplay(raceTable);
|
||||
Handler columnSortHandler = getRaceTableColumnSortHandler(raceList.getList(), regattaNameColumn, seriesNameColumn,
|
||||
raceNameColumn, raceStartTimeColumn, raceIdColumn, boatClassColumn, genderColumn, raceStatusColumn);
|
||||
raceTable.addColumnSortHandler(columnSortHandler);
|
||||
|
||||
trackedRacesPanel.add(trackedRacesListComposite);
|
||||
filterPanel.add(filterablePanelEvents);
|
||||
HorizontalPanel racesButtonPanel = new HorizontalPanel();
|
||||
trackableRacesPanel.add(racesButtonPanel);
|
||||
|
||||
Button btnTrack = new Button(stringConstants.startTracking());
|
||||
racesButtonPanel.add(btnTrack);
|
||||
racesButtonPanel.setSpacing(10);
|
||||
|
||||
-5
@@ -250,10 +250,8 @@ public class SwissTimingReplayConnectorPanel extends AbstractEventManagementPane
|
||||
UserService userService, ErrorReporter errorReporter, StringMessages stringMessages) {
|
||||
final AccessControlledButtonPanel buttonPanel = new AccessControlledButtonPanel(userService,
|
||||
SecuredDomainType.SWISS_TIMING_ARCHIVE_ACCOUNT);
|
||||
|
||||
// Refresh action
|
||||
buttonPanel.addUnsecuredAction(stringMessages.refresh(), () -> connectionsTable.refreshConnectionList());
|
||||
|
||||
// Create action
|
||||
buttonPanel.addCreateAction(stringMessages.addSwissTimingAchivedConnection(),
|
||||
() -> new EditSwissTimingArchivedConnectionDialog(new SwissTimingArchiveConfigurationWithSecurityDTO(),
|
||||
@@ -280,7 +278,6 @@ public class SwissTimingReplayConnectorPanel extends AbstractEventManagementPane
|
||||
public void cancel() {
|
||||
}
|
||||
}, userService, errorReporter).show());
|
||||
|
||||
// Remove action
|
||||
final Button removeButton = buttonPanel.addRemoveAction(stringMessages.remove(), () -> {
|
||||
sailingService.deleteSwissTimingArchiveConfiguration(
|
||||
@@ -297,14 +294,12 @@ public class SwissTimingReplayConnectorPanel extends AbstractEventManagementPane
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// List Race action
|
||||
final Button listRacesButton = buttonPanel.addUnsecuredAction(stringMessages.listRaces(), () -> {
|
||||
fillRaces(sailingService);
|
||||
});
|
||||
listRacesButton.setEnabled(false);
|
||||
removeButton.setEnabled(false);
|
||||
|
||||
// add change handlers to enable and disable List Races and Remove
|
||||
connectionsTable.getSelectionModel().addSelectionChangeHandler(e -> {
|
||||
final boolean objectSelected = connectionsTable.getSelectionModel().getSelectedObject() != null;
|
||||
|
||||
+16
-9
@@ -23,6 +23,19 @@ public class EditSwissTimingArchivedConnectionDialog
|
||||
private TextBox jsonURLTextBox;
|
||||
private final SwissTimingArchiveConfigurationWithSecurityDTO dtoToEdit;
|
||||
|
||||
private static class EmptyTextValidator implements Validator<SwissTimingArchiveConfigurationWithSecurityDTO> {
|
||||
@Override
|
||||
public String getErrorMessage(SwissTimingArchiveConfigurationWithSecurityDTO valueToValidate) {
|
||||
final String result;
|
||||
if (valueToValidate.getJsonUrl() == null || valueToValidate.getJsonUrl().trim().isEmpty()) {
|
||||
result = stringMessages.pleaseEnterNonEmptyUrl();
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The class creates the UI-dialog to type in the Data about a the selected swiss timing account.
|
||||
*
|
||||
@@ -34,7 +47,7 @@ public class EditSwissTimingArchivedConnectionDialog
|
||||
final UserService userService,
|
||||
final ErrorReporter errorReporter) {
|
||||
super(stringMessages.editSwissTimingAchivedConnection(), null, stringMessages.ok(), stringMessages.cancel(),
|
||||
/* validator */ null, /* animationEnabled */true, callback);
|
||||
/* validator */ new EmptyTextValidator(), /* animationEnabled */true, callback);
|
||||
this.dtoToEdit = dtoToEdit;
|
||||
this.ensureDebugId("EditSwissTimingArchivedConnectionDialog");
|
||||
createUi();
|
||||
@@ -43,24 +56,18 @@ public class EditSwissTimingArchivedConnectionDialog
|
||||
|
||||
private void setData(final SwissTimingArchiveConfigurationWithSecurityDTO dtotoEdit) {
|
||||
jsonURLTextBox.setText(dtotoEdit.getJsonUrl());
|
||||
super.getOkButton().setEnabled(!jsonURLTextBox.getText().isEmpty());
|
||||
validateAndUpdate();
|
||||
}
|
||||
|
||||
private void createUi() {
|
||||
|
||||
grid = new Grid(2, 2);
|
||||
grid.setWidget(0, 0, new Label(stringMessages.details() + ":"));
|
||||
|
||||
// JSON URL
|
||||
Label jsonURLLabel = new Label(stringMessages.jsonUrl() + ":");
|
||||
|
||||
jsonURLTextBox = new TextBox();
|
||||
jsonURLTextBox = createTextBox("");
|
||||
jsonURLTextBox.ensureDebugId("JsonURLTextBox");
|
||||
jsonURLTextBox.setVisibleLength(100);
|
||||
|
||||
// validation: User should not create empty connections
|
||||
jsonURLTextBox.addKeyUpHandler(e -> super.getOkButton().setEnabled(!jsonURLTextBox.getText().isEmpty()));
|
||||
|
||||
grid.setWidget(1, 0, jsonURLLabel);
|
||||
grid.setWidget(1, 1, jsonURLTextBox);
|
||||
}
|
||||
|
||||
+25
-55
@@ -14,7 +14,8 @@ import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
/**
|
||||
* Edits a {@link SwissTimingConfigurationWithSecurityDTO} object. Can be accessed from
|
||||
* {@link SwissTimingConnectionTableWrapper}
|
||||
* {@link SwissTimingConnectionTableWrapper}. The Manage2Sail event ID and the complete URL
|
||||
* field update each other mutually upon manual update.
|
||||
*/
|
||||
public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTimingConfigurationWithSecurityDTO> {
|
||||
private static final StringMessages stringMessages = StringMessages.INSTANCE;
|
||||
@@ -29,6 +30,19 @@ public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTiming
|
||||
private TextBox updateUsernameTextBox;
|
||||
private PasswordTextBox updatePasswordTextBox;
|
||||
private final SwissTimingConfigurationWithSecurityDTO dtoToEdit;
|
||||
|
||||
private static class EmptyFieldValidator implements Validator<SwissTimingConfigurationWithSecurityDTO> {
|
||||
@Override
|
||||
public String getErrorMessage(SwissTimingConfigurationWithSecurityDTO valueToValidate) {
|
||||
final String result;
|
||||
if (valueToValidate.getJsonUrl() == null || valueToValidate.getJsonUrl().trim().isEmpty()) {
|
||||
result = stringMessages.pleaseEnterNonEmptyUrl();
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The class creates the UI-dialog to type in the Data about a the selected swiss timing account.
|
||||
@@ -40,7 +54,7 @@ public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTiming
|
||||
final DialogCallback<SwissTimingConfigurationWithSecurityDTO> callback, final UserService userService,
|
||||
final ErrorReporter errorReporter) {
|
||||
super(stringMessages.editSwissTimingConnections(), null, stringMessages.ok(), stringMessages.cancel(),
|
||||
/* validator */ null,
|
||||
/* validator */ new EmptyFieldValidator(),
|
||||
/* animationEnabled */true, callback);
|
||||
this.dtoToEdit = dtotoEdit;
|
||||
this.ensureDebugId("EditTracTracConnectionDialog");
|
||||
@@ -55,122 +69,79 @@ public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTiming
|
||||
updateUrlTextBox.setText(dtoToEdit.getUpdateURL());
|
||||
updateUsernameTextBox.setText(dtoToEdit.getUpdateUsername());
|
||||
updatePasswordTextBox.setText(dtoToEdit.getUpdatePassword());
|
||||
super.getOkButton().setEnabled(!manage2SailEventUrlJsonTextBox.getText().isEmpty());
|
||||
|
||||
updateEventIdFromUrl(dtoToEdit.getJsonUrl());
|
||||
validateAndUpdate();
|
||||
}
|
||||
|
||||
private void createUi() {
|
||||
|
||||
grid = new Grid(8, 2);
|
||||
grid.setWidget(0, 0, new Label(stringMessages.details() + ":"));
|
||||
|
||||
// Manage2SailEventId
|
||||
final Label manage2SailEventIdLabel = new Label(stringMessages.manage2SailEventIdBox() + ":");
|
||||
manage2SailEventIdLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
manage2SailEventIdTextBox = new TextBox();
|
||||
manage2SailEventIdTextBox = createTextBox("");
|
||||
manage2SailEventIdTextBox.ensureDebugId("Manage2SailEventIdTextBox");
|
||||
manage2SailEventIdTextBox.setVisibleLength(40);
|
||||
manage2SailEventIdTextBox.setTitle(stringMessages.manage2SailEventIdBox());
|
||||
|
||||
// update url with changed event id
|
||||
manage2SailEventIdTextBox.addKeyUpHandler(e -> updateUrlFromEventId(manage2SailEventIdTextBox.getText()));
|
||||
|
||||
grid.setWidget(1, 0, manage2SailEventIdLabel);
|
||||
grid.setWidget(1, 1, manage2SailEventIdTextBox);
|
||||
|
||||
// Manage2SailEventUrl
|
||||
final Label manage2SailEventUrlJsonLabel = new Label(stringMessages.manage2SailEventURLBox() + ":");
|
||||
manage2SailEventUrlJsonLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
manage2SailEventUrlJsonTextBox = new TextBox();
|
||||
manage2SailEventUrlJsonTextBox = createTextBox("");
|
||||
manage2SailEventUrlJsonTextBox.ensureDebugId("Manage2SailEventUrlJsonTextBox");
|
||||
manage2SailEventUrlJsonTextBox.setVisibleLength(40);
|
||||
manage2SailEventUrlJsonTextBox.setTitle(stringMessages.manage2SailEventURLBox());
|
||||
|
||||
grid.setWidget(2, 0, manage2SailEventUrlJsonLabel);
|
||||
grid.setWidget(2, 1, manage2SailEventUrlJsonTextBox);
|
||||
|
||||
// validation: User should not create empty connections + update event id from changed url
|
||||
manage2SailEventUrlJsonTextBox.addKeyUpHandler(
|
||||
e -> {
|
||||
super.getOkButton().setEnabled(!manage2SailEventUrlJsonTextBox.getText().isEmpty());
|
||||
updateEventIdFromUrl(manage2SailEventUrlJsonTextBox.getText());
|
||||
});
|
||||
// Hostname
|
||||
final Label hostnameLabel = new Label(stringMessages.hostname() + ":");
|
||||
manage2SailEventUrlJsonLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
hostnameTextBox = new TextBox();
|
||||
hostnameTextBox = createTextBox("");
|
||||
hostnameTextBox.ensureDebugId("HostnameTextBox");
|
||||
hostnameTextBox.setVisibleLength(40);
|
||||
hostnameTextBox.setTitle(stringMessages.hostname());
|
||||
|
||||
grid.setWidget(3, 0, hostnameLabel);
|
||||
grid.setWidget(3, 1, hostnameTextBox);
|
||||
|
||||
// Port
|
||||
final Label portLabel = new Label(stringMessages.manage2SailPort() + ":");
|
||||
portLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
portTextBox = new TextBox();
|
||||
portTextBox = createTextBox("");
|
||||
portTextBox.ensureDebugId("PortTextBox");
|
||||
portTextBox.setVisibleLength(40);
|
||||
portTextBox.setTitle(stringMessages.manage2SailPort());
|
||||
|
||||
grid.setWidget(4, 0, portLabel);
|
||||
grid.setWidget(4, 1, portTextBox);
|
||||
|
||||
// Update URL
|
||||
final Label updateUrlLabel = new Label(stringMessages.swissTimingUpdateURL() + ":");
|
||||
updateUrlLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
updateUrlTextBox = new TextBox();
|
||||
updateUrlTextBox = createTextBox("");
|
||||
updateUrlTextBox.ensureDebugId("UpdateUrlTextBox");
|
||||
updateUrlTextBox.setVisibleLength(40);
|
||||
updateUrlTextBox.setTitle(stringMessages.swissTimingUpdateURL());
|
||||
|
||||
grid.setWidget(5, 0, updateUrlLabel);
|
||||
grid.setWidget(5, 1, updateUrlTextBox);
|
||||
|
||||
// Update Username
|
||||
final Label updateUsernameLabel = new Label(stringMessages.swissTimingUpdateUsername() + ":");
|
||||
updateUsernameLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
updateUsernameTextBox = new TextBox();
|
||||
updateUsernameTextBox = createTextBox("");
|
||||
updateUsernameTextBox.ensureDebugId("UpdateUsernameTextBox");
|
||||
updateUsernameTextBox.setVisibleLength(40);
|
||||
updateUsernameTextBox.setTitle(stringMessages.swissTimingUpdateUsername());
|
||||
|
||||
grid.setWidget(6, 0, updateUsernameLabel);
|
||||
grid.setWidget(6, 1, updateUsernameTextBox);
|
||||
|
||||
// Update Password
|
||||
final Label updatePasswordLabel = new Label(stringMessages.swissTimingUpdatePassword() + ":");
|
||||
updatePasswordLabel.setTitle(stringMessages.leaveEmptyForDefault());
|
||||
|
||||
updatePasswordTextBox = new PasswordTextBox();
|
||||
updatePasswordTextBox = createPasswordTextBox("");
|
||||
updatePasswordTextBox.ensureDebugId("UpdatePasswordTextBox");
|
||||
updatePasswordTextBox.setVisibleLength(40);
|
||||
updatePasswordTextBox.setTitle(stringMessages.swissTimingUpdatePassword());
|
||||
|
||||
grid.setWidget(7, 0, updatePasswordLabel);
|
||||
grid.setWidget(7, 1, updatePasswordTextBox);
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to {@link #updateUrlFromEventId} this function tries to extract a M2S event Id by looking at the given
|
||||
* url in the Json Url Textbox. The value of {@link eventIdBox} is then set to the event ID inferred from the Json
|
||||
* Url.
|
||||
*/
|
||||
private void updateEventIdFromUrl(String eventUrl) {
|
||||
final String result = SwissTimingEventIdUrlUtil.getEventIdFromUrl(eventUrl);
|
||||
if (result != null) {
|
||||
manage2SailEventIdTextBox.setValue(result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function tries to infer a valid JsonUrl for any input given that matches the pattern of an event Id from
|
||||
* M2S. If there is an event id detected the Json Url gets updated and the event Id textbox is filled with the
|
||||
@@ -179,7 +150,7 @@ public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTiming
|
||||
private void updateUrlFromEventId(String eventIdText) {
|
||||
final String result = SwissTimingEventIdUrlUtil.getUrlFromEventId(eventIdText);
|
||||
if (result != null) {
|
||||
manage2SailEventUrlJsonTextBox.setValue(result);
|
||||
manage2SailEventUrlJsonTextBox.setValue(result, /* fire events */ false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,5 +180,4 @@ public class EditSwissTimingConnectionDialog extends DataEntryDialog<SwissTiming
|
||||
protected Widget getAdditionalWidget() {
|
||||
return grid;
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -9,6 +9,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.shiro.authz.AuthorizationException;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
@@ -1041,6 +1043,13 @@ public interface SailingServiceAsync extends FileStorageManagementGwtServiceAsyn
|
||||
void getAvailableDetailTypesForLeaderboard(String leaderboardName, RegattaAndRaceIdentifier raceOrNull,
|
||||
AsyncCallback<Iterable<DetailType>> asyncCallback);
|
||||
|
||||
/**
|
||||
* Checks whether the user may cut the race identified by {@code radeIdentifier} into multiple races. For this, it
|
||||
* has to be found and it has to be a "smartphone-tracked" race with a valid start-of-tracking time. If not,
|
||||
* {@code false} will be returned. If the user it not <em>permitted</em> to slice the race, e.g., because no
|
||||
* permission has been granted to modify the leaderboard or regatta, an {@link AuthorizationException} will be
|
||||
* thrown.
|
||||
*/
|
||||
void canSliceRace(RegattaAndRaceIdentifier raceIdentifier, AsyncCallback<Boolean> callback);
|
||||
|
||||
void sliceRace(RegattaAndRaceIdentifier raceIdentifier, String newRaceColumnName, TimePoint sliceFrom, TimePoint sliceTo,
|
||||
|
||||
Reference in new issue
Block a user