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
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
20 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
22 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
24 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
29 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
30 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
31 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
32 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
33 import eu
.etaxonomy
.cdm
.model
.common
.User
;
34 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
35 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
36 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
37 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
38 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
39 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
40 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
41 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
42 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
43 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
44 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
45 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
46 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
49 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
50 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
51 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
52 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
53 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
54 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
55 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
56 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
57 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
58 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
59 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
116 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
120 * The DetailsViewer handles the content of the details view (
121 * {@link DetailsViewPart}).<br>
122 * Depending on the type of the selected element the section of the details view
126 * @created Feb 12, 2010
129 public class DetailsViewer
extends AbstractCdmDataViewer
{
131 private ISelection selection
;
135 * Constructor for DetailsViewer.
139 * a {@link org.eclipse.swt.widgets.Composite} object.
141 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
144 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
145 super(parent
, viewPart
);
148 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
149 // since we are getting implementations of DerivedUnitBase from the bulk
151 // and not derived unit facade objects,
157 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
161 public void setInput(Object input
) {
162 if (input
.getClass().equals(DerivedUnit
.class)) {
163 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
165 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
166 PreferencesUtil
.getDerivedUnitConfigurator());
167 } catch (DerivedUnitFacadeNotSupportedException e
) {
168 AbstractUtility
.error(getClass(), e
);
171 else if(input
instanceof FieldUnit
){
172 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
174 super.setInput(input
);
178 protected void markViewPartDirty() {
179 if (getInput() instanceof DerivedUnitFacade
) {
180 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
181 if(facade
.innerDerivedUnit()!=null){
182 getViewPart().changed(facade
.innerDerivedUnit());
184 else if(facade
.innerFieldUnit()!=null){
185 getViewPart().changed(facade
.innerFieldUnit());
189 super.markViewPartDirty();
193 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
198 * @see org.eclipse.jface.viewers.Viewer#refresh()
202 protected void showParts() {
203 // FIXME (CM) : Need to clean out this code.
204 // Too much type checking to decide which detail view to display.
205 // Need to build in a mechanism where navigators / editors are 'aware'
206 // of the corresponding detail viewer.
207 Object input
= getInput();
210 if (input
instanceof TaxonBase
) {
211 createTaxonSections(rootElement
);
213 } else if (input
instanceof NonViralName
) {
214 createNameSections(rootElement
);
216 } else if (input
instanceof Reference
) {
217 createReferenceSections(rootElement
);
219 } else if (input
instanceof Team
) {
220 createTeamDetailSection(rootElement
);
222 } else if (input
instanceof Person
) {
223 createPersonDetailSection(rootElement
);
225 } else if (input
instanceof TeamOrPersonBase
) {
226 createTeamOrPersonBaseDetailSection(rootElement
);
228 } else if (input
instanceof DescriptionBase
) {
229 if(input
instanceof SpecimenDescription
){
230 //TODO: add more sections to DetailsView for SpecimenDescription
231 createSpecimenDescriptionSection(rootElement
);
234 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
235 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
236 UsageTermCollection
.uuidUseMarkerType
);
237 Boolean isUseDescription
= false;
238 for (Marker marker
: descriptionMarkers
) {
239 if (marker
.getMarkerType().equals(useMarkertype
)) {
240 isUseDescription
= true;
243 if (((DescriptionBase
) input
).isImageGallery()) {
244 createImageGallerySection(rootElement
);
246 } else if (isUseDescription
) {
247 createUseDescriptionSection(rootElement
);
249 createDescriptionSection(rootElement
);
253 } else if (input
instanceof DescriptionElementBase
) {
254 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
255 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
256 UsageTermCollection
.uuidUseMarkerType
);
257 Boolean isUseDescription
= false;
258 for (Marker marker
: descriptionMarkers
) {
259 if (marker
.getMarkerType().equals(useMarkertype
)) {
260 isUseDescription
= true;
264 if (isUseDescription
== true && input
instanceof CategoricalData
) {
265 createUseRecordSection(rootElement
);
267 createDescriptionElementSection(rootElement
);
270 } else if (input
instanceof Media
) {
271 createMediaElementSection(rootElement
);
273 } else if (input
instanceof DerivedUnitFacade
) {
274 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
275 createFieldUnitSection(rootElement
);
277 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
278 createDerivedUnitBaseElementSection(rootElement
);
280 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
281 createTissueSampleSection(rootElement
);
283 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
284 createSpecimenScanSection(rootElement
);
286 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
287 createLivingPlantPhotoSection(rootElement
);
289 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
290 createMediaSpecimenSection(rootElement
);
293 createDerivedUnitBaseElementSection(rootElement
);
295 } else if (input
instanceof DnaSample
){
296 createDnaSampleSection(rootElement
);
297 } else if (input
instanceof MediaSpecimen
){
298 createMediaSpecimenSection(rootElement
);
300 else if(input
instanceof Amplification
){
301 createAmplificationSection(rootElement
);
303 else if(input
instanceof Sequence
){
304 createSequenceSection(rootElement
);
306 else if(input
instanceof SingleRead
){
307 createSingleReadSection(rootElement
);
309 else if (input
instanceof FeatureNodeContainer
) {
310 createFeatureDistributionSection(rootElement
);
312 } else if (input
instanceof PolytomousKey
) {
313 //createPolytomousKeySection(rootElement);
315 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
316 createPolytomousKeyNodeSection(rootElement
);
317 } else if (input
instanceof User
) {
318 createUserSection(rootElement
);
319 } else if (input
instanceof Group
) {
320 createGroupSection(rootElement
);
321 } else if (input
instanceof TaxonRelationship
) {
322 createTaxonRelationshipSection(rootElement
);
323 } else if (input
instanceof TermVocabulary
) {
324 createTermVocabularySection(rootElement
);
325 } else if (input
instanceof DefinedTermBase
) {
326 createDefinedTermSection(rootElement
);
328 if(managedForm
.getParts().length
==0) {
329 createEmptySection(rootElement
);
338 private void createEmptySection(RootElement parent
) {
341 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
343 addPart(emptySection
);
349 private void createGroupSection(RootElement parent
) {
352 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
353 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
354 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
356 addPart(groupDetailSection
);
357 addPart(memberDetailSection
);
358 addPart(grantedAuthorityDetailSection
);
364 * @see org.eclipse.jface.viewers.Viewer#getSelection()
368 public ISelection
getSelection() {
376 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
377 * .ISelection, boolean)
381 public void setSelection(ISelection selection
, boolean reveal
) {
382 this.selection
= selection
;
383 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
384 fireSelectionChanged(selectionChangedEvent
);
388 * createTaxonSections(RootElement parent)
392 private void createTaxonSections(RootElement parent
) {
395 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
397 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
399 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
400 | ExpandableComposite
.EXPANDED
);
402 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
404 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
406 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
408 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
410 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
412 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
414 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
416 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
418 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
420 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
422 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
424 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
426 addPart(taxonBaseDetailSection
);
427 addPart(nonViralNameSection
);
428 addPart(nomenclaturalStatusSection
);
429 addPart(protologSection
);
430 addPart(referenceDetailSection
);
431 addPart(typeDesignationSection
);
432 addPart(nameRelationshipSection
);
433 addPart(parsingMessagesSection
);
441 private void createNameSections(RootElement parent
) {
443 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
445 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
447 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
449 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
451 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
453 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
455 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
457 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
459 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
461 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
463 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
465 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
467 addPart(nonViralNameSection
);
468 addPart(nomenclaturalStatusSection
);
469 addPart(protologSection
);
470 addPart(referenceDetailSection
);
471 addPart(typeDesignationSection
);
472 addPart(nameRelationshipSection
);
476 * createReferenceSections
480 private void createReferenceSections(RootElement parent
) {
483 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
485 addPart(referenceDetailSection
);
489 * createTeamOrPersonBaseDetailSection
493 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
495 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
497 addPart(teamOrPersonBaseDetailSection
);
501 * createTeamDetailSection
505 private void createTeamDetailSection(RootElement parent
) {
507 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
509 addPart(teamDetailSection
);
513 * createPersonDetailSection
517 private void createPersonDetailSection(RootElement parent
) {
519 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
520 addPart(personDetailSection
);
524 * createDescriptionElementSection
528 private void createDescriptionElementSection(RootElement parent
) {
531 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
533 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
535 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
537 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
539 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
541 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
543 addPart(descriptionElementDetailSection
);
544 addPart(descriptionElementSourceSection
);
545 addPart(descriptionElementMediaSection
);
549 * createDescriptionSection
553 private void createDescriptionSection(RootElement parent
) {
555 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
557 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
559 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
561 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
563 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
565 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
567 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
568 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
569 // getConversationHolder(), parent, Section.TWISTIE);
571 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
573 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
575 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
577 addPart(descriptionDetailSection
);
578 addPart(naturalLanguageSection
);
579 addPart(describedSpecimenSection
);
580 // addPart(descriptionSourceSection);
581 addPart(scopeSection
);
585 * createDescriptionSection
589 private void createSpecimenDescriptionSection(RootElement parent
) {
591 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
592 addPart(descriptionDetailSection
);
596 * Creates the use Description section
600 private void createUseDescriptionSection(RootElement parent
) {
602 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
604 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
606 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
608 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
610 addPart(descriptionDetailSection
);
611 addPart(descriptionSourceSection
);
619 private void createImageGallerySection(RootElement parent
) {
621 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
623 addPart(descriptionDetailSection
);
627 * createMediaElementSection
632 private void createMediaElementSection(RootElement parent
) {
635 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
637 addPart(mediaDetailSection
);
641 * createDerivedUnitBaseElementSection
645 private void createDerivedUnitBaseElementSection(RootElement parent
) {
648 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
650 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
652 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
654 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
656 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
658 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
660 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
662 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
664 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
666 addPart(derivedUnitGeneralDetailSection
);
667 addPart(gatheringEventDetailSection
);
668 addPart(fieldUnitDetailSection
);
669 addPart(derivedUnitBaseDetailSection
);
670 addPart(determinationDetailSection
);
674 private void createFieldUnitSection(RootElement parent
) {
677 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
679 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
681 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
683 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
685 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
687 addPart(fielUnitGeneralDetailSection
);
688 addPart(gatheringEventDetailSection
);
689 addPart(fieldUnitDetailSection
);
692 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
695 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
697 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
699 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
701 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
703 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
706 addPart(derivedUnitBaseDetailSection
);
707 addPart(determinationDetailSection
);
710 private void createTissueSampleSection(RootElement parent
) {
713 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
718 private void createDnaSampleSection(RootElement parent
) {
720 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
725 private void createAmplificationSection(RootElement parent
) {
727 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
729 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
731 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
733 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
735 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
738 addPart(generalSection
);
739 addPart(primerSection
);
740 addPart(cloningSection
);
743 private void createSequenceSection(RootElement parent
) {
745 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
750 private void createSingleReadSection(RootElement parent
) {
752 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
757 private void createSpecimenScanSection(RootElement parent
) {
759 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
764 private void createLivingPlantPhotoSection(RootElement parent
) {
766 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
771 private void createMediaSpecimenSection(RootElement parent
) {
773 MediaSpecimenGeneralDetailSection section
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
783 private void createFeatureDistributionSection(RootElement parent
) {
786 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
788 addPart(featureDistributionSection
);
792 * createPolytomousKeyNodeSection
796 private void createPolytomousKeyNodeSection(RootElement parent
) {
799 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
801 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
803 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
805 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
807 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
809 addPart(polytomousKeyDetailSection
);
810 addPart(polytomousKeyNodeDetailSection
);
811 addPart(taxonomicScopeSection
);
816 * create the UseRecordSection
820 private void createUseRecordSection(RootElement parent
) {
823 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
825 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
827 addPart(descriptionUseRecordSection
);
837 private void createUserSection(RootElement parent
) {
840 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
842 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
844 addPart(userDetailSection
);
845 addPart(groupByUserDetailSection
);
849 * createTaxonRelationshipSection
853 private void createTaxonRelationshipSection(RootElement parent
) {
856 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
858 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
859 addPart(taxonRelationshipDetailSection
);
860 addPart(referencedEntityBaseDetailSection
);
866 private void createTermVocabularySection(RootElement parent
) {
869 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
870 addPart(termVocabularyDetailSection
);
874 * createDefinedTermSection
878 private void createDefinedTermSection(RootElement parent
) {
881 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
882 addPart(definedTermDetailSection
);