1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 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.section.vocabulary;
|
11
|
|
12
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
13
|
import eu.etaxonomy.cdm.model.common.Language;
|
14
|
import eu.etaxonomy.cdm.model.common.Representation;
|
15
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
16
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
|
17
|
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
|
18
|
|
19
|
/**
|
20
|
* @author l.morris
|
21
|
* @date 20 Dec 2011
|
22
|
*
|
23
|
*/
|
24
|
public class DefinedTermDetailElement<T extends DefinedTermBase> extends AbstractTermBaseDetailElement<T> {
|
25
|
|
26
|
/**
|
27
|
* @param formFactory
|
28
|
* @param formElement
|
29
|
*/
|
30
|
public DefinedTermDetailElement(CdmFormFactory formFactory,
|
31
|
ICdmFormElement formElement) {
|
32
|
super(formFactory, formElement);
|
33
|
}
|
34
|
|
35
|
/* (non-Javadoc)
|
36
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
|
37
|
*/
|
38
|
@Override
|
39
|
public void handleEvent(Object eventSource) {
|
40
|
if (eventSource == text_label){
|
41
|
getEntity().setLabel(text_label.getText());
|
42
|
}else if (eventSource == text_description){
|
43
|
Representation representation = getEntity().getRepresentation(Language.DEFAULT());
|
44
|
representation.setText(text_description.getText());
|
45
|
}
|
46
|
}
|
47
|
|
48
|
/* (non-Javadoc)
|
49
|
* @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#getVocabularyMarkers()
|
50
|
*/
|
51
|
@Override
|
52
|
public TermVocabulary getVocabulary() {
|
53
|
return getEntity() != null ? getEntity().getVocabulary() : null;
|
54
|
}
|
55
|
|
56
|
}
|