2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
11 import org
.eclipse
.swt
.widgets
.Button
;
13 import eu
.etaxonomy
.cdm
.model
.common
.TermBase
;
14 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
15 import eu
.etaxonomy
.taxeditor
.editor
.definedterm
.TermBasePropertyTester
;
16 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.RepresentationElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.UriWithLabelElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
28 public abstract class AbstractTermBaseDetailElement
<T
extends TermBase
> extends AbstractCdmDetailElement
<T
> {
30 //protected TextWithLabelElement text_label;
31 //protected TextWithLabelElement text_description;
32 protected UriWithLabelElement uri_uri
;
33 //protected TextWithLabelElement text_abbreviatedLabel;
34 //protected TermComboElement<Language> combo_language;
35 //private TermBase term;
36 //protected Representation representation;
37 protected RepresentationElement element_Representation
;
38 private Button button
;
45 public AbstractTermBaseDetailElement(CdmFormFactory formFactory
,
46 ICdmFormElement formElement
) {
47 super(formFactory
, formElement
);
51 protected void createControls(ICdmFormElement formElement
,
52 T entity
, int style
) {
54 element_Representation
= formFactory
.createTranslatableRepresentationElement(formElement
, getEntity().getPreferredRepresentation(CdmStore
.getDefaultLanguage()),getEntity(), 100, style
, true);
56 uri_uri
= formFactory
.createUriWithLabelElement(formElement
, "URI", getEntity().getUri(), style
);
63 public void setEntity(T entity
) {
64 super.setEntity(entity
);
65 setEnabled(TermBasePropertyTester
.isModifiable(entity
));
70 public abstract TermVocabulary
getVocabulary();