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
|
* <p>
|
23
|
* DescriptionSourceElement class.
|
24
|
* </p>
|
25
|
*
|
26
|
* @author n.hoffmann
|
27
|
* @created Mar 18, 2010
|
28
|
* @version 1.0
|
29
|
*/
|
30
|
public class DescriptionSourceElement extends
|
31
|
AbstractEntityCollectionElement<Reference> {
|
32
|
|
33
|
private EntitySelectionElement<Reference> selection_descriptionSource;
|
34
|
|
35
|
/**
|
36
|
* <p>
|
37
|
* Constructor for DescriptionSourceElement.
|
38
|
* </p>
|
39
|
*
|
40
|
* @param cdmFormFactory
|
41
|
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
|
42
|
* object.
|
43
|
* @param formElement
|
44
|
* a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
|
45
|
* object.
|
46
|
* @param element
|
47
|
* a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase}
|
48
|
* object.
|
49
|
* @param removeListener
|
50
|
* a {@link org.eclipse.swt.events.SelectionListener} object.
|
51
|
* @param style
|
52
|
* a int.
|
53
|
*/
|
54
|
public DescriptionSourceElement(CdmFormFactory cdmFormFactory,
|
55
|
AbstractFormSection formElement, Reference element,
|
56
|
SelectionListener removeListener, int style) {
|
57
|
super(cdmFormFactory, formElement, element, removeListener, null, style);
|
58
|
}
|
59
|
|
60
|
/** {@inheritDoc} */
|
61
|
@Override
|
62
|
public void createControls(ICdmFormElement element, int style) {
|
63
|
selection_descriptionSource = formFactory
|
64
|
.createSelectionElement(Reference.class,
|
65
|
element, "Source",
|
66
|
null, EntitySelectionElement.ALL, style);
|
67
|
if (entity != null){
|
68
|
setEntity(entity);
|
69
|
}
|
70
|
}
|
71
|
|
72
|
/** {@inheritDoc} */
|
73
|
@Override
|
74
|
public void setEntity(Reference element) {
|
75
|
this.entity = element;
|
76
|
if (selection_descriptionSource != null){
|
77
|
selection_descriptionSource.setEntity(element);
|
78
|
}
|
79
|
}
|
80
|
|
81
|
/** {@inheritDoc} */
|
82
|
@Override
|
83
|
public void handleEvent(Object eventSource) {
|
84
|
|
85
|
}
|
86
|
}
|