Project

General

Profile

Download (1.64 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.ui.selection;
10

    
11
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
12
import eu.etaxonomy.cdm.model.location.NamedArea;
13
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
15

    
16
/**
17
 * @author k.luther
18
 * @since Apr 3, 2020
19
 */
20
public class EntitySelectionElementWithIdInVocabulary extends EntitySelectionElement<NamedArea> {
21

    
22
    /**
23
     * @param formFactory
24
     * @param parentElement
25
     * @param clazz
26
     * @param labelString
27
     * @param entity
28
     * @param mode
29
     * @param style
30
     */
31
    public EntitySelectionElementWithIdInVocabulary(CdmFormFactory formFactory, ICdmFormElement parentElement,
32
            Class<NamedArea> clazz, String labelString, NamedArea namedArea, int mode, int style) {
33
        super(formFactory, parentElement, clazz, labelString, namedArea, mode, style);
34
    }
35

    
36
    /**
37
     * <p>
38
     * getTitle
39
     * </p>
40
     *
41
     * @return a {@link java.lang.String} object.
42
     */
43
    @Override
44
    protected String getTitle() {
45
        if (entity != null){
46
            if(entity instanceof NamedArea){
47
                return entity.getIdInVocabulary() + " - "+entity.getLabel();
48
            }
49
            else if(entity instanceof IIdentifiableEntity) {
50
                return ((IIdentifiableEntity) entity).getTitleCache();
51
            }
52

    
53
        }
54
        return "";
55
    }
56

    
57

    
58

    
59

    
60
}
(6-6/8)