Revision 89084783
Added by Katja Luther about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AbstractTypeDesignationElement.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.ui.section.name; |
11 | 11 |
|
12 |
import org.eclipse.swt.SWT; |
|
12 | 13 |
import org.eclipse.swt.events.SelectionListener; |
13 | 14 |
|
14 | 15 |
import eu.etaxonomy.cdm.model.name.TypeDesignationBase; |
16 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
15 | 17 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
16 | 18 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
17 | 19 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
18 | 20 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
21 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
|
19 | 22 |
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSourcedEntityBaseElement; |
23 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
20 | 24 |
|
21 | 25 |
/** |
22 | 26 |
* <p>Abstract AbstractTypeDesignationElement class.</p> |
... | ... | |
28 | 32 |
public abstract class AbstractTypeDesignationElement<T extends TypeDesignationBase> extends AbstractSourcedEntityBaseElement<T> { |
29 | 33 |
|
30 | 34 |
protected CheckboxElement checkbox_notDesignated; |
31 |
|
|
35 |
protected EntitySelectionElement<Reference> selection_reference; |
|
36 |
protected TextWithLabelElement text_referenceDetail; |
|
37 |
protected ICdmFormElement formElement; |
|
32 | 38 |
|
33 | 39 |
/** |
34 | 40 |
* <p>Constructor for AbstractTypeDesignationElement.</p> |
... | ... | |
50 | 56 |
@Override |
51 | 57 |
public void createControls(ICdmFormElement formElement, int style) { |
52 | 58 |
checkbox_notDesignated = formFactory.createCheckbox(formElement, "Not Designated", false, style); |
59 |
this.formElement = formElement; |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public void setEntity(T entity){ |
|
64 |
super.setEntity(entity); |
|
65 |
if (this.entity != null && this.entity.isLectoType()){ |
|
66 |
selection_reference = formFactory |
|
67 |
.createSelectionElement(Reference.class, formElement, "Reference", |
|
68 |
null, EntitySelectionElement.ALL, SWT.NULL); |
|
69 |
text_referenceDetail = formFactory.createTextWithLabelElement( |
|
70 |
formElement, "Reference Detail", null, SWT.NULL); |
|
71 |
} |
|
53 | 72 |
} |
54 | 73 |
|
55 | 74 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameTypeDesignationElement.java | ||
---|---|---|
86 | 86 |
getEntity().setTypeName(selection_typeName.getEntity()); |
87 | 87 |
} else if (eventSource == combo_typeStatus) { |
88 | 88 |
getEntity().setTypeStatus(combo_typeStatus.getSelection()); |
89 |
|
|
89 | 90 |
} else if (eventSource == checkbox_notDesignated) { |
90 | 91 |
getEntity().setNotDesignated(checkbox_notDesignated.getSelection()); |
91 | 92 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java | ||
---|---|---|
21 | 21 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
22 | 22 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
23 | 23 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
24 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
|
24 | 25 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
25 | 26 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
26 | 27 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
... | ... | |
78 | 79 |
public void handleEvent(Object eventSource) { |
79 | 80 |
if (eventSource == combo_typeStatus) { |
80 | 81 |
getEntity().setTypeStatus(combo_typeStatus.getSelection()); |
82 |
|
|
83 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); |
|
84 |
|
|
81 | 85 |
} |
82 | 86 |
// TODO remove this once specimens are correctly implemented |
83 | 87 |
else if (eventSource == text_specimenTypeText) { |
Also available in: Unified diff
ref #8136: add reference part for lectotype