1 |
3a9975f6
|
Katja Luther
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2018 EDIT
|
4 |
|
|
* European Distributed Institute of Taxonomy
|
5 |
|
|
* http://www.e-taxonomy.eu
|
6 |
|
|
*
|
7 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
package eu.etaxonomy.taxeditor.ui.combo;
|
11 |
|
|
|
12 |
|
|
import java.util.ArrayList;
|
13 |
|
|
import java.util.List;
|
14 |
|
|
|
15 |
|
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
16 |
e9eec17d
|
Patrick Plitzner
|
import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
|
17 |
3a9975f6
|
Katja Luther
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
18 |
|
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
19 |
|
|
|
20 |
|
|
/**
|
21 |
|
|
* @author k.luther
|
22 |
|
|
* @date 16.02.2018
|
23 |
|
|
*
|
24 |
|
|
*/
|
25 |
|
|
public class MisappliedRelationshipComboElement extends TermComboElement<TaxonRelationshipType> {
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* @param formFactory
|
29 |
|
|
* @param parentElement
|
30 |
|
|
* @param termType
|
31 |
|
|
* @param labelString
|
32 |
|
|
* @param selection
|
33 |
|
|
* @param addEmptyElement
|
34 |
|
|
* @param style
|
35 |
|
|
* @param useAbbrevLabel
|
36 |
|
|
* @param comparator
|
37 |
|
|
*/
|
38 |
|
|
public MisappliedRelationshipComboElement(CdmFormFactory formFactory, ICdmFormElement parentElement,
|
39 |
|
|
String labelString, TaxonRelationshipType selection, boolean addEmptyElement, int style, boolean useAbbrevLabel) {
|
40 |
|
|
super(formFactory, parentElement, TaxonRelationshipType.class, labelString, selection, addEmptyElement, style);
|
41 |
|
|
List<TaxonRelationshipType> relTypes = new ArrayList<>();
|
42 |
08ef23e2
|
Katja Luther
|
if (selection.isAnyMisappliedName()){
|
43 |
|
|
relTypes.add(TaxonRelationshipType.MISAPPLIED_NAME_FOR());
|
44 |
|
|
relTypes.add(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR());
|
45 |
|
|
relTypes.add(TaxonRelationshipType.PARTIAL_MISAPPLIED_NAME_FOR());
|
46 |
|
|
}else if (selection.isAnySynonym()){
|
47 |
|
|
relTypes.add(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR());
|
48 |
|
|
relTypes.add(TaxonRelationshipType.PARTIAL_SYNONYM_FOR());
|
49 |
|
|
}
|
50 |
3a9975f6
|
Katja Luther
|
populateTerms(relTypes);
|
51 |
a3e1e5d7
|
Katja Luther
|
setSelection(selection);
|
52 |
3a9975f6
|
Katja Luther
|
}
|
53 |
|
|
|
54 |
|
|
}
|