Project

General

Profile

« Previous | Next » 

Revision aeb80bf1

Added by Andreas Müller over 3 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
10 10

  
11 11
import java.text.Collator;
12 12
import java.util.Comparator;
13
import java.util.List;
13 14

  
14 15
import org.eclipse.jface.viewers.ILabelProvider;
15 16
import org.eclipse.jface.viewers.LabelProvider;
......
32 33
 */
33 34
public class NomenclaturalAuthorSelectionDialog extends TeamOrPersonBaseSelectionDialog {
34 35

  
35
    protected NomenclaturalAuthorSelectionDialog(Shell shell, //ConversationHolder conversation,
36
    protected NomenclaturalAuthorSelectionDialog(Shell shell,
36 37
            String title,
37 38
            boolean multi, String settings, TeamOrPersonBase<?> agent, boolean teamMemberSelection) {
38 39
        super(shell, title, multi, settings, agent, teamMemberSelection);
......
41 42

  
42 43
    @Override
43 44
    protected void callService(String pattern) {
44
        model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(TeamOrPersonBase.class, limitOfInitialElements, pattern);
45
        model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(TeamOrPersonBase.class, limitOfInitialElements, pattern);
45 46
    }
46 47

  
47 48
    @Override
......
74 75
            TeamOrPersonBase<?> entity, boolean teamMemberSelection) {
75 76
        NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, //conversation,
76 77
                "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity, teamMemberSelection);
77
        return (TeamOrPersonBase<?>)getSelectionFromDialog(dialog);
78
        return getSelectionFromDialog(dialog);
78 79
    }
79 80

  
80 81
    @Override
......
108 109
	}
109 110

  
110 111
	@Override
111
	protected Comparator<UuidAndTitleCache<?>> getItemsComparator() {
112
		return new Comparator<UuidAndTitleCache<?>>() {
112
	protected Comparator<UuidAndTitleCache<TeamOrPersonBase<?>>> getItemsComparator() {
113
		return new Comparator<UuidAndTitleCache<TeamOrPersonBase<?>>>() {
113 114
			@Override
114
			public int compare(UuidAndTitleCache<?> entity1,
115
					UuidAndTitleCache<?> entity2) {
115
			public int compare(UuidAndTitleCache<TeamOrPersonBase<?>> entity1,
116
					UuidAndTitleCache<TeamOrPersonBase<?>> entity2) {
116 117

  
117 118
			    if (entity1.getUuid().equals(entity2.getUuid())){
118 119
			        return 0;
......
126 127
					compareString1 += entity1.getTitleCache();
127 128
				}
128 129

  
129

  
130 130
				String compareString2 = "";
131 131
				if (entity2.getAbbrevTitleCache() != null){
132 132
					compareString2 = entity2.getAbbrevTitleCache();

Also available in: Unified diff