3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
12 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
13 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
14 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
23 public class DefinedTermDetailElement
<T
extends DefinedTermBase
> extends AbstractTermBaseDetailElement
<T
> {
25 protected TextWithLabelElement textIdInVocabulary
;
31 public DefinedTermDetailElement(CdmFormFactory formFactory
,
32 ICdmFormElement formElement
) {
33 super(formFactory
, formElement
);
37 protected void createControls(ICdmFormElement formElement
, T entity
, int style
) {
38 super.createControls(formElement
, entity
, style
);
39 textIdInVocabulary
= formFactory
.createTextWithLabelElement(formElement
, "ID in vocabulary", entity
.getIdInVocabulary(), style
);
43 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
46 public void handleEvent(Object eventSource
) {
47 handleRepresentation(eventSource
);
48 if(eventSource
==textIdInVocabulary
){
49 getEntity().setIdInVocabulary(textIdInVocabulary
.getText());
54 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#getVocabularyMarkers()
57 public TermVocabulary
getVocabulary() {
58 return getEntity() != null ?
getEntity().getVocabulary() : null;