Project

General

Profile

Download (1.72 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 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

    
10
package eu.etaxonomy.taxeditor.ui.section.description;
11

    
12
import org.eclipse.swt.events.SelectionListener;
13

    
14
import eu.etaxonomy.cdm.model.reference.Reference;
15
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
19
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
20

    
21
/**
22
 * @author n.hoffmann
23
 * @created Mar 18, 2010
24
 */
25
public class DescriptionSourceElement extends
26
		AbstractEntityCollectionElement<Reference> {
27

    
28
	private EntitySelectionElement<Reference> selection_descriptionSource;
29

    
30
	public DescriptionSourceElement(CdmFormFactory cdmFormFactory,
31
			AbstractFormSection formElement, Reference element,
32
			SelectionListener removeListener, int style) {
33
		super(cdmFormFactory, formElement, element, removeListener, null, style);
34
	}
35

    
36
	@Override
37
	public void createControls(ICdmFormElement element, int style) {
38
		selection_descriptionSource = formFactory
39
				.createSelectionElement(Reference.class,
40
				        element, "Source",
41
						null, EntitySelectionElement.ALL, style);
42
		if (entity != null){
43
			setEntity(entity);
44
		}
45
	}
46

    
47
	@Override
48
	public void setEntity(Reference element) {
49
		this.entity = element;
50
		if (selection_descriptionSource != null){
51
			selection_descriptionSource.setEntity(element);
52
		}
53
	}
54

    
55
	@Override
56
	public void handleEvent(Object eventSource) {
57

    
58
	}
59
}
(11-11/26)