Revision d90a6c9f
Added by Patrick Plitzner over 9 years ago
- added publish flag to DetailsView for SpecimenOrObservationBases (fixes #3951)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
17 | 17 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
18 | 18 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType; |
19 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
20 |
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart; |
|
21 | 19 |
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement; |
22 | 20 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
21 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
|
23 | 22 |
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement; |
24 | 23 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
25 | 24 |
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement; |
... | ... | |
54 | 53 |
private EntitySelectionElement<Collection> selection_collection; |
55 | 54 |
private TextWithLabelElement text_accessionNumber; |
56 | 55 |
private GatheringEventUnitElement element_elevation; |
56 |
private CheckboxElement checkIsPublish; |
|
57 | 57 |
|
58 | 58 |
|
59 | 59 |
/** |
... | ... | |
78 | 78 |
toggleableText_titleCache = formFactory.createToggleableTextField( |
79 | 79 |
formElement, "Title Cache", entity.getTitleCache(), |
80 | 80 |
entity.isProtectedTitleCache(), style); |
81 |
//TODO for DerivateEditor do not use facade anyore to avoid this special case handling #4539 |
|
81 |
//TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
|
|
82 | 82 |
if(showOnlyDerivedUnitData){ |
83 | 83 |
toggleableText_titleCache.setEnabled(false); |
84 | 84 |
} |
... | ... | |
114 | 114 |
text_accessionNumber = formFactory.createTextWithLabelElement( |
115 | 115 |
formElement, "Accession Number", entity.getAccessionNumber(), |
116 | 116 |
style); |
117 |
checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); |
|
117 | 118 |
|
118 | 119 |
} |
119 | 120 |
|
... | ... | |
151 | 152 |
getEntity().setAccessionNumber(text_accessionNumber.getText()); |
152 | 153 |
} else if (eventSource == combo_specorobstype) { |
153 | 154 |
getEntity().setType(combo_specorobstype.getSelection()); |
155 |
} else if (eventSource == checkIsPublish) { |
|
156 |
getEntity().innerDerivedUnit().setPublish(checkIsPublish.getSelection()); |
|
154 | 157 |
} |
155 | 158 |
|
156 | 159 |
if (eventSource != toggleableText_titleCache) { |
157 | 160 |
toggleableText_titleCache.setText(getEntity().getTitleCache()); |
158 | 161 |
} |
159 | 162 |
} |
160 |
|
|
163 |
|
|
161 | 164 |
public void setShowOnlyDerivedUnitData(boolean showOnlyDerivedUnitData) { |
162 | 165 |
this.showOnlyDerivedUnitData = showOnlyDerivedUnitData; |
163 | 166 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
21 | 21 |
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement; |
22 | 22 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
23 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
|
23 | 24 |
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement; |
24 | 25 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
25 | 26 |
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement; |
... | ... | |
51 | 52 |
private EntitySelectionElement<AgentBase> selection_collector; |
52 | 53 |
private TextWithLabelElement text_collectingNumber; |
53 | 54 |
private GatheringEventUnitElement element_elevation; |
55 |
private CheckboxElement checkIsPublish; |
|
54 | 56 |
|
55 | 57 |
/** |
56 | 58 |
* @param formFactory |
... | ... | |
93 | 95 |
"Collector", entity.getCollector(), EntitySelectionElement.ALL, style); |
94 | 96 |
text_collectingNumber = formFactory.createTextWithLabelElement(formElement, "Collecting number", |
95 | 97 |
entity.getFieldNumber(), style); |
98 |
checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); |
|
96 | 99 |
} |
97 | 100 |
|
98 | 101 |
/* |
... | ... | |
123 | 126 |
getEntity().setFieldNumber(text_collectingNumber.getText()); |
124 | 127 |
} else if (eventSource == combo_specorobstype) { |
125 | 128 |
getEntity().setType(combo_specorobstype.getSelection()); |
129 |
} else if (eventSource == checkIsPublish) { |
|
130 |
getEntity().innerFieldUnit().setPublish(checkIsPublish.getSelection()); |
|
126 | 131 |
} |
127 | 132 |
|
128 | 133 |
if (eventSource != toggleableText_titleCache) { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailElement.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod; |
19 | 19 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
20 | 20 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
21 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
|
21 | 22 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
22 | 23 |
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement; |
23 | 24 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
... | ... | |
38 | 39 |
private NumberWithLabelElement numberPreservationTemperature; |
39 | 40 |
private TermComboElement<DefinedTerm> comboMaterialOrMethods; |
40 | 41 |
private TextWithLabelElement textBarcode; |
42 |
private CheckboxElement checkIsPublish; |
|
41 | 43 |
|
42 | 44 |
/** |
43 | 45 |
* @param formFactory |
... | ... | |
78 | 80 |
numberPreservationTemperature = formFactory.createNumberTextWithLabelElement(formElement, "Preservation Temp. [C°]", temperature, style); |
79 | 81 |
comboMaterialOrMethods = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Materials & Methods", definedMaterialOrMethod, style); |
80 | 82 |
textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style); |
83 |
checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); |
|
81 | 84 |
|
82 | 85 |
} |
83 | 86 |
|
... | ... | |
105 | 108 |
else if(eventSource==textBarcode){ |
106 | 109 |
getEntity().setBarcode(textBarcode.getText()); |
107 | 110 |
} |
111 |
else if(eventSource==checkIsPublish){ |
|
112 |
getEntity().setPublish(checkIsPublish.getSelection()); |
|
113 |
} |
|
108 | 114 |
} |
109 | 115 |
|
110 | 116 |
private PreservationMethod addPreservationMethod(){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod; |
21 | 21 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
22 | 22 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
23 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
|
23 | 24 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
24 | 25 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
25 | 26 |
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement; |
... | ... | |
43 | 44 |
private EntitySelectionElement<Collection> selectionCollection; |
44 | 45 |
private TextWithLabelElement textAccessionNumber; |
45 | 46 |
private TextWithLabelElement textBarcode; |
47 |
private CheckboxElement checkIsPublish; |
|
46 | 48 |
|
47 | 49 |
|
48 | 50 |
/** |
... | ... | |
81 | 83 |
selectionCollection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style); |
82 | 84 |
textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style); |
83 | 85 |
textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style); |
86 |
checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); |
|
84 | 87 |
|
85 | 88 |
} |
86 | 89 |
|
... | ... | |
119 | 122 |
getEntity().getDerivedFrom().setActor(selectionStaff.getSelection()); |
120 | 123 |
} |
121 | 124 |
} |
125 |
else if(eventSource==checkIsPublish){ |
|
126 |
getEntity().setPublish(checkIsPublish.getSelection()); |
|
127 |
} |
|
122 | 128 |
} |
123 | 129 |
|
124 | 130 |
private PreservationMethod addPreservationMethod(){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
27 | 27 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
28 | 28 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
29 |
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement; |
|
29 | 30 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
30 | 31 |
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement; |
31 | 32 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
... | ... | |
51 | 52 |
private EntitySelectionElement<Collection> selection_collection; |
52 | 53 |
private TextWithLabelElement text_accessionNumber; |
53 | 54 |
private EntitySelectionElement<Reference> selection_publishedIn; |
55 |
private CheckboxElement checkIsPublish; |
|
54 | 56 |
|
55 | 57 |
private MediaDetailElement mediaDetailElement; |
56 | 58 |
/** |
... | ... | |
92 | 94 |
} |
93 | 95 |
} |
94 | 96 |
selection_publishedIn = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Published in", publishedIn, EntitySelectionElement.ALL, style); |
97 |
checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); |
|
95 | 98 |
|
96 | 99 |
mediaDetailElement = formFactory.createMediaDetailElement(formElement); |
97 | 100 |
mediaDetailElement.setEntity(media); |
... | ... | |
149 | 152 |
primaryMediaSource.setCitation(selection_publishedIn.getSelection()); |
150 | 153 |
} |
151 | 154 |
} |
155 |
else if(eventSource==checkIsPublish){ |
|
156 |
getEntity().setPublish(checkIsPublish.getSelection()); |
|
157 |
} |
|
152 | 158 |
} |
153 | 159 |
|
154 | 160 |
public void toogleAdvancedMediaView() { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
55 | 55 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
56 | 56 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
57 | 57 |
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart; |
58 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
58 | 59 |
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship; |
59 | 60 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
60 | 61 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
285 | 286 |
|
286 | 287 |
} else if (input instanceof DerivedUnitFacade) { |
287 | 288 |
if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){ |
288 |
createFieldUnitSection(rootElement); |
|
289 |
if(((DerivedUnitFacade) input).innerFieldUnit()==null){ |
|
290 |
MessagingUtils.error(DetailsViewer.class, "FieldUnit of facade is null", null); |
|
291 |
} |
|
292 |
else{ |
|
293 |
createFieldUnitSection(rootElement); |
|
294 |
} |
|
289 | 295 |
} |
290 | 296 |
else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.PreservedSpecimen){ |
291 |
createDerivedUnitBaseElementSection(rootElement); |
|
297 |
if(((DerivedUnitFacade) input).innerDerivedUnit()==null){ |
|
298 |
MessagingUtils.error(DetailsViewer.class, "DerivedUnit of facade is null", null); |
|
299 |
} |
|
300 |
else{ |
|
301 |
createDerivedUnitBaseElementSection(rootElement); |
|
302 |
} |
|
292 | 303 |
} |
293 | 304 |
else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){ |
294 | 305 |
//TissueSample should only be created by using it's own class |
... | ... | |
659 | 670 |
destroySections(); |
660 | 671 |
|
661 | 672 |
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
662 |
//TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
|
|
673 |
//TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539 |
|
663 | 674 |
if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){ |
664 | 675 |
derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true); |
665 | 676 |
} |
Also available in: Unified diff