Project

General

Profile

Revision 5f727043

ID5f727043639ae132096a910c7ed09e997dca9673
Parent f03073b9
Child 6e52cede

Added by Patrick Plitzner over 1 year ago

ref #6526 Use type designation comparator from cdmlib

View differences:

eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
26 26
 eu.etaxonomy.cdm.api.service.lsid,
27 27
 eu.etaxonomy.cdm.api.service.lsid.impl,
28 28
 eu.etaxonomy.cdm.api.service.molecular,
29
 eu.etaxonomy.cdm.api.service.name,
29 30
 eu.etaxonomy.cdm.api.service.pager,
30 31
 eu.etaxonomy.cdm.api.service.pager.impl,
31 32
 eu.etaxonomy.cdm.api.service.search,
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
18 18
import java.util.ArrayList;
19 19
import java.util.Calendar;
20 20
import java.util.Collection;
21
import java.util.Comparator;
22 21
import java.util.LinkedHashMap;
23 22
import java.util.List;
24 23
import java.util.Map;
......
61 60
import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
62 61
import eu.etaxonomy.cdm.api.service.UpdateResult;
63 62
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
64
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
65 63
import eu.etaxonomy.cdm.io.common.ExportDataWrapper;
66 64
import eu.etaxonomy.cdm.io.common.ExportResult;
67 65
import eu.etaxonomy.cdm.io.common.ExportResultType;
68 66
import eu.etaxonomy.cdm.io.common.ExportType;
69 67
import eu.etaxonomy.cdm.model.common.IEnumTerm;
70
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
71 68
import eu.etaxonomy.taxeditor.event.EventUtility;
72 69
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
73 70
import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
......
766 763
        return Status.OK_STATUS;
767 764
        }
768 765

  
769
    public static Comparator<TypeDesignationBase> getTypeDesignationComparator(){
770
        return new Comparator<TypeDesignationBase>() {
771
            @Override
772
            public int compare(TypeDesignationBase o1, TypeDesignationBase o2) {
773
                if(o1==null){
774
                    return 1;
775
                }
776
                if(o2==null){
777
                    return -1;
778
                }
779
                if(o1.getTypeStatus()==null){
780
                    return 1;
781
                }
782
                if(o2.getTypeStatus()==null){
783
                    return-1;
784
                }
785
                return HibernateProxyHelper.deproxy(o2, TypeDesignationBase.class).getTypeStatus().compareTo(HibernateProxyHelper.deproxy(o1, TypeDesignationBase.class).getTypeStatus());
786
            }
787
        };
788
    }
789

  
790 766
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
14 14

  
15 15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16 16
import eu.etaxonomy.cdm.api.service.INameService;
17
import eu.etaxonomy.cdm.api.service.name.TypeDesignationComparator;
17 18
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
18 19
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
19 20
import eu.etaxonomy.cdm.model.name.Rank;
......
21 22
import eu.etaxonomy.cdm.model.name.TaxonName;
22 23
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
23 24
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
24
import eu.etaxonomy.taxeditor.model.AbstractUtility;
25 25
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
26 26
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
27 27
import eu.etaxonomy.taxeditor.store.CdmStore;
......
80 80

  
81 81
	@Override
82 82
	public Comparator<TypeDesignationBase> getComparator() {
83
        return AbstractUtility.getTypeDesignationComparator();
83
        return new TypeDesignationComparator();
84 84
	}
85 85

  
86 86
	/** {@inheritDoc} */

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)