Project

General

Profile

Download (2.81 KB) Statistics
| Branch: | Tag: | Revision:
1 74b9f670 n.hoffmann
/**
2 a6b8fe66 n.hoffmann
 * 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 74b9f670 n.hoffmann
10 f211dd28 n.hoffmann
package eu.etaxonomy.taxeditor.ui.section.occurrence;
11 74b9f670 n.hoffmann
12
import org.eclipse.swt.events.SelectionListener;
13
14
import eu.etaxonomy.cdm.model.location.NamedArea;
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 f211dd28 n.hoffmann
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
19 23783f7a n.hoffmann
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
20 74b9f670 n.hoffmann
21
/**
22 a6b8fe66 n.hoffmann
 * <p>
23
 * CollectingAreasDetailElement class.
24
 * </p>
25 f5979052 Katja Luther
 *
26 74b9f670 n.hoffmann
 * @author n.hoffmann
27
 * @created Oct 14, 2010
28
 * @version 1.0
29
 */
30 bc0e50fb Patrick Plitzner
public class CollectingAreaDetailElement extends
31 74b9f670 n.hoffmann
		AbstractEntityCollectionElement<NamedArea> {
32
33 23783f7a n.hoffmann
	private EntitySelectionElement<NamedArea> selection_namedArea;
34 a6b8fe66 n.hoffmann
35 74b9f670 n.hoffmann
	/**
36 a6b8fe66 n.hoffmann
	 * <p>
37
	 * Constructor for CollectingAreasDetailElement.
38
	 * </p>
39 f5979052 Katja Luther
	 *
40 a6b8fe66 n.hoffmann
	 * @param formFactory
41 78222507 n.hoffmann
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
42 a6b8fe66 n.hoffmann
	 *            object.
43
	 * @param section
44 78222507 n.hoffmann
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
45 a6b8fe66 n.hoffmann
	 *            object.
46
	 * @param entity
47
	 *            a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
48
	 * @param removeListener
49
	 *            a {@link org.eclipse.swt.events.SelectionListener} object.
50
	 * @param style
51
	 *            a int.
52 74b9f670 n.hoffmann
	 */
53 bc0e50fb Patrick Plitzner
	public CollectingAreaDetailElement(CdmFormFactory formFactory,
54 74b9f670 n.hoffmann
			AbstractFormSection section, NamedArea entity,
55
			SelectionListener removeListener, int style) {
56
		super(formFactory, section, entity, removeListener, null, style);
57
	}
58
59 a6b8fe66 n.hoffmann
	/*
60
	 * (non-Javadoc)
61 f5979052 Katja Luther
	 *
62 a6b8fe66 n.hoffmann
	 * @see
63
	 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
64
	 * (java.lang.Object)
65 74b9f670 n.hoffmann
	 */
66 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
67 74b9f670 n.hoffmann
	@Override
68
	public void setEntity(NamedArea entity) {
69
		selection_namedArea.setEntity(entity);
70
	}
71
72 a6b8fe66 n.hoffmann
	/*
73
	 * (non-Javadoc)
74 f5979052 Katja Luther
	 *
75 a6b8fe66 n.hoffmann
	 * @see
76
	 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
77
	 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
78 74b9f670 n.hoffmann
	 */
79 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
80 74b9f670 n.hoffmann
	@Override
81 23783f7a n.hoffmann
	public void createControls(ICdmFormElement formElement, int style) {
82 f5979052 Katja Luther
		selection_namedArea = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
83 23783f7a n.hoffmann
				formElement, "Area",
84
				null, EntitySelectionElement.NOTHING, style);
85 74b9f670 n.hoffmann
	}
86
87 a6b8fe66 n.hoffmann
	/*
88
	 * (non-Javadoc)
89 f5979052 Katja Luther
	 *
90 a6b8fe66 n.hoffmann
	 * @see
91
	 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
92
	 * (java.lang.Object)
93 74b9f670 n.hoffmann
	 */
94 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
95 74b9f670 n.hoffmann
	@Override
96
	public void handleEvent(Object eventSource) {
97 a6b8fe66 n.hoffmann
		if (eventSource == selection_namedArea) {
98 74b9f670 n.hoffmann
			setEntity(selection_namedArea.getSelection());
99
		}
100
	}
101
102
}