mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 12:03:58 +00:00
reverted broken Eclipse refactoring regarding renaming of compare method
This commit is contained in:
1 parent
6267df9504
commit
3a7cf529bf
5 files changed
+9
-9
No files matched your search
+5
-5
@@ -149,7 +149,7 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
|
||||
RefreshableMultiSelectionModel<EventDTO> multiSelectionModel = (RefreshableMultiSelectionModel<EventDTO>) eventTable.getSelectionModel();
|
||||
multiSelectionModel.setHasEqualIdentity(new EntityIdentityComparator<EventDTO>() {
|
||||
@Override
|
||||
public boolean representSameEntity(EventDTO dto1, EventDTO dto2) {
|
||||
public boolean compare(EventDTO dto1, EventDTO dto2) {
|
||||
return dto1.id.equals(dto2.id) ? true : false;
|
||||
}
|
||||
});
|
||||
@@ -380,19 +380,19 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
|
||||
ListHandler<EventDTO> result = new ListHandler<EventDTO>(eventRecords);
|
||||
result.setComparator(eventNameColumn, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int representSameEntity(EventDTO e1, EventDTO e2) {
|
||||
public int compare(EventDTO e1, EventDTO e2) {
|
||||
return new NaturalComparator().compare(e1.getName(), e2.getName());
|
||||
}
|
||||
});
|
||||
result.setComparator(venueNameColumn, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int representSameEntity(EventDTO e1, EventDTO e2) {
|
||||
public int compare(EventDTO e1, EventDTO e2) {
|
||||
return new NaturalComparator().compare(e1.venue.getName(), e2.venue.getName());
|
||||
}
|
||||
});
|
||||
result.setComparator(startEndDateColumn, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int representSameEntity(EventDTO e1, EventDTO e2) {
|
||||
public int compare(EventDTO e1, EventDTO e2) {
|
||||
int result;
|
||||
if(e1.startDate != null && e2.startDate != null) {
|
||||
result = e2.startDate.compareTo(e1.startDate);
|
||||
@@ -408,7 +408,7 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
|
||||
});
|
||||
result.setComparator(isPublicColumn, new Comparator<EventDTO>() {
|
||||
@Override
|
||||
public int representSameEntity(EventDTO e1, EventDTO e2) {
|
||||
public int compare(EventDTO e1, EventDTO e2) {
|
||||
return e1.isPublic == e2.isPublic ? 0 : e1.isPublic ? 1 : -1;
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ public class RegattaSelectionModel implements RegattaSelectionProvider, Refresha
|
||||
public EntityIdentityComparator<RegattaIdentifier> getHasEqualIdentity() {
|
||||
return new EntityIdentityComparator<RegattaIdentifier>() {
|
||||
@Override
|
||||
public boolean representSameEntity(RegattaIdentifier dto1, RegattaIdentifier dto2) {
|
||||
public boolean compare(RegattaIdentifier dto1, RegattaIdentifier dto2) {
|
||||
return dto1.equals(dto2);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -23,5 +23,5 @@ public interface EntityIdentityComparator<T> {
|
||||
* Compares the objects and returns <code>true</code> if the objects represent the same entity.
|
||||
* Note that this does not imply that they are also {@link #equals(Object) equal}.
|
||||
*/
|
||||
public boolean representSameEntity(T dto1, T dto2);
|
||||
public boolean compare(T dto1, T dto2);
|
||||
}
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class RefreshableMultiSelectionModel<T> extends MultiSelectionModel<T> im
|
||||
if (comp != null) {
|
||||
for(T it : newObjects) {
|
||||
for(T selected : selectedSet) {
|
||||
if(comp.representSameEntity(selected, it)) {
|
||||
if(comp.compare(selected, it)) {
|
||||
setSelected(it, true);
|
||||
} else {
|
||||
setSelected(it, false);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class RefreshableSingleSelectionModel<T> extends SingleSelectionModel<T>
|
||||
if (comp != null) {
|
||||
for(T it : newObjects) {
|
||||
for(T selected : selectedSet) {
|
||||
if(comp.representSameEntity(selected, it)) {
|
||||
if(comp.compare(selected, it)) {
|
||||
setSelected(it, true);
|
||||
} else {
|
||||
setSelected(it, false);
|
||||
|
||||
Reference in new issue
Block a user