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
.Sequence
;
43 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
44 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
45 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
46 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
48 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
49 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
50 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
51 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
52 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
53 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
54 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
55 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
56 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
57 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
59 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.AmplificationGeneralDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.ArtworkGeneralDetailSection
;
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
.DnaSampleGeneralDetailSection
;
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
.LivingPlantPhotoGeneralDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDeterminationDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenGeneralDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SequenceGeneralDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenScanGeneralDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.TissueSampleGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
110 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
114 * The DetailsViewer handles the content of the details view (
115 * {@link DetailsViewPart}).<br>
116 * Depending on the type of the selected element the section of the details view
120 * @created Feb 12, 2010
123 public class DetailsViewer
extends AbstractCdmDataViewer
{
125 private ISelection selection
;
129 * Constructor for DetailsViewer.
133 * a {@link org.eclipse.swt.widgets.Composite} object.
135 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
138 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
139 super(parent
, viewPart
);
142 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
143 // since we are getting implementations of DerivedUnitBase from the bulk
145 // and not derived unit facade objects,
151 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
155 public void setInput(Object input
) {
156 if (input
instanceof DerivedUnit
) {
157 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
158 if(derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.PreservedSpecimen
159 ||derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
160 // Do nothing! This is the case if the new DetailsViews are used that are based on
161 // the DerivedUnits themselves instead of the DerivedUnitFacade
165 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
166 PreferencesUtil
.getDerivedUnitConfigurator());
167 } catch (DerivedUnitFacadeNotSupportedException e
) {
168 AbstractUtility
.error(getClass(), e
);
172 else if(input
instanceof FieldUnit
){
173 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
175 super.setInput(input
);
179 protected void markViewPartDirty() {
180 if (getInput() instanceof DerivedUnitFacade
) {
181 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
182 if(facade
.innerDerivedUnit()!=null){
183 getViewPart().changed(facade
.innerDerivedUnit());
185 else if(facade
.innerFieldUnit()!=null){
186 getViewPart().changed(facade
.innerFieldUnit());
190 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();
208 if (input
instanceof TaxonBase
) {
209 createTaxonSections(rootElement
);
211 } else if (input
instanceof NonViralName
) {
212 createNameSections(rootElement
);
214 } else if (input
instanceof Reference
) {
215 createReferenceSections(rootElement
);
217 } else if (input
instanceof Team
) {
218 createTeamDetailSection(rootElement
);
220 } else if (input
instanceof Person
) {
221 createPersonDetailSection(rootElement
);
223 } else if (input
instanceof TeamOrPersonBase
) {
224 createTeamOrPersonBaseDetailSection(rootElement
);
226 } else if (input
instanceof DescriptionBase
) {
227 if(input
instanceof SpecimenDescription
){
228 //TODO: add more sections to DetailsView for SpecimenDescription
229 createSpecimenDescriptionSection(rootElement
);
232 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
233 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
234 UsageTermCollection
.uuidUseMarkerType
);
235 Boolean isUseDescription
= false;
236 for (Marker marker
: descriptionMarkers
) {
237 if (marker
.getMarkerType().equals(useMarkertype
)) {
238 isUseDescription
= true;
241 if (((DescriptionBase
) input
).isImageGallery()) {
242 createImageGallerySection(rootElement
);
244 } else if (isUseDescription
) {
245 createUseDescriptionSection(rootElement
);
247 createDescriptionSection(rootElement
);
251 } else if (input
instanceof DescriptionElementBase
) {
252 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
253 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
254 UsageTermCollection
.uuidUseMarkerType
);
255 Boolean isUseDescription
= false;
256 for (Marker marker
: descriptionMarkers
) {
257 if (marker
.getMarkerType().equals(useMarkertype
)) {
258 isUseDescription
= true;
262 if (isUseDescription
== true && input
instanceof CategoricalData
) {
263 createUseRecordSection(rootElement
);
265 createDescriptionElementSection(rootElement
);
268 } else if (input
instanceof Media
) {
269 createMediaElementSection(rootElement
);
271 } else if (input
instanceof DerivedUnitFacade
) {
272 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
273 createFieldUnitSection(rootElement
);
275 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
276 createDerivedUnitBaseElementSection(rootElement
);
278 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
279 createTissueSampleSection(rootElement
);
281 // else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.DnaSample){
282 // createDnaSampleSection(rootElement);
284 //FIXME: change to specific SpecimenOrObservationType
285 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
286 createSpecimenScanSection(rootElement
);
288 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
289 createLivingPlantPhotoSection(rootElement
);
291 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
292 createArtworkSection(rootElement
);
295 createDerivedUnitBaseElementSection(rootElement
);
297 } else if (input
instanceof SpecimenOrObservationBase
){
298 SpecimenOrObservationType recordBasis
= ((SpecimenOrObservationBase
<?
>) input
).getRecordBasis();
299 if(recordBasis
==SpecimenOrObservationType
.PreservedSpecimen
){
300 createPreservedSpecimenSpecimenSection(rootElement
);
302 else if(recordBasis
==SpecimenOrObservationType
.FieldUnit
){
303 createFieldUnitSection(rootElement
);
305 else if(recordBasis
==SpecimenOrObservationType
.DnaSample
){
306 createDnaSampleSection(rootElement
);
309 else if(input
instanceof Amplification
){
310 createAmplificationSection(rootElement
);
312 else if(input
instanceof Sequence
){
313 createSequenceSection(rootElement
);
315 else if (input
instanceof FeatureNodeContainer
) {
316 createFeatureDistributionSection(rootElement
);
318 } else if (input
instanceof PolytomousKey
) {
319 //createPolytomousKeySection(rootElement);
321 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
322 createPolytomousKeyNodeSection(rootElement
);
323 } else if (input
instanceof User
) {
324 createUserSection(rootElement
);
325 } else if (input
instanceof Group
) {
326 createGroupSection(rootElement
);
327 } else if (input
instanceof TaxonRelationship
) {
328 createTaxonRelationshipSection(rootElement
);
329 } else if (input
instanceof TermVocabulary
) {
330 createTermVocabularySection(rootElement
);
331 } else if (input
instanceof DefinedTermBase
) {
332 createDefinedTermSection(rootElement
);
343 private void createGroupSection(RootElement parent
) {
346 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
347 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
348 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
350 addPart(groupDetailSection
);
351 addPart(memberDetailSection
);
352 addPart(grantedAuthorityDetailSection
);
358 * @see org.eclipse.jface.viewers.Viewer#getSelection()
362 public ISelection
getSelection() {
370 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
371 * .ISelection, boolean)
375 public void setSelection(ISelection selection
, boolean reveal
) {
376 this.selection
= selection
;
377 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
378 fireSelectionChanged(selectionChangedEvent
);
382 * createTaxonSections(RootElement parent)
386 private void createTaxonSections(RootElement parent
) {
389 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
391 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
393 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
394 | ExpandableComposite
.EXPANDED
);
396 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
398 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
400 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
402 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
404 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
406 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
408 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
410 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
416 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
418 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
420 addPart(taxonBaseDetailSection
);
421 addPart(nonViralNameSection
);
422 addPart(nomenclaturalStatusSection
);
423 addPart(protologSection
);
424 addPart(referenceDetailSection
);
425 addPart(typeDesignationSection
);
426 addPart(nameRelationshipSection
);
427 addPart(parsingMessagesSection
);
435 private void createNameSections(RootElement parent
) {
437 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
439 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
441 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
443 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
445 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
447 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
449 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
451 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
453 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
455 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
457 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
459 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
461 addPart(nonViralNameSection
);
462 addPart(nomenclaturalStatusSection
);
463 addPart(protologSection
);
464 addPart(referenceDetailSection
);
465 addPart(typeDesignationSection
);
466 addPart(nameRelationshipSection
);
470 * createReferenceSections
474 private void createReferenceSections(RootElement parent
) {
477 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
479 addPart(referenceDetailSection
);
483 * createTeamOrPersonBaseDetailSection
487 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
489 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
491 addPart(teamOrPersonBaseDetailSection
);
495 * createTeamDetailSection
499 private void createTeamDetailSection(RootElement parent
) {
501 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
503 addPart(teamDetailSection
);
507 * createPersonDetailSection
511 private void createPersonDetailSection(RootElement parent
) {
513 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
514 addPart(personDetailSection
);
518 * createDescriptionElementSection
522 private void createDescriptionElementSection(RootElement parent
) {
525 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
527 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
529 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
531 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
533 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 addPart(descriptionElementDetailSection
);
538 addPart(descriptionElementSourceSection
);
539 addPart(descriptionElementMediaSection
);
543 * createDescriptionSection
547 private void createDescriptionSection(RootElement parent
) {
549 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
551 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
553 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
555 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
557 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
559 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
561 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
562 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
563 // getConversationHolder(), parent, Section.TWISTIE);
565 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
567 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
569 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
571 addPart(descriptionDetailSection
);
572 addPart(naturalLanguageSection
);
573 addPart(describedSpecimenSection
);
574 // addPart(descriptionSourceSection);
575 addPart(scopeSection
);
579 * createDescriptionSection
583 private void createSpecimenDescriptionSection(RootElement parent
) {
585 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
586 addPart(descriptionDetailSection
);
590 * Creates the use Description section
594 private void createUseDescriptionSection(RootElement parent
) {
596 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
598 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
600 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
602 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
604 addPart(descriptionDetailSection
);
605 addPart(descriptionSourceSection
);
613 private void createImageGallerySection(RootElement parent
) {
615 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
617 addPart(descriptionDetailSection
);
621 * createMediaElementSection
626 private void createMediaElementSection(RootElement parent
) {
628 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
630 addPart(mediaDetailSection
);
634 * createDerivedUnitBaseElementSection
638 private void createDerivedUnitBaseElementSection(RootElement parent
) {
641 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
643 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
645 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
647 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
649 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
651 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
653 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
659 addPart(derivedUnitGeneralDetailSection
);
660 addPart(gatheringEventDetailSection
);
661 addPart(fieldUnitDetailSection
);
662 addPart(derivedUnitBaseDetailSection
);
663 addPart(determinationDetailSection
);
667 private void createFieldUnitSection(RootElement parent
) {
670 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
672 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
674 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
676 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
678 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
680 addPart(fielUnitGeneralDetailSection
);
681 addPart(gatheringEventDetailSection
);
682 addPart(fieldUnitDetailSection
);
685 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
688 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
690 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
692 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
694 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
696 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
699 addPart(derivedUnitBaseDetailSection
);
700 addPart(determinationDetailSection
);
703 private void createTissueSampleSection(RootElement parent
) {
706 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
708 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
713 private void createDnaSampleSection(RootElement parent
) {
715 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
717 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
722 private void createAmplificationSection(RootElement parent
) {
724 AmplificationGeneralDetailSection section
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
726 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
731 private void createSequenceSection(RootElement parent
) {
733 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
735 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
740 private void createSpecimenScanSection(RootElement parent
) {
742 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
744 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
749 private void createLivingPlantPhotoSection(RootElement parent
) {
751 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
753 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
758 private void createArtworkSection(RootElement parent
) {
760 ArtworkGeneralDetailSection section
= formFactory
.createArtworkGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
762 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
772 private void createFeatureDistributionSection(RootElement parent
) {
775 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
777 addPart(featureDistributionSection
);
781 * createPolytomousKeyNodeSection
785 private void createPolytomousKeyNodeSection(RootElement parent
) {
788 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
790 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
792 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
794 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
796 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
798 addPart(polytomousKeyDetailSection
);
799 addPart(polytomousKeyNodeDetailSection
);
800 addPart(taxonomicScopeSection
);
805 * create the UseRecordSection
809 private void createUseRecordSection(RootElement parent
) {
812 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
814 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
816 addPart(descriptionUseRecordSection
);
826 private void createUserSection(RootElement parent
) {
829 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
831 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
833 addPart(userDetailSection
);
834 addPart(groupByUserDetailSection
);
838 * createTaxonRelationshipSection
842 private void createTaxonRelationshipSection(RootElement parent
) {
845 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
847 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
848 addPart(taxonRelationshipDetailSection
);
849 addPart(referencedEntityBaseDetailSection
);
855 private void createTermVocabularySection(RootElement parent
) {
858 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
859 addPart(termVocabularyDetailSection
);
863 * createDefinedTermSection
867 private void createDefinedTermSection(RootElement parent
) {
870 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
871 addPart(definedTermDetailSection
);