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
.Section
;
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
.media
.Media
;
40 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
41 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
42 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
43 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
44 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
46 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
47 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
48 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
49 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
50 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
51 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
52 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
53 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.DetailType
;
54 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.EntityDetailType
;
55 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
56 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
57 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
98 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
102 * DetailsViewer class.
106 * @created Feb 12, 2010
109 public class DetailsViewer
extends AbstractCdmDataViewer
{
111 private ISelection selection
;
115 * Constructor for DetailsViewer.
119 * a {@link org.eclipse.swt.widgets.Composite} object.
121 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
124 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
125 super(parent
, viewPart
);
128 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
129 // since we are getting implementations of DerivedUnitBase from the bulk
131 // and not derived unit facade objects,
137 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
141 public void setInput(Object input
) {
142 if (input
instanceof DerivedUnit
) {
144 input
= DerivedUnitFacade
.NewInstance((DerivedUnit
) input
,
145 PreferencesUtil
.getDerivedUnitConfigurator());
146 } catch (DerivedUnitFacadeNotSupportedException e
) {
147 StoreUtil
.error(getClass(), e
);
150 super.setInput(input
);
154 protected void markViewPartDirty() {
155 if (getInput() instanceof DerivedUnitFacade
) {
156 getViewPart().changed(
157 ((DerivedUnitFacade
) getInput()).innerDerivedUnit());
160 super.markViewPartDirty();
163 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
168 * @see org.eclipse.jface.viewers.Viewer#refresh()
172 protected void showParts() {
173 // FIXME (CM) : Need to clean out this code.
174 // Too much type checking to decide which detail view to display.
175 // Need to build in a mechanism where navigators / editors are 'aware'
176 // of the corresponding detail viewer.
177 if (getInput() instanceof TaxonBase
) {
178 createTaxonSections(rootElement
);
180 } else if (getInput() instanceof NonViralName
) {
181 createNameSections(rootElement
);
183 } else if (getInput() instanceof Reference
) {
184 createReferenceSections(rootElement
);
186 } else if (getInput() instanceof Team
) {
187 createTeamDetailSection(rootElement
);
189 } else if (getInput() instanceof Person
) {
190 createPersonDetailSection(rootElement
);
192 } else if (getInput() instanceof TeamOrPersonBase
) {
193 createTeamOrPersonBaseDetailSection(rootElement
);
195 } else if (getInput() instanceof DescriptionBase
) {
196 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) getInput()).getMarkers();
197 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(UsageTermCollection
.uuidUseMarkerType
);
198 Boolean isUseDescription
= false;
199 for (Marker marker
: descriptionMarkers
) {
200 if (marker
.getMarkerType().equals(useMarkertype
)) {
201 isUseDescription
= true;
204 if (((DescriptionBase
) getInput()).isImageGallery()) {
205 createImageGallerySection(rootElement
);
207 } else if (isUseDescription
) {
208 createUseDescriptionSection(rootElement
);
210 createDescriptionSection(rootElement
);
213 } else if (getInput() instanceof DescriptionElementBase
) {
214 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) getInput()).getInDescription().getMarkers();
215 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(UsageTermCollection
.uuidUseMarkerType
);
216 Boolean isUseDescription
= false;
217 for (Marker marker
: descriptionMarkers
) {
218 if (marker
.getMarkerType().equals(useMarkertype
)) {
219 isUseDescription
= true;
223 if (isUseDescription
== true && getInput() instanceof CategoricalData
) {
224 createUseRecordSection(rootElement
);
227 createDescriptionElementSection(rootElement
);
230 } else if (getInput() instanceof Media
) {
231 createMediaElementSection(rootElement
);
233 } else if (getInput() instanceof DerivedUnitFacade
) {
234 createDerivedUnitBaseElementSection(rootElement
);
236 } else if (getInput() instanceof FeatureNodeContainer
) {
237 createFeatureDistributionSection(rootElement
);
239 } else if (getInput() instanceof PolytomousKey
) {
240 //createPolytomousKeySection(rootElement);
242 } else if ((getInput() instanceof PolytomousKeyNode
)
243 || (getInput() instanceof PolytomousKeyRelationship
)) {
244 createPolytomousKeyNodeSection(rootElement
);
246 } else if (getInput() instanceof User
) {
247 createUserSection(rootElement
);
249 } else if (getInput() instanceof Group
) {
250 createGroupSection(rootElement
);
252 } else if (getInput() instanceof TaxonRelationship
) {
253 createTaxonRelationshipSection(rootElement
);
255 } else if (getInput() instanceof TermVocabulary
) {
256 createTermVocabularySection(rootElement
);
258 } else if (getInput() instanceof DefinedTermBase
) {
259 createDefinedTermSection(rootElement
);
270 private void createGroupSection(RootElement parent
) {
273 GroupDetailSection groupDetailSection
= (GroupDetailSection
) formFactory
274 .createCdmDetailSection(DetailType
.GROUP
,
275 getConversationHolder(), parent
, this, Section
.TWISTIE
277 MemberDetailSection memberDetailSection
= (MemberDetailSection
) formFactory
278 .createEntityDetailSection(EntityDetailType
.MEMBER
,
279 getConversationHolder(), parent
, Section
.TWISTIE
281 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= (GrantedAuthorityDetailSection
) formFactory
282 .createEntityDetailSection(EntityDetailType
.GRANTED_AUTHORITY
,
283 getConversationHolder(), parent
, Section
.TWISTIE
286 addPart(groupDetailSection
);
287 addPart(memberDetailSection
);
288 addPart(grantedAuthorityDetailSection
);
294 * @see org.eclipse.jface.viewers.Viewer#getSelection()
298 public ISelection
getSelection() {
306 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
307 * .ISelection, boolean)
311 public void setSelection(ISelection selection
, boolean reveal
) {
312 this.selection
= selection
;
313 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(
315 fireSelectionChanged(selectionChangedEvent
);
319 * createTaxonSections(RootElement parent)
322 private void createTaxonSections(RootElement parent
) {
325 TaxonBaseDetailSection taxonBaseDetailSection
= (TaxonBaseDetailSection
) formFactory
326 .createCdmDetailSection(DetailType
.TAXONBASE
,
327 getConversationHolder(), parent
, this, Section
.TWISTIE
);
329 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
331 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
332 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
333 getConversationHolder(), parent
, this, Section
.TWISTIE
336 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
338 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
339 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
340 getConversationHolder(), parent
, this, Section
.TWISTIE
);
342 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
344 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
345 .createEntityDetailSection(
346 EntityDetailType
.NOMENCLATURALSTATUS
,
347 getConversationHolder(), parent
, Section
.TWISTIE
);
349 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
351 ProtologueSection protologSection
= (ProtologueSection
) formFactory
352 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
353 getConversationHolder(), parent
, Section
.TWISTIE
);
355 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
357 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
358 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
359 getConversationHolder(), parent
, Section
.TWISTIE
);
361 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
363 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
364 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
365 getConversationHolder(), parent
, Section
.TWISTIE
);
367 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
369 ParsingMessagesSection parsingMessagesSection
= (ParsingMessagesSection
) formFactory
370 .createCdmDetailSection(DetailType
.PARSINGMESSAGE
,
371 getConversationHolder(), parent
, this, Section
.EXPANDED
);
373 addPart(taxonBaseDetailSection
);
374 addPart(nonViralNameSection
);
375 addPart(nomenclaturalStatusSection
);
376 addPart(protologSection
);
377 addPart(referenceDetailSection
);
378 addPart(typeDesignationSection
);
379 addPart(nameRelationshipSection
);
380 addPart(parsingMessagesSection
);
387 private void createNameSections(RootElement parent
) {
389 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
390 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
391 getConversationHolder(), parent
, this, Section
.TWISTIE
394 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
396 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
397 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
398 getConversationHolder(), parent
, this, Section
.TWISTIE
);
400 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
402 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
403 .createEntityDetailSection(
404 EntityDetailType
.NOMENCLATURALSTATUS
,
405 getConversationHolder(), parent
, Section
.TWISTIE
);
407 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
409 ProtologueSection protologSection
= (ProtologueSection
) formFactory
410 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
411 getConversationHolder(), parent
, Section
.TWISTIE
);
413 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
415 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
416 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
417 getConversationHolder(), parent
, Section
.TWISTIE
);
419 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
421 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
422 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
423 getConversationHolder(), parent
, Section
.TWISTIE
);
425 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
427 addPart(nonViralNameSection
);
428 addPart(nomenclaturalStatusSection
);
429 addPart(protologSection
);
430 addPart(referenceDetailSection
);
431 addPart(typeDesignationSection
);
432 addPart(nameRelationshipSection
);
436 * createReferenceSections
439 private void createReferenceSections(RootElement parent
) {
442 ReferenceDetailSection referenceDetailSection
= (ReferenceDetailSection
) formFactory
443 .createCdmDetailSection(DetailType
.REFERENCEBASE
,
444 getConversationHolder(), parent
, this, Section
.TWISTIE
447 addPart(referenceDetailSection
);
451 * createTeamOrPersonBaseDetailSection
454 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
456 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= (TeamOrPersonBaseDetailSection
) formFactory
457 .createCdmDetailSection(DetailType
.TEAMORPERSONBASE
,
458 getConversationHolder(), parent
, this, Section
.TWISTIE
461 addPart(teamOrPersonBaseDetailSection
);
465 * createTeamDetailSection
468 private void createTeamDetailSection(RootElement parent
) {
470 TeamDetailSection teamDetailSection
= (TeamDetailSection
) formFactory
471 .createCdmDetailSection(DetailType
.TEAM
,
472 getConversationHolder(), parent
, this, Section
.TWISTIE
475 addPart(teamDetailSection
);
479 * createPersonDetailSection
482 private void createPersonDetailSection(RootElement parent
) {
484 PersonDetailSection personDetailSection
= (PersonDetailSection
) formFactory
485 .createCdmDetailSection(DetailType
.PERSON
,
486 getConversationHolder(), parent
, this, Section
.TWISTIE
488 addPart(personDetailSection
);
492 * createDescriptionElementSection
495 private void createDescriptionElementSection(RootElement parent
) {
498 DescriptionElementDetailSection descriptionElementDetailSection
= (DescriptionElementDetailSection
) formFactory
499 .createCdmDetailSection(DetailType
.DESCRIPTIONELEMENT
,
500 getConversationHolder(), parent
, this, Section
.TWISTIE
503 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
505 DescriptionElementSourceSection descriptionElementSourceSection
= (DescriptionElementSourceSection
) formFactory
506 .createEntityDetailSection(
507 EntityDetailType
.DESCRIPTIONELEMENTSOURCE
,
508 getConversationHolder(), parent
, Section
.TWISTIE
);
510 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
512 DescriptionElementMediaSection descriptionElementMediaSection
= (DescriptionElementMediaSection
) formFactory
513 .createEntityDetailSection(
514 EntityDetailType
.DESCRIPTIONELEMENTMEDIA
,
515 getConversationHolder(), parent
, Section
.TWISTIE
);
517 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
519 addPart(descriptionElementDetailSection
);
520 addPart(descriptionElementSourceSection
);
521 addPart(descriptionElementMediaSection
);
525 * createDescriptionSection
528 private void createDescriptionSection(RootElement parent
) {
530 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
531 .createCdmDetailSection(DetailType
.DESCRIPTION
,
532 getConversationHolder(), parent
, this, Section
.TWISTIE
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 NaturalLanguageSection naturalLanguageSection
= (NaturalLanguageSection
) formFactory
538 .createCdmDetailSection(DetailType
.NATURAL_LANGUAGE
,
539 getConversationHolder(), parent
, this, Section
.TWISTIE
542 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
544 DescribedSpecimenSection describedSpecimenSection
= (DescribedSpecimenSection
) formFactory
545 .createEntityDetailSection(EntityDetailType
.DESCRIBED_SPECIMEN
,
546 getConversationHolder(), parent
, Section
.TWISTIE
);
548 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
550 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
551 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
552 getConversationHolder(), parent
, Section
.TWISTIE
);
554 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
556 ScopeSection scopeSection
= (ScopeSection
) formFactory
557 .createEntityDetailSection(EntityDetailType
.SCOPE
,
558 getConversationHolder(), parent
, Section
.TWISTIE
);
560 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
562 addPart(descriptionDetailSection
);
563 addPart(naturalLanguageSection
);
564 addPart(describedSpecimenSection
);
565 addPart(descriptionSourceSection
);
566 addPart(scopeSection
);
570 * Creates the use Description section
573 private void createUseDescriptionSection(RootElement parent
) {
575 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
576 .createCdmDetailSection(DetailType
.DESCRIPTION
,
577 getConversationHolder(), parent
, this, Section
.TWISTIE
580 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
582 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
583 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
584 getConversationHolder(), parent
, Section
.TWISTIE
587 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
589 addPart(descriptionDetailSection
);
590 addPart(descriptionSourceSection
);
598 private void createImageGallerySection(RootElement parent
) {
600 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
601 .createCdmDetailSection(DetailType
.DESCRIPTION
,
602 getConversationHolder(), parent
, this, Section
.TWISTIE
605 addPart(descriptionDetailSection
);
609 * createMediaElementSection
613 private void createMediaElementSection(RootElement parent
) {
615 MediaDetailsSection mediaDetailSection
= (MediaDetailsSection
) formFactory
616 .createCdmDetailSection(DetailType
.MEDIA
,
617 getConversationHolder(), parent
, this, Section
.TWISTIE
620 addPart(mediaDetailSection
);
624 * createDerivedUnitBaseElementSection
627 private void createDerivedUnitBaseElementSection(RootElement parent
) {
630 GeneralDetailSection generalDetailSection
= (GeneralDetailSection
) formFactory
631 .createCdmDetailSection(DetailType
.DERIVED_UNIT_GENERAL
,
632 getConversationHolder(), parent
, this, Section
.TWISTIE
635 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
637 GatheringEventDetailSection gatheringEventDetailSection
= (GatheringEventDetailSection
) formFactory
638 .createCdmDetailSection(DetailType
.GATHERING_EVENT
,
639 getConversationHolder(), parent
, this, Section
.TWISTIE
);
641 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
643 FieldObservationDetailSection fieldObservationDetailSection
= (FieldObservationDetailSection
) formFactory
644 .createCdmDetailSection(DetailType
.FIELD_OBSERVATION
,
645 getConversationHolder(), parent
, this, Section
.TWISTIE
);
647 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
649 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= (DerivedUnitBaseDetailSection
) formFactory
650 .createCdmDetailSection(DetailType
.DERIVED_UNIT
,
651 getConversationHolder(), parent
, this, Section
.TWISTIE
);
653 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
655 DeterminationDetailSection determinationDetailSection
= (DeterminationDetailSection
) formFactory
656 .createCdmDetailSection(DetailType
.DETERMINATION
,
657 getConversationHolder(), parent
, this, Section
.TWISTIE
);
659 addPart(generalDetailSection
);
660 addPart(gatheringEventDetailSection
);
661 addPart(fieldObservationDetailSection
);
662 addPart(derivedUnitBaseDetailSection
);
663 addPart(determinationDetailSection
);
670 private void createFeatureDistributionSection(RootElement parent
) {
673 FeatureDistributionDetailSection featureDistributionSection
= (FeatureDistributionDetailSection
) formFactory
674 .createCdmDetailSection(DetailType
.FEATURE_DISTRIBUTION
,
675 getConversationHolder(), parent
, this, Section
.TWISTIE
678 addPart(featureDistributionSection
);
681 private void createPolytomousKeySection(RootElement parent
) {
684 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
685 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
,
686 getConversationHolder(), parent
, this, Section
.TWISTIE
689 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
691 GeographicalScopeDetailSection geographicalScopeDetailSection
= (GeographicalScopeDetailSection
) formFactory
692 .createEntityDetailSection(EntityDetailType
.GEOGRAPHICAL_SCOPE
,
693 getConversationHolder(), parent
, Section
.TWISTIE
);
695 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
697 ScopeRestrictionSection scopeRestrictionSection
= (ScopeRestrictionSection
) formFactory
698 .createEntityDetailSection(EntityDetailType
.SCOPE_RESTRICTION
,
699 getConversationHolder(), parent
, Section
.TWISTIE
);
701 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
703 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
704 .createEntityDetailSection(EntityDetailType
.TAXONOMIC_SCOPE
,
705 getConversationHolder(), parent
, Section
.TWISTIE
);
707 addPart(polytomousKeyDetailSection
);
708 addPart(geographicalScopeDetailSection
);
709 addPart(scopeRestrictionSection
);
710 addPart(taxonomicScopeSection
);
714 * createPolytomousKeyNodeSection
717 private void createPolytomousKeyNodeSection(RootElement parent
) {
720 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
721 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
,
722 getConversationHolder(), parent
, this, Section
.TWISTIE
725 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
727 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= (PolytomousKeyNodeDetailSection
) formFactory
728 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY_NODE
,
729 getConversationHolder(), parent
, this, Section
.TWISTIE
732 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
734 // GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
735 // .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
736 // getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
738 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
740 // ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
741 // .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
742 // getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
744 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
746 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
747 .createEntityDetailSection(EntityDetailType
.TAXONOMIC_SCOPE
,
748 getConversationHolder(), parent
, Section
.TWISTIE
| Section
.COMPACT
);
750 addPart(polytomousKeyDetailSection
);
751 addPart(polytomousKeyNodeDetailSection
);
752 // addPart(geographicalScopeDetailSection);
753 // addPart(scopeRestrictionSection);
754 addPart(taxonomicScopeSection
);
759 * create the UseRecordSection
762 private void createUseRecordSection(RootElement parent
) {
765 UseRecordDetailSection descriptionUseRecordSection
= (UseRecordDetailSection
) formFactory
766 .createCdmDetailSection(DetailType
.USE_RECORD
,
767 getConversationHolder(), parent
, this, Section
.TWISTIE
770 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
772 addPart(descriptionUseRecordSection
);
781 private void createUserSection(RootElement parent
) {
784 UserDetailSection userDetailSection
= (UserDetailSection
) formFactory
785 .createCdmDetailSection(DetailType
.USER
,
786 getConversationHolder(), parent
, this, Section
.TWISTIE
789 GroupsByUserDetailSection groupByUserDetailSection
= (GroupsByUserDetailSection
) formFactory
790 .createEntityDetailSection(EntityDetailType
.GROUPS_BY_USER
,
791 getConversationHolder(), parent
, Section
.TWISTIE
794 addPart(userDetailSection
);
795 addPart(groupByUserDetailSection
);
799 * createTaxonRelationshipSection
802 private void createTaxonRelationshipSection(RootElement parent
) {
805 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= (TaxonRelationshipDetailSection
) formFactory
806 .createCdmDetailSection(DetailType
.TAXON_RELATIONSHIP
,
807 getConversationHolder(), parent
, this, Section
.TWISTIE
810 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= (ReferencedEntityDetailSection
) formFactory
811 .createCdmDetailSection(DetailType
.REFERENCED_ENTITY
,
812 getConversationHolder(), parent
, this, Section
.TWISTIE
814 addPart(taxonRelationshipDetailSection
);
815 addPart(referencedEntityBaseDetailSection
);
821 private void createTermVocabularySection(RootElement parent
) {
824 TermVocabularyDetailSection termVocabularyDetailSection
= (TermVocabularyDetailSection
) formFactory
825 .createCdmDetailSection(DetailType
.TERM_VOCABULARY
,
826 getConversationHolder(), parent
, this, Section
.TWISTIE
828 addPart(termVocabularyDetailSection
);
832 * createDefinedTermSection
835 private void createDefinedTermSection(RootElement parent
) {
838 AbstractFormSection definedTermDetailSection
= formFactory
839 .createDefinedTermDetailSection(getInput().getClass(),
840 getConversationHolder(), parent
, this, Section
.TWISTIE
842 addPart(definedTermDetailSection
);