Project

General

Profile

Download (1.95 KB) Statistics
| Branch: | Tag: | Revision:
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.supplemental;
10

    
11
import eu.etaxonomy.cdm.model.common.CdmBase;
12
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
13
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
15
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
16
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
17

    
18
/**
19
 * @author l.morris
20
 * @date 24 Jan 2012
21
 *
22
 */
23
public class CdmBaseElement extends AbstractCdmFormElement implements IEntityElement<CdmBase>{
24

    
25
	private TextWithLabelElement text_uuid;
26
	private TextWithLabelElement text_objectId;
27
	private CdmBase entity;
28
	/**
29
	 * @param formFactory
30
	 * @param formElement
31
	 */
32
	public CdmBaseElement(CdmFormFactory formFactory,
33
			ICdmFormElement formElement, CdmBase entity, int style) {
34
		
35
		super(formFactory, formElement);
36
		text_uuid = formFactory.createTextWithLabelElement(formElement, "UUID", null, style);		
37
		text_objectId = formFactory.createTextWithLabelElement(formElement, "Object ID", null, style);
38
		setEntity(entity);
39
	}
40

    
41
	/* (non-Javadoc)
42
	 * @see eu.etaxonomy.taxeditor.ui.element.ISelectable#setSelected(boolean)
43
	 */
44
	@Override
45
	public void setSelected(boolean selected) {
46
		// this entity element is not likely to get selected
47
	}
48

    
49
	/* (non-Javadoc)
50
	 * @see eu.etaxonomy.taxeditor.ui.element.IEntityElement#getEntity()
51
	 */
52
	@Override
53
	public CdmBase getEntity() {
54
		return entity;
55
	}
56

    
57
	
58
	public void setEntity(CdmBase entity) {
59
		
60
		this.entity = entity;			
61
		
62
		text_uuid.setText(entity != null ? entity.getUuid().toString() : "");	
63
		text_objectId.setText(entity != null ? entity.getId()+"" : "");
64
	}
65
}
(5-5/19)