3 * Copyright (C) 2011 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
.grantedAuthority
.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
);
314 * createTaxonSections(RootElement parent)
317 private void createTaxonSections(RootElement parent
) {
320 TaxonBaseDetailSection taxonBaseDetailSection
= (TaxonBaseDetailSection
) formFactory
321 .createCdmDetailSection(DetailType
.TAXONBASE
,
322 getConversationHolder(), parent
, this, Section
.TWISTIE
);
324 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
326 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
327 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
328 getConversationHolder(), parent
, this, Section
.TWISTIE
331 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
333 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
334 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
335 getConversationHolder(), parent
, this, Section
.TWISTIE
);
337 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
339 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
340 .createEntityDetailSection(
341 EntityDetailType
.NOMENCLATURALSTATUS
,
342 getConversationHolder(), parent
, Section
.TWISTIE
);
344 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
346 ProtologueSection protologSection
= (ProtologueSection
) formFactory
347 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
348 getConversationHolder(), parent
, Section
.TWISTIE
);
350 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
352 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
353 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
354 getConversationHolder(), parent
, Section
.TWISTIE
);
356 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
358 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
359 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
360 getConversationHolder(), parent
, Section
.TWISTIE
);
362 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
364 ParsingMessagesSection parsingMessagesSection
= (ParsingMessagesSection
) formFactory
365 .createCdmDetailSection(DetailType
.PARSINGMESSAGE
,
366 getConversationHolder(), parent
, this, Section
.EXPANDED
);
368 addPart(taxonBaseDetailSection
);
369 addPart(nonViralNameSection
);
370 addPart(nomenclaturalStatusSection
);
371 addPart(protologSection
);
372 addPart(referenceDetailSection
);
373 addPart(typeDesignationSection
);
374 addPart(nameRelationshipSection
);
375 addPart(parsingMessagesSection
);
382 private void createNameSections(RootElement parent
) {
384 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
385 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
386 getConversationHolder(), parent
, this, Section
.TWISTIE
389 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
391 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
392 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
393 getConversationHolder(), parent
, this, Section
.TWISTIE
);
395 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
397 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
398 .createEntityDetailSection(
399 EntityDetailType
.NOMENCLATURALSTATUS
,
400 getConversationHolder(), parent
, Section
.TWISTIE
);
402 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
404 ProtologueSection protologSection
= (ProtologueSection
) formFactory
405 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
406 getConversationHolder(), parent
, Section
.TWISTIE
);
408 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
410 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
411 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
412 getConversationHolder(), parent
, Section
.TWISTIE
);
414 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
416 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
417 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
418 getConversationHolder(), parent
, Section
.TWISTIE
);
420 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
422 addPart(nonViralNameSection
);
423 addPart(nomenclaturalStatusSection
);
424 addPart(protologSection
);
425 addPart(referenceDetailSection
);
426 addPart(typeDesignationSection
);
427 addPart(nameRelationshipSection
);
431 * createReferenceSections
434 private void createReferenceSections(RootElement parent
) {
437 ReferenceDetailSection referenceDetailSection
= (ReferenceDetailSection
) formFactory
438 .createCdmDetailSection(DetailType
.REFERENCEBASE
,
439 getConversationHolder(), parent
, this, Section
.TWISTIE
442 addPart(referenceDetailSection
);
446 * createTeamOrPersonBaseDetailSection
449 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
451 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= (TeamOrPersonBaseDetailSection
) formFactory
452 .createCdmDetailSection(DetailType
.TEAMORPERSONBASE
,
453 getConversationHolder(), parent
, this, Section
.TWISTIE
456 addPart(teamOrPersonBaseDetailSection
);
460 * createTeamDetailSection
463 private void createTeamDetailSection(RootElement parent
) {
465 TeamDetailSection teamDetailSection
= (TeamDetailSection
) formFactory
466 .createCdmDetailSection(DetailType
.TEAM
,
467 getConversationHolder(), parent
, this, Section
.TWISTIE
470 addPart(teamDetailSection
);
474 * createPersonDetailSection
477 private void createPersonDetailSection(RootElement parent
) {
479 PersonDetailSection personDetailSection
= (PersonDetailSection
) formFactory
480 .createCdmDetailSection(DetailType
.PERSON
,
481 getConversationHolder(), parent
, this, Section
.TWISTIE
483 addPart(personDetailSection
);
487 * createDescriptionElementSection
490 private void createDescriptionElementSection(RootElement parent
) {
493 DescriptionElementDetailSection descriptionElementDetailSection
= (DescriptionElementDetailSection
) formFactory
494 .createCdmDetailSection(DetailType
.DESCRIPTIONELEMENT
,
495 getConversationHolder(), parent
, this, Section
.TWISTIE
498 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
500 DescriptionElementSourceSection descriptionElementSourceSection
= (DescriptionElementSourceSection
) formFactory
501 .createEntityDetailSection(
502 EntityDetailType
.DESCRIPTIONELEMENTSOURCE
,
503 getConversationHolder(), parent
, Section
.TWISTIE
);
505 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
507 DescriptionElementMediaSection descriptionElementMediaSection
= (DescriptionElementMediaSection
) formFactory
508 .createEntityDetailSection(
509 EntityDetailType
.DESCRIPTIONELEMENTMEDIA
,
510 getConversationHolder(), parent
, Section
.TWISTIE
);
512 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
514 addPart(descriptionElementDetailSection
);
515 addPart(descriptionElementSourceSection
);
516 addPart(descriptionElementMediaSection
);
520 * createDescriptionSection
523 private void createDescriptionSection(RootElement parent
) {
525 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
526 .createCdmDetailSection(DetailType
.DESCRIPTION
,
527 getConversationHolder(), parent
, this, Section
.TWISTIE
530 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
532 NaturalLanguageSection naturalLanguageSection
= (NaturalLanguageSection
) formFactory
533 .createCdmDetailSection(DetailType
.NATURAL_LANGUAGE
,
534 getConversationHolder(), parent
, this, Section
.TWISTIE
537 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
539 DescribedSpecimenSection describedSpecimenSection
= (DescribedSpecimenSection
) formFactory
540 .createEntityDetailSection(EntityDetailType
.DESCRIBED_SPECIMEN
,
541 getConversationHolder(), parent
, Section
.TWISTIE
);
543 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
545 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
546 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
547 getConversationHolder(), parent
, Section
.TWISTIE
);
549 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
551 ScopeSection scopeSection
= (ScopeSection
) formFactory
552 .createEntityDetailSection(EntityDetailType
.SCOPE
,
553 getConversationHolder(), parent
, Section
.TWISTIE
);
555 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
557 addPart(descriptionDetailSection
);
558 addPart(naturalLanguageSection
);
559 addPart(describedSpecimenSection
);
560 addPart(descriptionSourceSection
);
561 addPart(scopeSection
);
565 * Creates the use Description section
568 private void createUseDescriptionSection(RootElement parent
) {
570 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
571 .createCdmDetailSection(DetailType
.DESCRIPTION
,
572 getConversationHolder(), parent
, this, Section
.TWISTIE
575 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
577 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
578 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
579 getConversationHolder(), parent
, Section
.TWISTIE
582 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
584 addPart(descriptionDetailSection
);
585 addPart(descriptionSourceSection
);
593 private void createImageGallerySection(RootElement parent
) {
595 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
596 .createCdmDetailSection(DetailType
.DESCRIPTION
,
597 getConversationHolder(), parent
, this, Section
.TWISTIE
600 addPart(descriptionDetailSection
);
604 * createMediaElementSection
608 private void createMediaElementSection(RootElement parent
) {
610 MediaDetailsSection mediaDetailSection
= (MediaDetailsSection
) formFactory
611 .createCdmDetailSection(DetailType
.MEDIA
,
612 getConversationHolder(), parent
, this, Section
.TWISTIE
615 addPart(mediaDetailSection
);
619 * createDerivedUnitBaseElementSection
622 private void createDerivedUnitBaseElementSection(RootElement parent
) {
625 GeneralDetailSection generalDetailSection
= (GeneralDetailSection
) formFactory
626 .createCdmDetailSection(DetailType
.DERIVED_UNIT_GENERAL
,
627 getConversationHolder(), parent
, this, Section
.TWISTIE
630 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
632 GatheringEventDetailSection gatheringEventDetailSection
= (GatheringEventDetailSection
) formFactory
633 .createCdmDetailSection(DetailType
.GATHERING_EVENT
,
634 getConversationHolder(), parent
, this, Section
.TWISTIE
);
636 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
638 FieldObservationDetailSection fieldObservationDetailSection
= (FieldObservationDetailSection
) formFactory
639 .createCdmDetailSection(DetailType
.FIELD_OBSERVATION
,
640 getConversationHolder(), parent
, this, Section
.TWISTIE
);
642 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
644 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= (DerivedUnitBaseDetailSection
) formFactory
645 .createCdmDetailSection(DetailType
.DERIVED_UNIT
,
646 getConversationHolder(), parent
, this, Section
.TWISTIE
);
648 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
650 DeterminationDetailSection determinationDetailSection
= (DeterminationDetailSection
) formFactory
651 .createCdmDetailSection(DetailType
.DETERMINATION
,
652 getConversationHolder(), parent
, this, Section
.TWISTIE
);
654 addPart(generalDetailSection
);
655 addPart(gatheringEventDetailSection
);
656 addPart(fieldObservationDetailSection
);
657 addPart(derivedUnitBaseDetailSection
);
658 addPart(determinationDetailSection
);
665 private void createFeatureDistributionSection(RootElement parent
) {
668 FeatureDistributionDetailSection featureDistributionSection
= (FeatureDistributionDetailSection
) formFactory
669 .createCdmDetailSection(DetailType
.FEATURE_DISTRIBUTION
,
670 getConversationHolder(), parent
, this, Section
.TWISTIE
673 addPart(featureDistributionSection
);
676 private void createPolytomousKeySection(RootElement parent
) {
679 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
680 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
,
681 getConversationHolder(), parent
, this, Section
.TWISTIE
684 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
686 GeographicalScopeDetailSection geographicalScopeDetailSection
= (GeographicalScopeDetailSection
) formFactory
687 .createEntityDetailSection(EntityDetailType
.GEOGRAPHICAL_SCOPE
,
688 getConversationHolder(), parent
, Section
.TWISTIE
);
690 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
692 ScopeRestrictionSection scopeRestrictionSection
= (ScopeRestrictionSection
) formFactory
693 .createEntityDetailSection(EntityDetailType
.SCOPE_RESTRICTION
,
694 getConversationHolder(), parent
, Section
.TWISTIE
);
696 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
698 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
699 .createEntityDetailSection(EntityDetailType
.TAXONOMIC_SCOPE
,
700 getConversationHolder(), parent
, Section
.TWISTIE
);
702 addPart(polytomousKeyDetailSection
);
703 addPart(geographicalScopeDetailSection
);
704 addPart(scopeRestrictionSection
);
705 addPart(taxonomicScopeSection
);
709 * createPolytomousKeyNodeSection
712 private void createPolytomousKeyNodeSection(RootElement parent
) {
715 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= (PolytomousKeyNodeDetailSection
) formFactory
716 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY_NODE
,
717 getConversationHolder(), parent
, this, Section
.TWISTIE
720 addPart(polytomousKeyNodeDetailSection
);
724 * create the UseRecordSection
727 private void createUseRecordSection(RootElement parent
) {
730 UseRecordDetailSection descriptionUseRecordSection
= (UseRecordDetailSection
) formFactory
731 .createCdmDetailSection(DetailType
.USE_RECORD
,
732 getConversationHolder(), parent
, this, Section
.TWISTIE
735 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
737 addPart(descriptionUseRecordSection
);
746 private void createUserSection(RootElement parent
) {
749 UserDetailSection userDetailSection
= (UserDetailSection
) formFactory
750 .createCdmDetailSection(DetailType
.USER
,
751 getConversationHolder(), parent
, this, Section
.TWISTIE
754 GroupsByUserDetailSection groupByUserDetailSection
= (GroupsByUserDetailSection
) formFactory
755 .createEntityDetailSection(EntityDetailType
.GROUPS_BY_USER
,
756 getConversationHolder(), parent
, Section
.TWISTIE
759 addPart(userDetailSection
);
760 addPart(groupByUserDetailSection
);
764 * createTaxonRelationshipSection
767 private void createTaxonRelationshipSection(RootElement parent
) {
770 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= (TaxonRelationshipDetailSection
) formFactory
771 .createCdmDetailSection(DetailType
.TAXON_RELATIONSHIP
,
772 getConversationHolder(), parent
, this, Section
.TWISTIE
775 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= (ReferencedEntityDetailSection
) formFactory
776 .createCdmDetailSection(DetailType
.REFERENCED_ENTITY
,
777 getConversationHolder(), parent
, this, Section
.TWISTIE
779 addPart(taxonRelationshipDetailSection
);
780 addPart(referencedEntityBaseDetailSection
);
786 private void createTermVocabularySection(RootElement parent
) {
789 TermVocabularyDetailSection termVocabularyDetailSection
= (TermVocabularyDetailSection
) formFactory
790 .createCdmDetailSection(DetailType
.TERM_VOCABULARY
,
791 getConversationHolder(), parent
, this, Section
.TWISTIE
793 addPart(termVocabularyDetailSection
);
797 * createDefinedTermSection
800 private void createDefinedTermSection(RootElement parent
) {
803 AbstractFormSection definedTermDetailSection
= formFactory
804 .createDefinedTermDetailSection(getInput().getClass(),
805 getConversationHolder(), parent
, this, Section
.TWISTIE
807 addPart(definedTermDetailSection
);