Project

General

Profile

Download (1.47 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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.agent.TeamOrPersonBase;
12
import eu.etaxonomy.cdm.model.common.CdmBase;
13
import eu.etaxonomy.cdm.model.reference.Reference;
14
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
16

    
17
public class EntitySelectionElementWithAbbreviatedTitle<T extends CdmBase> extends EntitySelectionElement<T> {
18

    
19
    public EntitySelectionElementWithAbbreviatedTitle(CdmFormFactory formFactory,
20
            ICdmFormElement parentElement, Class<T> clazz, String labelString, T entity, int mode, int style) {
21
        super(formFactory,
22
                parentElement, clazz, labelString, entity, mode, style);
23
    }
24

    
25
    @Override
26
    protected String getTitle() {
27
		if (entity != null){
28
		    if(entity instanceof TeamOrPersonBase) {
29
		        return ((TeamOrPersonBase) entity).getNomenclaturalTitleCache();
30
		    } else if(entity instanceof Reference){
31
		      //FIXME: temporary fix for #6437 to avoid outdated title caches
32
		        return ((Reference) entity).generateAbbrevTitle();
33
//		        return ((Reference) entity).getAbbrevTitleCache();
34
		    } else{
35
		        return super.getTitle();
36
		    }
37
		}
38
		return "";
39
	}
40
}
(6-6/8)