Project

General

Profile

Download (1.33 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 *
3
 */
4
package eu.etaxonomy.taxeditor.ui.selection;
5

    
6
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
7
import eu.etaxonomy.cdm.model.common.CdmBase;
8
import eu.etaxonomy.cdm.model.reference.Reference;
9
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
10
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
11

    
12
public class EntitySelectionElementWithAbbreviatedTitle<T extends CdmBase> extends EntitySelectionElement<T> {
13

    
14
	/**
15
     * @param formFactory
16
     * @param conversation
17
     * @param parentElement
18
     * @param clazz
19
     * @param labelString
20
     * @param entity
21
     * @param mode
22
     * @param style
23
     */
24
    public EntitySelectionElementWithAbbreviatedTitle(CdmFormFactory formFactory,// ConversationHolder conversation,
25
            ICdmFormElement parentElement, Class<T> clazz, String labelString, T entity, int mode, int style) {
26
        super(formFactory, //conversation,
27
                parentElement, clazz, labelString, entity, mode, style);
28
    }
29

    
30
    @Override
31
    protected String getTitle() {
32
		if (entity != null){
33
		    if(entity instanceof TeamOrPersonBase) {
34
		        return ((TeamOrPersonBase) entity).getNomenclaturalTitle();
35
		    } else if(entity instanceof Reference){
36
		        return ((Reference) entity).getAbbrevTitleCache();
37
		    } else{
38
		        return super.getTitle();
39
		    }
40
		}
41
		return "";
42
	}
43
}
(4-4/6)