int diff = e1.get().compareTo(e2.get());
if(diff != 0) {
return diff;
}
else {
return new UsageReferenceComparator(currentSubject).compare(o1, o2);
}
}
else {
return -1;
}
}
else {
if(e2.isPresent()) {
return 1;
}
else {
return new UsageReferenceComparator(currentSubject).compare(o1, o2);
}
}
}
});
handler.setComparator(dataGrid.getColumn(2), new Comparator<UsageReference>() {
@Override
public int compare(UsageReference o1, UsageReference o2) {
int diff = o1.getAxiomType().getIndex() - o2.getAxiomType().getIndex();
if(diff != 0) {
return diff;
}
return new UsageReferenceComparator(currentSubject).compare(o1, o2);
}
});
dataGrid.addColumnSortHandler(handler);
HTMLPanel rootElement = ourUiBinder.createAndBindUi(this);