Project

General

Profile

« Previous | Next » 

Revision 790395af

Added by Cherian Mathew almost 9 years ago

Fixes from Katja for commit issue

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java
942 942
       return defaultService.createHierarchyInClassification(arg1, arg2);
943 943
    }
944 944

  
945
	@Override
946
	public DeleteResult delete(UUID arg0) {
947
		return defaultService.delete(arg0);
948
	}
949

  
950 945

  
951 946
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCollectionService.java
704 704
		return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
705 705
	}
706 706

  
707
<<<<<<< Updated upstream
707 708
	@Override
708 709
	public DeleteResult delete(UUID arg0) {
709 710

  
710 711
		return defaultService.delete(arg0);
711 712
	}
713
=======
714
>>>>>>> Stashed changes
712 715
}
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
32 32
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
33 33
import eu.etaxonomy.cdm.api.service.IClassificationService;
34 34
import eu.etaxonomy.cdm.model.common.CdmBase;
35
import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch;
35

  
36 36
import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;
37
import eu.etaxonomy.cdm.model.taxon.TaxonNodeComparator;
37 38
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
38 39
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
39 40
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
......
83 84
		if (PreferencesUtil.getSortNodesNaturally()){
84 85
			comparator = new TaxonNaturalComparator();
85 86
		} else{
86
			comparator = new TaxonComparatorSearch();
87
			comparator = new TaxonNodeComparator();
87 88
		}
88
		TaxonNodeComparator viewerComparator = new TaxonNodeComparator(comparator);
89
		TaxonNodeNavigatorComparator viewerComparator = new TaxonNodeNavigatorComparator(comparator);
89 90
		this.getCommonViewer().setComparator(viewerComparator);
90 91
        setLinkingEnabled(true);
91 92
//		this.getCommonViewer().addSelectionChangedListener(new ISelectionChangedListener() {
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeNavigatorComparator.java
1
package eu.etaxonomy.taxeditor.navigation.navigator;
2

  
3
import java.util.Arrays;
4
import java.util.Comparator;
5

  
6

  
7
import org.eclipse.jface.viewers.Viewer;
8
import org.eclipse.jface.viewers.ViewerComparator;
9

  
10

  
11
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
12
import eu.etaxonomy.cdm.model.taxon.Classification;
13
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
14

  
15
import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;
16
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
17
import eu.etaxonomy.taxeditor.ui.section.supplemental.IdentifiableSourceElement;
18

  
19
public class TaxonNodeNavigatorComparator extends ViewerComparator{
20

  
21
	
22
	public TaxonNodeNavigatorComparator(Comparator<TaxonBase> comparator){
23
		super(comparator);
24
	}
25

  
26
	
27
	
28
	@Override
29
	public int compare(Viewer viewer, Object e1, Object e2){
30
		if (e1 instanceof Classification && e2 instanceof Classification){
31
			return ((Classification)e1).getTitleCache().compareTo(((Classification)e2).getTitleCache());
32
		} else{
33
			if (this.getComparator() instanceof TaxonNaturalComparator){
34
				return this.getComparator().compare((TaxonNode)e1, (TaxonNode)e2);
35
			}else{
36
				return this.getComparator().compare(((TaxonNode)e1).getTaxon(),((TaxonNode)e2).getTaxon());
37
			}
38
		}
39
	}
40
}

Also available in: Unified diff