Project

General

Profile

« Previous | Next » 

Revision d365bbda

Added by Katja Luther over 3 years ago

use OrderIndexComparator for distributionEditor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/TaxonDistributionDtoComparator.java
11 11
import java.util.Comparator;
12 12

  
13 13
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO;
14
import eu.etaxonomy.cdm.compare.OrderIndexComparator;
14 15

  
15 16
/**
16 17
 * @author k.luther
......
32 33
        String name2 = arg1.getNameCache();
33 34
        Integer rankTax1 = arg0.getRankOrderIndex();
34 35
        Integer rankTax2 = arg1.getRankOrderIndex();
35
//        String parentName1 = arg0.get
36
        if (rankTax1 == null && rankTax2 != null){
37
            return 1;
38
        }else if(rankTax2 == null && rankTax1 != null){
39
            return -1;
40
        }else if (rankTax1 != null && rankTax1 == rankTax2) {
36

  
37
        int rankOrder = OrderIndexComparator.instance().compare(rankTax1, rankTax2);
38

  
39
        if (rankOrder == 0) {
41 40
            //same rank, order by name
42 41
            return name1.compareTo(name2);
43
         }else if (rankTax1 == null && rankTax2 == null || rankTax1.equals(rankTax2)){
44
             return -1;
45
         }
42
        }
43
        return rankOrder;
44

  
46 45

  
47
        return 0;
48 46
    }
49 47

  
50 48
}

Also available in: Unified diff