Revision 0fde7fba
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java | ||
---|---|---|
6 | 6 |
import java.util.Collections; |
7 | 7 |
import java.util.Comparator; |
8 | 8 |
import java.util.List; |
9 |
import java.util.Set; |
|
9 | 10 |
import java.util.UUID; |
10 | 11 |
|
11 | 12 |
import org.eclipse.jface.viewers.ILabelProvider; |
... | ... | |
36 | 37 |
public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{ |
37 | 38 |
|
38 | 39 |
public static TaxonNode select(Shell shell, //ConversationHolder conversation, |
39 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
40 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
40 | 41 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
41 | 42 |
//conversation, |
42 | 43 |
title, |
... | ... | |
47 | 48 |
return getSelectionFromDialog(dialog); |
48 | 49 |
} |
49 | 50 |
public static TaxonNode select(Shell shell, //ConversationHolder conversation, |
50 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
51 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
51 | 52 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
52 | 53 |
//conversation, |
53 | 54 |
title, |
... | ... | |
59 | 60 |
} |
60 | 61 |
|
61 | 62 |
public static UuidAndTitleCache<TaxonNode> selectUuidAndTitleCache(Shell shell, //ConversationHolder conversation, |
62 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
63 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
63 | 64 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
64 | 65 |
//conversation, |
65 | 66 |
title, |
... | ... | |
76 | 77 |
|
77 | 78 |
private Classification selectedClassification; |
78 | 79 |
private UUID selectedUuid; |
79 |
private final List<UUID> excludeTaxa;
|
|
80 |
// private final Set<UUID> excludeTaxa;
|
|
80 | 81 |
private boolean allowClassificationSelection = false; |
81 | 82 |
|
82 | 83 |
protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation, |
83 |
String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
84 |
String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
84 | 85 |
super(shell, //conversation, |
85 | 86 |
title, multi, TaxonNodeSelectionDialog.class.getCanonicalName(), node); |
86 | 87 |
|
... | ... | |
88 | 89 |
|
89 | 90 |
setListLabelProvider(labelProvider); |
90 | 91 |
// setDetailsLabelProvider(labelProvider); |
91 |
this.excludeTaxa = excludeTaxa;
|
|
92 |
this.cdmBaseToBeFiltered = excludeTaxa;
|
|
92 | 93 |
if(classificationUUID != null){ |
93 | 94 |
selectedUuid = classificationUUID; |
94 | 95 |
} |
... | ... | |
99 | 100 |
createClassificationSelectionCombo(shell); |
100 | 101 |
} |
101 | 102 |
protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation, |
102 |
String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID) {
|
|
103 |
String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID) {
|
|
103 | 104 |
this(shell, title, excludeTaxa, multi, node, classificationUUID, false); |
104 | 105 |
} |
105 | 106 |
|
... | ... | |
207 | 208 |
} |
208 | 209 |
}); |
209 | 210 |
if (selectedClassification == null){ |
210 |
if (this.cdmBaseToBeFiltered == null){
|
|
211 |
// if (this.cdmBaseToBeFiltered.isEmpty()){
|
|
211 | 212 |
selectedClassification = classifications.iterator().next(); |
212 |
} else { |
|
213 |
selectedClassification = this.cdmBaseToBeFiltered.getClassification(); |
|
214 |
} |
|
213 |
|
|
214 |
// } else { |
|
215 |
// selectedClassification = this.cdmBaseToBeFiltered.getClassification(); |
|
216 |
// } |
|
215 | 217 |
} |
216 | 218 |
} |
217 | 219 |
} |
Also available in: Unified diff
allow multiple selection for moving taxonnodes