Project

General

Profile

Download (2.34 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 java.util.HashSet;
13
import java.util.Set;
14

    
15
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
16
import eu.etaxonomy.cdm.model.common.Marker;
17
import eu.etaxonomy.cdm.model.common.MarkerType;
18
import eu.etaxonomy.cdm.model.common.TermBase;
19
import eu.etaxonomy.cdm.model.common.TermVocabulary;
20
import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
21
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
22
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
23
import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
24
import eu.etaxonomy.taxeditor.ui.forms.UriWithLabelElement;
25
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
26

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

    
34
	protected TextWithLabelElement text_label;
35
	protected TextWithLabelElement text_description;
36
	protected UriWithLabelElement uri_uri;
37
	
38
	/**
39
	 * @param formFactory
40
	 * @param formElement
41
	 */
42
	public AbstractTermBaseDetailElement(CdmFormFactory formFactory,
43
			ICdmFormElement formElement) {
44
		super(formFactory, formElement);
45
	}
46
	
47
	/* (non-Javadoc)
48
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
49
	 */
50
	@Override
51
	protected void createControls(ICdmFormElement formElement,
52
			T entity, int style) {
53
		text_label = formFactory.createTextWithLabelElement(formElement, "Label", getEntity().getLabel(), style);
54
		text_description = formFactory.createMultilineTextWithLabel(formElement, "Description", 100, style);
55
		text_description.setText(getEntity().getDescription());
56
		uri_uri = formFactory.createUriWithLabelElement(formElement, "URI", getEntity().getUri(), style);
57
		
58
	}
59

    
60
	@Override
61
	public void setEntity(T entity) {
62
		super.setEntity(entity);
63
		setEnabled(TermBasePropertyTester.isModifiable(entity));
64
	}
65

    
66
	public abstract TermVocabulary getVocabulary();
67
		
68
}
(1-1/8)