@Override
protected void configureCarousel() {
addCarouselAction("Compare", MSG.common_button_compare(), null, new CarouselAction() {
public void executeAction(Object actionValue) {
Record record1 = selectedRecords.get(0);
Record record2 = selectedRecords.get(1);
final String path = record1.getAttribute(DriftDataSource.ATTR_PATH);
String id1 = record1.getAttribute(DriftDataSource.ATTR_ID);
String id2 = record2.getAttribute(DriftDataSource.ATTR_ID);
// regardless of selection order, compare the same way, showing newest changes with '+' signs
int version1 = record1.getAttributeAsInt(DriftDataSource.ATTR_CHANGESET_VERSION);
int version2 = record2.getAttributeAsInt(DriftDataSource.ATTR_CHANGESET_VERSION);
String diffOldId = (version1 < version2) ? id1 : id2;
String diffNewId = (version1 < version2) ? id2 : id1;
GWTServiceLookup.getDriftService().generateUnifiedDiffByIds(diffOldId, diffNewId,
new AsyncCallback<FileDiffReport>() {