1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.ui.section.supplemental;
|
5
|
|
6
|
import org.eclipse.swt.events.SelectionListener;
|
7
|
|
8
|
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
|
9
|
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
|
10
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
11
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
12
|
|
13
|
/**
|
14
|
* <p>IdentifiableSourceElement class.</p>
|
15
|
*
|
16
|
* @author n.hoffmann
|
17
|
* @created Nov 16, 2009
|
18
|
* @version 1.0
|
19
|
*/
|
20
|
public class IdentifiableSourceElement extends AbstractOriginalSourceElement<IdentifiableSource>{
|
21
|
|
22
|
/**
|
23
|
* <p>Constructor for IdentifiableSourceElement.</p>
|
24
|
*
|
25
|
* @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
|
26
|
* @param element a {@link eu.etaxonomy.cdm.model.common.IdentifiableSource} object.
|
27
|
* @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
|
28
|
* @param style a int.
|
29
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
30
|
*/
|
31
|
public IdentifiableSourceElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement, IdentifiableSource element,
|
32
|
SelectionListener removeListener, int style) {
|
33
|
super(cdmFormFactory, formElement, element, removeListener, style);
|
34
|
}
|
35
|
|
36
|
/* (non-Javadoc)
|
37
|
* @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
|
38
|
*/
|
39
|
/** {@inheritDoc} */
|
40
|
@Override
|
41
|
public void createControls(ICdmFormElement formElement, int style) {
|
42
|
super.createControls(formElement, style);
|
43
|
}
|
44
|
|
45
|
|
46
|
/* (non-Javadoc)
|
47
|
* @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
|
48
|
*/
|
49
|
/** {@inheritDoc} */
|
50
|
@Override
|
51
|
public void setEntity(IdentifiableSource entity) {
|
52
|
super.setEntity(entity);
|
53
|
text_idInSource.setText(entity.getIdInSource());
|
54
|
text_idNamespace.setText(entity.getIdNamespace());
|
55
|
|
56
|
selection_reference.setEntity(entity.getCitation());
|
57
|
text_referenceDetail.setText(entity.getCitationMicroReference());
|
58
|
if(hasOriginalNameString()) text_originaleNameString.setText(entity.getOriginalNameString());
|
59
|
}
|
60
|
|
61
|
/** {@inheritDoc} */
|
62
|
@Override
|
63
|
public void handleEvent(Object eventSource) {
|
64
|
if(eventSource == text_idInSource){
|
65
|
getEntity().setIdInSource(text_idInSource.getText());
|
66
|
}
|
67
|
else if(eventSource == text_idNamespace){
|
68
|
getEntity().setIdNamespace(text_idNamespace.getText());
|
69
|
}
|
70
|
if(eventSource == selection_reference){
|
71
|
getEntity().setCitation(selection_reference.getSelection());
|
72
|
}
|
73
|
else if(eventSource == text_referenceDetail){
|
74
|
getEntity().setCitationMicroReference(text_referenceDetail.getText());
|
75
|
}
|
76
|
else if(eventSource == text_originaleNameString){
|
77
|
getEntity().setOriginalNameString(text_originaleNameString.getText());
|
78
|
}
|
79
|
}
|
80
|
}
|