Project

General

Profile

Download (2.2 KB) Statistics
| Branch: | Tag: | Revision:
1 a6b8fe66 n.hoffmann
/**
2
 * Copyright (C) 2007 EDIT
3 f5979052 Katja Luther
 * European Distributed Institute of Taxonomy
4 a6b8fe66 n.hoffmann
 * http://www.e-taxonomy.eu
5 f5979052 Katja Luther
 *
6 a6b8fe66 n.hoffmann
 * 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
10
package eu.etaxonomy.taxeditor.ui.section.taxon;
11
12
import org.eclipse.swt.events.SelectionListener;
13
14
import eu.etaxonomy.cdm.model.taxon.Taxon;
15 78222507 n.hoffmann
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17 dacb59c9 Patric Plitzner
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18 a6b8fe66 n.hoffmann
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
19 23783f7a n.hoffmann
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
20 a6b8fe66 n.hoffmann
21
/**
22
 * @author n.hoffmann
23
 * @created Mar 29, 2011
24
 * @version 1.0
25
 */
26
public class TaxonDetailElement extends AbstractEntityCollectionElement<Taxon> {
27
28 23783f7a n.hoffmann
	private EntitySelectionElement<Taxon> selection_taxon;
29 a6b8fe66 n.hoffmann
30
	/**
31
	 * @param formFactory
32
	 * @param section
33
	 * @param entity
34
	 * @param removeListener
35
	 * @param backgroundColor
36
	 * @param style
37
	 */
38
	public TaxonDetailElement(CdmFormFactory formFactory,
39
			AbstractFormSection section, Taxon entity,
40
			SelectionListener removeListener, int style) {
41
		super(formFactory, section, entity, removeListener, null, style);
42
	}
43
44
	/*
45
	 * (non-Javadoc)
46 f5979052 Katja Luther
	 *
47 a6b8fe66 n.hoffmann
	 * @see
48
	 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity
49
	 * (java.lang.Object)
50
	 */
51
	@Override
52
	public void setEntity(Taxon entity) {
53
		selection_taxon.setEntity(entity);
54
	}
55
56
	/*
57
	 * (non-Javadoc)
58 f5979052 Katja Luther
	 *
59 a6b8fe66 n.hoffmann
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#
60
	 * createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, int)
61
	 */
62
	@Override
63
	public void createControls(ICdmFormElement element, int style) {
64 23783f7a n.hoffmann
		selection_taxon = formFactory
65
				.createSelectionElement(Taxon.class,
66 f5979052 Katja Luther
				        element, "Taxon", null,
67 93b32455 Katja Luther
						EntitySelectionElement.SELECTABLE, style);
68 a6b8fe66 n.hoffmann
	}
69
70
	/*
71
	 * (non-Javadoc)
72 f5979052 Katja Luther
	 *
73 a6b8fe66 n.hoffmann
	 * @see
74
	 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent
75
	 * (java.lang.Object)
76
	 */
77
	@Override
78
	public void handleEvent(Object eventSource) {
79
		if (eventSource == selection_taxon) {
80
			setEntity(selection_taxon.getSelection());
81
		}
82
	}
83
84
}