Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
1
// $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
import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
17
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
        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
        populateTerms(relTypes);
51
        setSelection(selection);
52
    }
53

    
54
}
(5-5/7)