mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-09 20:41:10 +00:00
added competitor table refresh after linking a boat to a competitor
Change-Id: I324aff23f9de15ade47f7857f41c4ce088e40720
This commit is contained in:
1 parent
28b787298a
commit
845650806d
2 files changed
+1
-15
No files matched your search
-7
@@ -42,7 +42,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
}
|
||||
});
|
||||
ListHandler<BoatDTO> boatColumnListHandler = getColumnSortHandler();
|
||||
|
||||
// boats table
|
||||
TextColumn<BoatDTO> boatNameColumn = new TextColumn<BoatDTO>() {
|
||||
@Override
|
||||
@@ -58,7 +57,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
return comparator.compare(o1.getName(), o2.getName());
|
||||
}
|
||||
});
|
||||
|
||||
TextColumn<BoatDTO> boatClassColumn = new TextColumn<BoatDTO>() {
|
||||
@Override
|
||||
public String getValue(BoatDTO competitor) {
|
||||
@@ -73,7 +71,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
return comparator.compare(o1.getBoatClass().getName(), o2.getBoatClass().getName());
|
||||
}
|
||||
});
|
||||
|
||||
Column<BoatDTO, SafeHtml> sailIdColumn = new Column<BoatDTO, SafeHtml>(new SafeHtmlCell()) {
|
||||
@Override
|
||||
public SafeHtml getValue(BoatDTO competitor) {
|
||||
@@ -90,7 +87,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
return comparator.compare(o1.getSailId(), o2.getSailId());
|
||||
}
|
||||
});
|
||||
|
||||
Column<BoatDTO, SafeHtml> boatColorColumn = new ColorColumn<>(new ColorRetriever<BoatDTO>() {
|
||||
@Override
|
||||
public Color getColor(BoatDTO t) {
|
||||
@@ -112,7 +108,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
return o1.getColor().getAsHtml().compareTo(o2.getColor().getAsHtml());
|
||||
}
|
||||
});
|
||||
|
||||
Column<BoatDTO, SafeHtml> boatIdColumn = new Column<BoatDTO, SafeHtml>(new SafeHtmlCell()) {
|
||||
@Override
|
||||
public SafeHtml getValue(BoatDTO competitor) {
|
||||
@@ -129,7 +124,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
return comparator.compare(o1.getIdAsString(), o2.getIdAsString());
|
||||
}
|
||||
});
|
||||
|
||||
filterField = new LabeledAbstractFilterablePanel<BoatDTO>(new Label(stringMessages.filterBoats()),
|
||||
new ArrayList<BoatDTO>(), table, dataProvider) {
|
||||
@Override
|
||||
@@ -143,7 +137,6 @@ public class CompactBoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO
|
||||
}
|
||||
};
|
||||
registerSelectionModelOnNewDataProvider(filterField.getAllListDataProvider());
|
||||
|
||||
mainPanel.insert(filterField, 0);
|
||||
table.addColumnSortHandler(boatColumnListHandler);
|
||||
table.addColumn(boatNameColumn, stringMessages.name());
|
||||
|
||||
+1
-8
@@ -36,20 +36,14 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
public class CompetitorToBoatMappingsDialog extends DataEntryDialog<Map<CompetitorDTO, BoatDTO>> {
|
||||
private final CompactCompetitorTableWrapper<RefreshableSingleSelectionModel<CompetitorDTO>> competitorTable;
|
||||
private final CompactBoatTableWrapper<RefreshableSingleSelectionModel<BoatDTO>> boatTable;
|
||||
|
||||
private final RefreshableSelectionModel<BoatDTO> refreshableBoatSelectionModel;
|
||||
private final RefreshableSelectionModel<CompetitorDTO> refreshableCompetitorSelectionModel;
|
||||
|
||||
private final StringMessages stringMessages;
|
||||
private final SelectionChangeEvent.Handler boatListHandler;
|
||||
private HandlerRegistration boatListHandlerRegistration;
|
||||
|
||||
private final Map<CompetitorDTO, BoatDTO> competitorToBoatMappings;
|
||||
|
||||
protected static class CompetitorToBoatMappingValidator implements Validator<Map<CompetitorDTO, BoatDTO>> {
|
||||
public CompetitorToBoatMappingValidator() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage(Map<CompetitorDTO, BoatDTO> valueToValidate) {
|
||||
String errorMessage = null;
|
||||
@@ -59,7 +53,6 @@ public class CompetitorToBoatMappingsDialog extends DataEntryDialog<Map<Competit
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -153,6 +146,7 @@ public class CompetitorToBoatMappingsDialog extends DataEntryDialog<Map<Competit
|
||||
|
||||
private void linkBoatToSelectedCompetitor(CompetitorDTO selectedCompetitor, BoatDTO selectedBoat) {
|
||||
competitorToBoatMappings.put(selectedCompetitor, selectedBoat);
|
||||
competitorTable.refreshCompetitorList(competitorToBoatMappings);
|
||||
competitorTable.getDataProvider().refresh();
|
||||
competitorTable.getTable().redraw();
|
||||
}
|
||||
@@ -164,7 +158,6 @@ public class CompetitorToBoatMappingsDialog extends DataEntryDialog<Map<Competit
|
||||
boatTable.getSelectionModel().clear();
|
||||
competitorTable.getDataProvider().refresh();
|
||||
competitorTable.getTable().redraw();
|
||||
|
||||
}
|
||||
|
||||
private void competitorSelectionChanged() {
|
||||
|
||||
Reference in new issue
Block a user