Project

General

Profile

Revision 914fc520

ID914fc5208329ff13636d92d8263a4eeb56858413
Parent 98baf5f8
Child 31ab3723, 10a7412e, 30c956e4

Added by Patrick Plitzner over 2 years ago

Fix filtering of field units with same title cache in specimen editor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateContentProvider.java
2 2

  
3 3
import java.util.ArrayList;
4 4
import java.util.Collection;
5
import java.util.Collections;
5 6
import java.util.Comparator;
6 7
import java.util.LinkedHashSet;
7 8
import java.util.List;
8 9
import java.util.Set;
9
import java.util.TreeSet;
10 10

  
11 11
import org.eclipse.jface.viewers.ITreeContentProvider;
12 12
import org.eclipse.jface.viewers.TreeNode;
......
22 22

  
23 23
public class DerivateContentProvider implements ITreeContentProvider {
24 24

  
25
    private TreeSet<TreeNode> rootNodes;
25
    private List<TreeNode> rootNodes;
26 26

  
27 27
	@Override
28 28
	public void dispose() {
......
47 47

  
48 48
	@Override
49 49
	public Object[] getElements(Object inputElement) {
50
	    rootNodes = new TreeSet<TreeNode>(new TreeNodeComparator());
50
	    rootNodes = new ArrayList<>();
51 51
	    if(inputElement instanceof Collection){
52 52
	        for (Object o: (Collection)inputElement) {
53 53
	            if(o instanceof SpecimenOrObservationBase){
......
58 58
	            }
59 59
            }
60 60
	    }
61
	    Collections.sort(rootNodes, new TreeNodeComparator());
61 62
	    return rootNodes.toArray();
62 63
	}
63 64

  
......
143 144
	    }
144 145
	    return derivates;
145 146
	}
146
	
147

  
147 148
	private class TreeNodeComparator implements Comparator<TreeNode>{
148 149

  
149 150
		@Override
......
161 162
			}
162 163
			return 0;
163 164
		}
164
		
165

  
165 166
	}
166 167

  
167 168
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)