3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.view
.detail
;
15 import org
.eclipse
.jface
.viewers
.ISelection
;
16 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.ui
.forms
.widgets
.Section
;
21 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
22 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
23 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
24 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
27 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
29 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
30 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
31 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
32 import eu
.etaxonomy
.cdm
.model
.common
.User
;
33 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
34 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
35 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
36 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
37 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
38 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
39 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
40 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
41 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
42 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
43 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
45 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
46 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
47 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
48 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
49 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
50 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
51 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
52 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.DetailType
;
53 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.EntityDetailType
;
54 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
55 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
56 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
57 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GrantedAuthorityDetailSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
97 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
101 * DetailsViewer class.
105 * @created Feb 12, 2010
108 public class DetailsViewer
extends AbstractCdmDataViewer
{
110 private ISelection selection
;
114 * Constructor for DetailsViewer.
118 * a {@link org.eclipse.swt.widgets.Composite} object.
120 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
123 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
124 super(parent
, viewPart
);
127 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
128 // since we are getting implementations of DerivedUnitBase from the bulk
130 // and not derived unit facade objects,
136 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
140 public void setInput(Object input
) {
141 if (input
instanceof DerivedUnitBase
) {
143 input
= DerivedUnitFacade
.NewInstance((DerivedUnitBase
) input
,
144 PreferencesUtil
.getDerivedUnitConfigurator());
145 } catch (DerivedUnitFacadeNotSupportedException e
) {
146 StoreUtil
.error(getClass(), e
);
149 super.setInput(input
);
153 protected void markViewPartDirty() {
154 if (getInput() instanceof DerivedUnitFacade
) {
155 getViewPart().changed(
156 ((DerivedUnitFacade
) getInput()).innerDerivedUnit());
159 super.markViewPartDirty();
162 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
167 * @see org.eclipse.jface.viewers.Viewer#refresh()
171 protected void showParts() {
172 if (getInput() instanceof TaxonBase
) {
173 createTaxonSections(rootElement
);
175 } else if (getInput() instanceof NonViralName
) {
176 createNameSections(rootElement
);
178 } else if (getInput() instanceof Reference
) {
179 createReferenceSections(rootElement
);
181 } else if (getInput() instanceof Team
) {
182 createTeamDetailSection(rootElement
);
184 } else if (getInput() instanceof Person
) {
185 createPersonDetailSection(rootElement
);
187 } else if (getInput() instanceof TeamOrPersonBase
) {
188 createTeamOrPersonBaseDetailSection(rootElement
);
190 } else if (getInput() instanceof DescriptionBase
) {
191 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) getInput()).getMarkers();
192 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(UsageTermCollection
.uuidUseMarkerType
);
193 Boolean isUseDescription
= false;
194 for (Marker marker
: descriptionMarkers
) {
195 if (marker
.getMarkerType().equals(useMarkertype
)) {
196 isUseDescription
= true;
199 if (((DescriptionBase
) getInput()).isImageGallery()) {
200 createImageGallerySection(rootElement
);
202 } else if (isUseDescription
) {
203 createUseDescriptionSection(rootElement
);
205 createDescriptionSection(rootElement
);
208 } else if (getInput() instanceof DescriptionElementBase
) {
209 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) getInput()).getInDescription().getMarkers();
210 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(UsageTermCollection
.uuidUseMarkerType
);
211 Boolean isUseDescription
= false;
212 for (Marker marker
: descriptionMarkers
) {
213 if (marker
.getMarkerType().equals(useMarkertype
)) {
214 isUseDescription
= true;
218 if (isUseDescription
== true && getInput() instanceof CategoricalData
) {
219 createUseRecordSection(rootElement
);
222 createDescriptionElementSection(rootElement
);
225 } else if (getInput() instanceof Media
) {
226 createMediaElementSection(rootElement
);
228 } else if (getInput() instanceof DerivedUnitFacade
) {
229 createDerivedUnitBaseElementSection(rootElement
);
231 } else if (getInput() instanceof FeatureNodeContainer
) {
232 createFeatureDistributionSection(rootElement
);
234 } else if (getInput() instanceof PolytomousKey
) {
235 createPolytomousKeySection(rootElement
);
237 } else if ((getInput() instanceof PolytomousKeyNode
)
238 || (getInput() instanceof PolytomousKeyRelationship
)) {
239 createPolytomousKeyNodeSection(rootElement
);
241 } else if (getInput() instanceof User
) {
242 createUserSection(rootElement
);
244 } else if (getInput() instanceof Group
) {
245 createGroupSection(rootElement
);
247 } else if (getInput() instanceof TaxonRelationship
) {
248 createTaxonRelationshipSection(rootElement
);
250 } else if (getInput() instanceof TermVocabulary
) {
251 createTermVocabularySection(rootElement
);
253 } else if (getInput() instanceof DefinedTermBase
) {
254 createDefinedTermSection(rootElement
);
265 private void createGroupSection(RootElement parent
) {
268 GroupDetailSection groupDetailSection
= (GroupDetailSection
) formFactory
269 .createCdmDetailSection(DetailType
.GROUP
,
270 getConversationHolder(), parent
, this, Section
.TWISTIE
272 MemberDetailSection memberDetailSection
= (MemberDetailSection
) formFactory
273 .createEntityDetailSection(EntityDetailType
.MEMBER
,
274 getConversationHolder(), parent
, Section
.TWISTIE
276 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= (GrantedAuthorityDetailSection
) formFactory
277 .createEntityDetailSection(EntityDetailType
.GRANTED_AUTHORITY
,
278 getConversationHolder(), parent
, Section
.TWISTIE
281 addPart(groupDetailSection
);
282 addPart(memberDetailSection
);
283 addPart(grantedAuthorityDetailSection
);
289 * @see org.eclipse.jface.viewers.Viewer#getSelection()
293 public ISelection
getSelection() {
301 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
302 * .ISelection, boolean)
306 public void setSelection(ISelection selection
, boolean reveal
) {
307 this.selection
= selection
;
308 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(
310 fireSelectionChanged(selectionChangedEvent
);
313 private void createTaxonSections(RootElement parent
) {
316 TaxonBaseDetailSection taxonBaseDetailSection
= (TaxonBaseDetailSection
) formFactory
317 .createCdmDetailSection(DetailType
.TAXONBASE
,
318 getConversationHolder(), parent
, this, Section
.TWISTIE
);
320 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
322 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
323 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
324 getConversationHolder(), parent
, this, Section
.TWISTIE
327 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
329 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
330 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
331 getConversationHolder(), parent
, this, Section
.TWISTIE
);
333 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
335 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
336 .createEntityDetailSection(
337 EntityDetailType
.NOMENCLATURALSTATUS
,
338 getConversationHolder(), parent
, Section
.TWISTIE
);
340 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
342 ProtologueSection protologSection
= (ProtologueSection
) formFactory
343 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
344 getConversationHolder(), parent
, Section
.TWISTIE
);
346 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
348 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
349 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
350 getConversationHolder(), parent
, Section
.TWISTIE
);
352 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
354 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
355 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
356 getConversationHolder(), parent
, Section
.TWISTIE
);
358 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
360 ParsingMessagesSection parsingMessagesSection
= (ParsingMessagesSection
) formFactory
361 .createCdmDetailSection(DetailType
.PARSINGMESSAGE
,
362 getConversationHolder(), parent
, this, Section
.EXPANDED
);
364 addPart(taxonBaseDetailSection
);
365 addPart(nonViralNameSection
);
366 addPart(nomenclaturalStatusSection
);
367 addPart(protologSection
);
368 addPart(referenceDetailSection
);
369 addPart(typeDesignationSection
);
370 addPart(nameRelationshipSection
);
371 addPart(parsingMessagesSection
);
374 private void createNameSections(RootElement parent
) {
376 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
377 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
378 getConversationHolder(), parent
, this, Section
.TWISTIE
381 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
383 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
384 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
385 getConversationHolder(), parent
, this, Section
.TWISTIE
);
387 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
389 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
390 .createEntityDetailSection(
391 EntityDetailType
.NOMENCLATURALSTATUS
,
392 getConversationHolder(), parent
, Section
.TWISTIE
);
394 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
396 ProtologueSection protologSection
= (ProtologueSection
) formFactory
397 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
398 getConversationHolder(), parent
, Section
.TWISTIE
);
400 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
402 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
403 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
404 getConversationHolder(), parent
, Section
.TWISTIE
);
406 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
408 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
409 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
410 getConversationHolder(), parent
, Section
.TWISTIE
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 addPart(nonViralNameSection
);
415 addPart(nomenclaturalStatusSection
);
416 addPart(protologSection
);
417 addPart(referenceDetailSection
);
418 addPart(typeDesignationSection
);
419 addPart(nameRelationshipSection
);
422 private void createReferenceSections(RootElement parent
) {
425 ReferenceDetailSection referenceDetailSection
= (ReferenceDetailSection
) formFactory
426 .createCdmDetailSection(DetailType
.REFERENCEBASE
,
427 getConversationHolder(), parent
, this, Section
.TWISTIE
430 addPart(referenceDetailSection
);
433 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
435 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= (TeamOrPersonBaseDetailSection
) formFactory
436 .createCdmDetailSection(DetailType
.TEAMORPERSONBASE
,
437 getConversationHolder(), parent
, this, Section
.TWISTIE
440 addPart(teamOrPersonBaseDetailSection
);
443 private void createTeamDetailSection(RootElement parent
) {
445 TeamDetailSection teamDetailSection
= (TeamDetailSection
) formFactory
446 .createCdmDetailSection(DetailType
.TEAM
,
447 getConversationHolder(), parent
, this, Section
.TWISTIE
450 addPart(teamDetailSection
);
453 private void createPersonDetailSection(RootElement parent
) {
455 PersonDetailSection personDetailSection
= (PersonDetailSection
) formFactory
456 .createCdmDetailSection(DetailType
.PERSON
,
457 getConversationHolder(), parent
, this, Section
.TWISTIE
459 addPart(personDetailSection
);
462 private void createDescriptionElementSection(RootElement parent
) {
465 DescriptionElementDetailSection descriptionElementDetailSection
= (DescriptionElementDetailSection
) formFactory
466 .createCdmDetailSection(DetailType
.DESCRIPTIONELEMENT
,
467 getConversationHolder(), parent
, this, Section
.TWISTIE
470 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
472 DescriptionElementSourceSection descriptionElementSourceSection
= (DescriptionElementSourceSection
) formFactory
473 .createEntityDetailSection(
474 EntityDetailType
.DESCRIPTIONELEMENTSOURCE
,
475 getConversationHolder(), parent
, Section
.TWISTIE
);
477 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
479 DescriptionElementMediaSection descriptionElementMediaSection
= (DescriptionElementMediaSection
) formFactory
480 .createEntityDetailSection(
481 EntityDetailType
.DESCRIPTIONELEMENTMEDIA
,
482 getConversationHolder(), parent
, Section
.TWISTIE
);
484 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
486 addPart(descriptionElementDetailSection
);
487 addPart(descriptionElementSourceSection
);
488 addPart(descriptionElementMediaSection
);
491 private void createDescriptionSection(RootElement parent
) {
493 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
494 .createCdmDetailSection(DetailType
.DESCRIPTION
,
495 getConversationHolder(), parent
, this, Section
.TWISTIE
498 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
500 NaturalLanguageSection naturalLanguageSection
= (NaturalLanguageSection
) formFactory
501 .createCdmDetailSection(DetailType
.NATURAL_LANGUAGE
,
502 getConversationHolder(), parent
, this, Section
.TWISTIE
505 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
507 DescribedSpecimenSection describedSpecimenSection
= (DescribedSpecimenSection
) formFactory
508 .createEntityDetailSection(EntityDetailType
.DESCRIBED_SPECIMEN
,
509 getConversationHolder(), parent
, Section
.TWISTIE
);
511 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
513 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
514 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
515 getConversationHolder(), parent
, Section
.TWISTIE
);
517 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
519 ScopeSection scopeSection
= (ScopeSection
) formFactory
520 .createEntityDetailSection(EntityDetailType
.SCOPE
,
521 getConversationHolder(), parent
, Section
.TWISTIE
);
523 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
525 addPart(descriptionDetailSection
);
526 addPart(naturalLanguageSection
);
527 addPart(describedSpecimenSection
);
528 addPart(descriptionSourceSection
);
529 addPart(scopeSection
);
533 * Creates the use Description section
536 private void createUseDescriptionSection(RootElement parent
) {
538 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
539 .createCdmDetailSection(DetailType
.DESCRIPTION
,
540 getConversationHolder(), parent
, this, Section
.TWISTIE
543 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
545 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
546 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
547 getConversationHolder(), parent
, Section
.TWISTIE
550 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
552 addPart(descriptionDetailSection
);
553 addPart(descriptionSourceSection
);
561 private void createImageGallerySection(RootElement parent
) {
563 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
564 .createCdmDetailSection(DetailType
.DESCRIPTION
,
565 getConversationHolder(), parent
, this, Section
.TWISTIE
568 addPart(descriptionDetailSection
);
571 private void createMediaElementSection(RootElement parent
) {
573 MediaDetailsSection mediaDetailSection
= (MediaDetailsSection
) formFactory
574 .createCdmDetailSection(DetailType
.MEDIA
,
575 getConversationHolder(), parent
, this, Section
.TWISTIE
578 addPart(mediaDetailSection
);
581 private void createDerivedUnitBaseElementSection(RootElement parent
) {
584 GeneralDetailSection generalDetailSection
= (GeneralDetailSection
) formFactory
585 .createCdmDetailSection(DetailType
.DERIVED_UNIT_GENERAL
,
586 getConversationHolder(), parent
, this, Section
.TWISTIE
589 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
591 GatheringEventDetailSection gatheringEventDetailSection
= (GatheringEventDetailSection
) formFactory
592 .createCdmDetailSection(DetailType
.GATHERING_EVENT
,
593 getConversationHolder(), parent
, this, Section
.TWISTIE
);
595 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
597 FieldObservationDetailSection fieldObservationDetailSection
= (FieldObservationDetailSection
) formFactory
598 .createCdmDetailSection(DetailType
.FIELD_OBSERVATION
,
599 getConversationHolder(), parent
, this, Section
.TWISTIE
);
601 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
603 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= (DerivedUnitBaseDetailSection
) formFactory
604 .createCdmDetailSection(DetailType
.DERIVED_UNIT
,
605 getConversationHolder(), parent
, this, Section
.TWISTIE
);
607 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
609 DeterminationDetailSection determinationDetailSection
= (DeterminationDetailSection
) formFactory
610 .createCdmDetailSection(DetailType
.DETERMINATION
,
611 getConversationHolder(), parent
, this, Section
.TWISTIE
);
613 addPart(generalDetailSection
);
614 addPart(gatheringEventDetailSection
);
615 addPart(fieldObservationDetailSection
);
616 addPart(derivedUnitBaseDetailSection
);
617 addPart(determinationDetailSection
);
624 private void createFeatureDistributionSection(RootElement parent
) {
627 FeatureDistributionDetailSection featureDistributionSection
= (FeatureDistributionDetailSection
) formFactory
628 .createCdmDetailSection(DetailType
.FEATURE_DISTRIBUTION
,
629 getConversationHolder(), parent
, this, Section
.TWISTIE
632 addPart(featureDistributionSection
);
635 private void createPolytomousKeySection(RootElement parent
) {
638 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
639 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
,
640 getConversationHolder(), parent
, this, Section
.TWISTIE
643 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
645 GeographicalScopeDetailSection geographicalScopeDetailSection
= (GeographicalScopeDetailSection
) formFactory
646 .createEntityDetailSection(EntityDetailType
.GEOGRAPHICAL_SCOPE
,
647 getConversationHolder(), parent
, Section
.TWISTIE
);
649 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
651 ScopeRestrictionSection scopeRestrictionSection
= (ScopeRestrictionSection
) formFactory
652 .createEntityDetailSection(EntityDetailType
.SCOPE_RESTRICTION
,
653 getConversationHolder(), parent
, Section
.TWISTIE
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
658 .createEntityDetailSection(EntityDetailType
.TAXONOMIC_SCOPE
,
659 getConversationHolder(), parent
, Section
.TWISTIE
);
661 addPart(polytomousKeyDetailSection
);
662 addPart(geographicalScopeDetailSection
);
663 addPart(scopeRestrictionSection
);
664 addPart(taxonomicScopeSection
);
667 private void createPolytomousKeyNodeSection(RootElement parent
) {
670 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= (PolytomousKeyNodeDetailSection
) formFactory
671 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY_NODE
,
672 getConversationHolder(), parent
, this, Section
.TWISTIE
675 addPart(polytomousKeyNodeDetailSection
);
679 * create the UseRecordSection
682 private void createUseRecordSection(RootElement parent
) {
685 UseRecordDetailSection descriptionUseRecordSection
= (UseRecordDetailSection
) formFactory
686 .createCdmDetailSection(DetailType
.USE_RECORD
,
687 getConversationHolder(), parent
, this, Section
.TWISTIE
690 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
692 addPart(descriptionUseRecordSection
);
697 private void createUserSection(RootElement parent
) {
700 UserDetailSection userDetailSection
= (UserDetailSection
) formFactory
701 .createCdmDetailSection(DetailType
.USER
,
702 getConversationHolder(), parent
, this, Section
.TWISTIE
705 GroupsByUserDetailSection groupByUserDetailSection
= (GroupsByUserDetailSection
) formFactory
706 .createEntityDetailSection(EntityDetailType
.GROUPS_BY_USER
,
707 getConversationHolder(), parent
, Section
.TWISTIE
710 addPart(userDetailSection
);
711 addPart(groupByUserDetailSection
);
714 private void createTaxonRelationshipSection(RootElement parent
) {
717 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= (TaxonRelationshipDetailSection
) formFactory
718 .createCdmDetailSection(DetailType
.TAXON_RELATIONSHIP
,
719 getConversationHolder(), parent
, this, Section
.TWISTIE
722 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= (ReferencedEntityDetailSection
) formFactory
723 .createCdmDetailSection(DetailType
.REFERENCED_ENTITY
,
724 getConversationHolder(), parent
, this, Section
.TWISTIE
726 addPart(taxonRelationshipDetailSection
);
727 addPart(referencedEntityBaseDetailSection
);
733 private void createTermVocabularySection(RootElement parent
) {
736 TermVocabularyDetailSection termVocabularyDetailSection
= (TermVocabularyDetailSection
) formFactory
737 .createCdmDetailSection(DetailType
.TERM_VOCABULARY
,
738 getConversationHolder(), parent
, this, Section
.TWISTIE
740 addPart(termVocabularyDetailSection
);
743 private void createDefinedTermSection(RootElement parent
) {
746 AbstractFormSection definedTermDetailSection
= formFactory
747 .createDefinedTermDetailSection(getInput().getClass(),
748 getConversationHolder(), parent
, this, Section
.TWISTIE
750 addPart(definedTermDetailSection
);