Project

General

Profile

Download (2.27 KB) Statistics
| Branch: | Tag: | Revision:
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 org.eclipse.swt.widgets.Button;
13

    
14
import eu.etaxonomy.cdm.model.common.TermBase;
15
import eu.etaxonomy.cdm.model.common.TermVocabulary;
16
import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
17
import eu.etaxonomy.taxeditor.store.CdmStore;
18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20
import eu.etaxonomy.taxeditor.ui.element.RepresentationElement;
21
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
22
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
23

    
24
/**
25
 * @author l.morris
26
 * @date 20 Dec 2011
27
 *
28
 */
29
public abstract class AbstractTermBaseDetailElement<T extends TermBase> extends AbstractCdmDetailElement<T> {
30

    
31
    //protected TextWithLabelElement text_label;
32
	//protected TextWithLabelElement text_description;
33
	protected UriWithLabelElement uri_uri;
34
	//protected TextWithLabelElement text_abbreviatedLabel;
35
	//protected TermComboElement<Language> combo_language;
36
	//private TermBase term;
37
	//protected Representation representation;
38
	protected RepresentationElement element_Representation;
39
	private Button button;
40

    
41

    
42
	/**
43
	 * @param formFactory
44
	 * @param formElement
45
	 */
46
	public AbstractTermBaseDetailElement(CdmFormFactory formFactory,
47
			ICdmFormElement formElement) {
48
		super(formFactory, formElement);
49
	}
50

    
51
	@Override
52
	protected void createControls(ICdmFormElement formElement,
53
			T entity, int style) {
54

    
55
		element_Representation = formFactory.createTranslatableRepresentationElement(formElement,  getEntity().getPreferredRepresentation(CdmStore.getDefaultLanguage()),getEntity(), 100, style);
56

    
57
		uri_uri = formFactory.createUriWithLabelElement(formElement, "URI", getEntity().getUri(), style);
58

    
59
	}
60

    
61

    
62

    
63
    @Override
64
	public void setEntity(T entity) {
65
		super.setEntity(entity);
66
		setEnabled(TermBasePropertyTester.isModifiable(entity));
67
	}
68

    
69

    
70

    
71
	public abstract TermVocabulary getVocabulary();
72

    
73

    
74

    
75
}
(1-1/18)