Revision 73a663a3
Added by Niels Hoffmann over 12 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/DateDetailSection.java | ||
---|---|---|
70 | 70 |
formFactory.addPropertyChangeListener(this); |
71 | 71 |
} |
72 | 72 |
|
73 |
@Override |
|
74 |
public TimePeriod getEntity() { |
|
75 |
if(super.getEntity() == null){ |
|
76 |
setEntity(TimePeriod.NewInstance()); |
|
77 |
} |
|
78 |
return super.getEntity(); |
|
79 |
} |
|
80 |
|
|
73 | 81 |
/** |
74 | 82 |
* <p> |
75 | 83 |
* Setter for the field <code>timePeriod</code>. |
... | ... | |
82 | 90 |
public void setEntity(TimePeriod timePeriod) { |
83 | 91 |
setEntityInternally(timePeriod); |
84 | 92 |
text_parseText.setText(timePeriod.toString()); |
85 |
super.setEntity(timePeriod); |
|
86 | 93 |
} |
87 | 94 |
|
88 | 95 |
/** |
... | ... | |
99 | 106 |
text_freeText.setText(timePeriod.getFreeText()); |
100 | 107 |
|
101 | 108 |
this.setText(CdmUtils.Nz(timePeriod.toString())); |
109 |
super.setEntity(timePeriod); |
|
110 |
layout(); |
|
102 | 111 |
} |
103 | 112 |
|
104 | 113 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/TimePeriodElement.java | ||
---|---|---|
106 | 106 |
// section_dateDetails.setEntity(timePeriod); |
107 | 107 |
// |
108 | 108 |
if (eventSource == section_dateDetails) { |
109 |
timePeriod = section_dateDetails.getEntity(); |
|
109 | 110 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); |
110 | 111 |
} |
111 | 112 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.TermComboType; |
20 | 20 |
import eu.etaxonomy.taxeditor.ui.forms.CheckboxElement; |
21 | 21 |
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement; |
22 |
import eu.etaxonomy.taxeditor.ui.selection.TaxonBaseSelectionElement; |
|
22 | 23 |
import eu.etaxonomy.taxeditor.ui.selection.TaxonSelectionElement; |
23 | 24 |
import eu.etaxonomy.taxeditor.ui.term.DeterminationModifierComboElement; |
24 | 25 |
|
... | ... | |
36 | 37 |
|
37 | 38 |
private DeterminationModifierComboElement combo_determinationModifier; |
38 | 39 |
private CheckboxElement checkbox_preferredFlag; |
39 |
private TaxonSelectionElement selection_taxon;
|
|
40 |
private TaxonBaseSelectionElement selection_taxonBase;
|
|
40 | 41 |
|
41 | 42 |
// private TODO a set of references |
42 | 43 |
|
... | ... | |
76 | 77 |
@Override |
77 | 78 |
public void setEntity(DeterminationEvent entity) { |
78 | 79 |
this.entity = entity; |
80 |
combo_determinationModifier.setSelection(entity.getModifier()); |
|
81 |
selection_taxonBase.setEntity(entity.getTaxon()); |
|
79 | 82 |
super.setEntity(entity); |
80 | 83 |
} |
81 | 84 |
|
... | ... | |
93 | 96 |
combo_determinationModifier = (DeterminationModifierComboElement) formFactory |
94 | 97 |
.createTermComboElement(TermComboType.DETERMINATION_MODIFIER, |
95 | 98 |
element, "Determination Modifier", null, style); |
99 |
// TODO remove this |
|
96 | 100 |
// checkbox_preferredFlag = formFactory.createCheckbox(element, |
97 | 101 |
// "Current", false, style); |
98 |
selection_taxon = (TaxonSelectionElement) formFactory
|
|
99 |
.createSelectionElement(SelectionType.TAXON, |
|
102 |
selection_taxonBase = (TaxonBaseSelectionElement) formFactory
|
|
103 |
.createSelectionElement(SelectionType.TAXON_BASE,
|
|
100 | 104 |
getConversationHolder(), element, "Taxon", null, |
101 | 105 |
TaxonSelectionElement.DEFAULT, style); |
102 | 106 |
|
... | ... | |
120 | 124 |
getEntity().setModifier(combo_determinationModifier.getSelection()); |
121 | 125 |
} else if (eventSource == checkbox_preferredFlag) { |
122 | 126 |
getEntity().setPreferredFlag(checkbox_preferredFlag.getSelection()); |
123 |
} else if (eventSource == selection_taxon) { |
|
124 |
getEntity().setTaxon(selection_taxon.getSelection()); |
|
127 |
} else if (eventSource == selection_taxonBase) {
|
|
128 |
getEntity().setTaxon(selection_taxonBase.getSelection());
|
|
125 | 129 |
} |
126 | 130 |
// else if(eventSource == TODO set of references){ |
127 | 131 |
// |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
599 | 599 |
.createCdmDetailSection(DetailType.DERIVED_UNIT, |
600 | 600 |
getConversationHolder(), parent, this, Section.TWISTIE); |
601 | 601 |
|
602 |
boolean showExperimentalFeatures = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES); |
|
602 |
Object getBoolean; |
|
603 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
604 |
|
|
605 |
DeterminationDetailSection determinationDetailSection = (DeterminationDetailSection) formFactory |
|
606 |
.createCdmDetailSection(DetailType.DETERMINATION, |
|
607 |
getConversationHolder(), parent, this, Section.TWISTIE); |
|
603 | 608 |
|
604 |
// TODO remove experimental check once this is fully implemented. see #2376 |
|
605 |
DeterminationDetailSection determinationDetailSection = null; |
|
606 |
if(showExperimentalFeatures){ |
|
607 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
608 |
|
|
609 |
determinationDetailSection = (DeterminationDetailSection) formFactory |
|
610 |
.createCdmDetailSection(DetailType.DETERMINATION, |
|
611 |
getConversationHolder(), parent, this, Section.TWISTIE); |
|
612 |
} |
|
613 | 609 |
|
614 | 610 |
addPart(generalDetailSection); |
615 | 611 |
addPart(gatheringEventDetailSection); |
616 | 612 |
addPart(fieldObservationDetailSection); |
617 | 613 |
addPart(derivedUnitBaseDetailSection); |
618 |
if(showExperimentalFeatures){ |
|
619 |
addPart(determinationDetailSection); |
|
620 |
} |
|
614 |
addPart(determinationDetailSection); |
|
615 |
|
|
621 | 616 |
} |
622 | 617 |
|
623 | 618 |
/** |
Also available in: Unified diff
Fixes a problem with TimePeriodElement