ref #6190 removing svn property place holder in first line of code - java files
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / AbstractTermBaseDetailElement.java
1 /**
2 * Copyright (C) 2009 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.section.vocabulary;
10
11 import org.eclipse.swt.widgets.Button;
12
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;
22
23 /**
24 * @author l.morris
25 * @date 20 Dec 2011
26 *
27 */
28 public abstract class AbstractTermBaseDetailElement<T extends TermBase> extends AbstractCdmDetailElement<T> {
29
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;
39
40
41 /**
42 * @param formFactory
43 * @param formElement
44 */
45 public AbstractTermBaseDetailElement(CdmFormFactory formFactory,
46 ICdmFormElement formElement) {
47 super(formFactory, formElement);
48 }
49
50 @Override
51 protected void createControls(ICdmFormElement formElement,
52 T entity, int style) {
53
54 element_Representation = formFactory.createTranslatableRepresentationElement(formElement, getEntity().getPreferredRepresentation(CdmStore.getDefaultLanguage()),getEntity(), 100, style, true);
55
56 uri_uri = formFactory.createUriWithLabelElement(formElement, "URI", getEntity().getUri(), style);
57
58 }
59
60
61
62 @Override
63 public void setEntity(T entity) {
64 super.setEntity(entity);
65 setEnabled(TermBasePropertyTester.isModifiable(entity));
66 }
67
68
69
70 public abstract TermVocabulary getVocabulary();
71
72
73
74 }