4 * Copyright (C) 2011 EDIT
5 * European Distributed Institute of Taxonomy
6 * http://www.e-taxonomy.eu
8 * The contents of this file are subject to the Mozilla Public License Version 1.1
9 * See LICENSE.TXT at the top of this package for the full license terms.
12 package eu
.etaxonomy
.taxeditor
.view
.detail
;
16 import org
.eclipse
.jface
.viewers
.ISelection
;
17 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
18 import org
.eclipse
.jface
.viewers
.TreeNode
;
19 import org
.eclipse
.swt
.SWT
;
20 import org
.eclipse
.swt
.widgets
.Composite
;
21 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
24 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
25 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
26 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
28 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
29 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
30 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
31 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
32 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
33 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
34 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
35 import eu
.etaxonomy
.cdm
.model
.common
.User
;
36 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
37 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
38 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
39 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
40 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
41 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
42 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
43 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
44 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
45 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
46 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
49 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
50 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
51 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
52 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
53 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
54 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
55 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
56 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
57 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
58 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
59 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
60 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
124 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
128 * The DetailsViewer handles the content of the details view (
129 * {@link DetailsViewPart}).<br>
130 * Depending on the type of the selected element the section of the details view
134 * @created Feb 12, 2010
137 public class DetailsViewer
extends AbstractCdmDataViewer
{
139 private ISelection selection
;
143 * Constructor for DetailsViewer.
147 * a {@link org.eclipse.swt.widgets.Composite} object.
149 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
152 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
153 super(parent
, viewPart
);
156 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
157 // since we are getting implementations of DerivedUnitBase from the bulk
159 // and not derived unit facade objects,
165 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
169 public void setInput(Object input
) {
170 if(input
instanceof TreeNode
){
171 input
= ((TreeNode
) input
).getValue();
173 if(input
instanceof GbifResponse
){
174 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
176 if (input
.getClass().equals(DerivedUnit
.class)) {
177 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
179 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
180 PreferencesUtil
.getDerivedUnitConfigurator());
181 } catch (DerivedUnitFacadeNotSupportedException e
) {
182 // MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
185 else if(input
instanceof FieldUnit
){
186 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
188 super.setInput(input
);
192 protected void markViewPartDirty() {
193 if (getInput() instanceof DerivedUnitFacade
) {
194 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
195 if(facade
.innerDerivedUnit()!=null){
196 getViewPart().changed(facade
.innerDerivedUnit());
198 else if(facade
.innerFieldUnit()!=null){
199 getViewPart().changed(facade
.innerFieldUnit());
203 super.markViewPartDirty();
207 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
212 * @see org.eclipse.jface.viewers.Viewer#refresh()
216 protected void showParts() {
217 // FIXME (CM) : Need to clean out this code.
218 // Too much type checking to decide which detail view to display.
219 // Need to build in a mechanism where navigators / editors are 'aware'
220 // of the corresponding detail viewer.
221 Object input
= getInput();
224 if (input
instanceof TaxonBase
) {
225 createTaxonSections(rootElement
);
227 } else if (input
instanceof NonViralName
) {
228 createNameSections(rootElement
);
230 } else if (input
instanceof Reference
) {
231 createReferenceSections(rootElement
);
233 } else if (input
instanceof Team
) {
234 createTeamDetailSection(rootElement
);
236 } else if (input
instanceof Person
) {
237 createPersonDetailSection(rootElement
);
239 } else if (input
instanceof TeamOrPersonBase
) {
240 createTeamOrPersonBaseDetailSection(rootElement
);
242 } else if (input
instanceof DescriptionBase
) {
243 if(input
instanceof SpecimenDescription
){
244 //TODO: add more sections to DetailsView for SpecimenDescription
245 createSpecimenDescriptionSection(rootElement
);
248 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
249 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
250 UsageTermCollection
.uuidUseMarkerType
);
251 Boolean isUseDescription
= false;
252 for (Marker marker
: descriptionMarkers
) {
253 if (marker
.getMarkerType().equals(useMarkertype
)) {
254 isUseDescription
= true;
257 if (((DescriptionBase
) input
).isImageGallery()) {
258 createImageGallerySection(rootElement
);
260 } else if (isUseDescription
) {
261 createUseDescriptionSection(rootElement
);
263 createDescriptionSection(rootElement
);
267 } else if (input
instanceof DescriptionElementBase
) {
268 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
269 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
270 UsageTermCollection
.uuidUseMarkerType
);
271 Boolean isUseDescription
= false;
272 for (Marker marker
: descriptionMarkers
) {
273 if (marker
.getMarkerType().equals(useMarkertype
)) {
274 isUseDescription
= true;
278 if (isUseDescription
== true && input
instanceof CategoricalData
) {
279 createUseRecordSection(rootElement
);
281 createDescriptionElementSection(rootElement
);
284 } else if (input
instanceof Media
) {
285 createMediaElementSection(rootElement
);
287 } else if (input
instanceof DerivedUnitFacade
) {
288 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
289 createFieldUnitSection(rootElement
);
291 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
292 createDerivedUnitBaseElementSection(rootElement
);
294 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
295 //TissueSample should only be created by using it's own class
296 //in future using only one class with different SpecimenOrObservationTypes is desired
297 // createTissueSampleSection(rootElement);
299 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
300 createSpecimenScanSection(rootElement
);
302 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
303 createLivingPlantPhotoSection(rootElement
);
305 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
306 createMediaSpecimenSection(rootElement
);
309 createDerivedUnitBaseElementSection(rootElement
);
311 } else if (input
instanceof DnaSample
){
312 DnaSample dnaSample
= (DnaSample
)input
;
313 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
314 createTissueSampleSection(rootElement
);
316 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
317 createDnaSampleSection(rootElement
);
319 } else if (input
instanceof MediaSpecimen
){
320 createMediaSpecimenSection(rootElement
);
322 else if(input
instanceof Amplification
){
323 createAmplificationSection(rootElement
);
325 else if(input
instanceof Sequence
){
326 createSequenceSection(rootElement
);
328 else if(input
instanceof SingleRead
){
329 createSingleReadSection(rootElement
);
331 else if (input
instanceof FeatureNodeContainer
) {
332 createFeatureDistributionSection(rootElement
);
334 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
335 createPolytomousKeyNodeSection(rootElement
);
336 } else if (input
instanceof User
) {
337 createUserSection(rootElement
);
338 } else if (input
instanceof Group
) {
339 createGroupSection(rootElement
);
340 } else if (input
instanceof TaxonRelationship
) {
341 createTaxonRelationshipSection(rootElement
);
342 } else if (input
instanceof TermVocabulary
) {
343 createTermVocabularySection(rootElement
);
344 } else if (input
instanceof DefinedTermBase
) {
345 createDefinedTermSection(rootElement
);
348 createEmptySection(rootElement
);
357 private void createEmptySection(RootElement parent
) {
360 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
362 addPart(emptySection
);
368 private void createGroupSection(RootElement parent
) {
371 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
372 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
373 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
375 addPart(groupDetailSection
);
376 addPart(memberDetailSection
);
377 addPart(grantedAuthorityDetailSection
);
383 * @see org.eclipse.jface.viewers.Viewer#getSelection()
387 public ISelection
getSelection() {
395 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
396 * .ISelection, boolean)
400 public void setSelection(ISelection selection
, boolean reveal
) {
401 this.selection
= selection
;
402 if(this.selection
!=null){
403 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
404 fireSelectionChanged(selectionChangedEvent
);
409 * createTaxonSections(RootElement parent)
413 private void createTaxonSections(RootElement parent
) {
416 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
417 ExpandableComposite
.EXPANDED
| ExpandableComposite
.EXPANDED
);
419 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
420 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
421 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
423 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
424 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
425 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
427 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
428 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
429 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
431 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
432 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
433 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
436 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
437 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
438 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
440 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
441 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
443 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
444 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
446 addPart(protologSection
);
447 addPart(typeDesignationSection
);
448 addPart(nameRelationshipSection
);
452 addPart(parsingMessagesSection
);
453 addPart(taxonBaseDetailSection
);
454 addPart(nonViralNameSection
);
455 addPart(nomenclaturalStatusSection
);
456 addPart(referenceDetailSection
);
464 private void createNameSections(RootElement parent
) {
466 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
467 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
468 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
470 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
471 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
472 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
474 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
475 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
476 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
478 addPart(nonViralNameSection
);
479 addPart(nomenclaturalStatusSection
);
480 addPart(referenceDetailSection
);
482 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
483 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
484 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
486 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
487 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
489 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
490 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
491 addPart(protologSection
);
492 addPart(typeDesignationSection
);
493 addPart(nameRelationshipSection
);
498 * createReferenceSections
502 private void createReferenceSections(RootElement parent
) {
505 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
506 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
508 addPart(referenceDetailSection
);
512 * createTeamOrPersonBaseDetailSection
516 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
518 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
520 addPart(teamOrPersonBaseDetailSection
);
524 * createTeamDetailSection
528 private void createTeamDetailSection(RootElement parent
) {
530 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
532 addPart(teamDetailSection
);
536 * createPersonDetailSection
540 private void createPersonDetailSection(RootElement parent
) {
542 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
543 addPart(personDetailSection
);
547 * createDescriptionElementSection
551 private void createDescriptionElementSection(RootElement parent
) {
554 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
556 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
558 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
560 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
562 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
564 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
566 addPart(descriptionElementDetailSection
);
567 addPart(descriptionElementSourceSection
);
568 addPart(descriptionElementMediaSection
);
572 * createDescriptionSection
576 private void createDescriptionSection(RootElement parent
) {
578 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
580 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
582 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
584 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
586 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
588 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
590 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
591 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
592 // getConversationHolder(), parent, Section.TWISTIE);
594 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
596 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
598 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
600 addPart(descriptionDetailSection
);
601 addPart(naturalLanguageSection
);
602 addPart(describedSpecimenSection
);
603 // addPart(descriptionSourceSection);
604 addPart(scopeSection
);
608 * createDescriptionSection
612 private void createSpecimenDescriptionSection(RootElement parent
) {
614 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
615 addPart(descriptionDetailSection
);
619 * Creates the use Description section
623 private void createUseDescriptionSection(RootElement parent
) {
625 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
627 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
629 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
631 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
633 addPart(descriptionDetailSection
);
634 addPart(descriptionSourceSection
);
642 private void createImageGallerySection(RootElement parent
) {
644 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
646 addPart(descriptionDetailSection
);
650 * createMediaElementSection
655 private void createMediaElementSection(RootElement parent
) {
658 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
660 addPart(mediaDetailSection
);
664 * createDerivedUnitBaseElementSection
668 private void createDerivedUnitBaseElementSection(RootElement parent
) {
671 //different order of sections (Specimen Details as second section and expanded)
672 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
673 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
674 addPart(derivedUnitGeneralDetailSection
);
676 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
678 OriginalLabelDataSection originalLabelDataSection
= formFactory
.createOriginalLabelDataSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
679 addPart(originalLabelDataSection
);
681 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
683 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
684 addPart(derivedUnitBaseDetailSection
);
686 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
688 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
689 addPart(gatheringEventDetailSection
);
691 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
693 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
694 addPart(fieldUnitDetailSection
);
697 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
698 addPart(derivedUnitGeneralDetailSection
);
700 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
702 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
703 addPart(gatheringEventDetailSection
);
705 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
707 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
708 addPart(fieldUnitDetailSection
);
710 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
712 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
713 addPart(derivedUnitBaseDetailSection
);
715 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
717 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
718 addPart(determinationDetailSection
);
723 private void createFieldUnitSection(RootElement parent
) {
726 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
728 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
730 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
732 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
734 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
736 addPart(fielUnitGeneralDetailSection
);
737 addPart(gatheringEventDetailSection
);
738 addPart(fieldUnitDetailSection
);
740 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
741 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
742 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
743 addPart(determinationDetailSection
);
747 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
750 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
752 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
754 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
756 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
758 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
761 addPart(derivedUnitBaseDetailSection
);
762 addPart(determinationDetailSection
);
765 private void createTissueSampleSection(RootElement parent
) {
768 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
770 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
772 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
775 addPart(sampleDesignationDetailSection
);
778 private void createDnaSampleSection(RootElement parent
) {
781 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
783 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
785 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
787 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
789 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
792 addPart(qualitySection
);
793 addPart(sampleDesignationDetailSection
);
796 private void createAmplificationSection(RootElement parent
) {
798 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
800 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
802 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
804 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
806 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
808 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
810 AmplificationGelPhotoCollectionDetailSection gelPhotoSection
= formFactory
.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
813 addPart(generalSection
);
814 addPart(primerSection
);
815 addPart(cloningSection
);
816 addPart(gelPhotoSection
);
819 private void createSequenceSection(RootElement parent
) {
822 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
824 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
826 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
828 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
830 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
834 addPart(referenceSection
);
835 addPart(contigFileSection
);
838 private void createSingleReadSection(RootElement parent
) {
841 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
843 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
845 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
848 addPart(pherogramSection
);
851 private void createSpecimenScanSection(RootElement parent
) {
853 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
858 private void createLivingPlantPhotoSection(RootElement parent
) {
860 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
865 private void createMediaSpecimenSection(RootElement parent
) {
867 MediaSpecimenGeneralDetailSection section
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
877 private void createFeatureDistributionSection(RootElement parent
) {
880 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
882 addPart(featureDistributionSection
);
886 * createPolytomousKeyNodeSection
890 private void createPolytomousKeyNodeSection(RootElement parent
) {
893 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
895 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
897 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
899 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
901 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
903 addPart(polytomousKeyDetailSection
);
904 addPart(polytomousKeyNodeDetailSection
);
905 addPart(taxonomicScopeSection
);
910 * create the UseRecordSection
914 private void createUseRecordSection(RootElement parent
) {
917 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
919 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
921 addPart(descriptionUseRecordSection
);
931 private void createUserSection(RootElement parent
) {
934 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
936 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
938 addPart(userDetailSection
);
939 addPart(groupByUserDetailSection
);
943 * createTaxonRelationshipSection
947 private void createTaxonRelationshipSection(RootElement parent
) {
950 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
952 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
953 addPart(taxonRelationshipDetailSection
);
954 addPart(referencedEntityBaseDetailSection
);
960 private void createTermVocabularySection(RootElement parent
) {
963 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
964 addPart(termVocabularyDetailSection
);
968 * createDefinedTermSection
972 private void createDefinedTermSection(RootElement parent
) {
975 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
976 addPart(definedTermDetailSection
);