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
.ExpandableComposite
;
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
;
44 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
45 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
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
.ui
.element
.AbstractFormSection
;
51 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.DetailType
;
52 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.EntityDetailType
;
53 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
54 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
55 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
56 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
57 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
94 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
98 * The DetailsViewer handles the content of the details view (
99 * {@link DetailsViewPart}).<br>
100 * Depending on the type of the selected element the section of the details view
104 * @created Feb 12, 2010
107 public class DetailsViewer
extends AbstractCdmDataViewer
{
109 private ISelection selection
;
113 * Constructor for DetailsViewer.
117 * a {@link org.eclipse.swt.widgets.Composite} object.
119 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
122 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
123 super(parent
, viewPart
);
126 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
127 // since we are getting implementations of DerivedUnitBase from the bulk
129 // and not derived unit facade objects,
135 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
139 public void setInput(Object input
) {
140 if (input
instanceof DerivedUnitBase
) {
142 input
= DerivedUnitFacade
.NewInstance((DerivedUnitBase
) input
,
143 PreferencesUtil
.getDerivedUnitConfigurator());
144 } catch (DerivedUnitFacadeNotSupportedException e
) {
145 AbstractUtility
.error(getClass(), e
);
148 super.setInput(input
);
152 protected void markViewPartDirty() {
153 if (getInput() instanceof DerivedUnitFacade
) {
154 getViewPart().changed(((DerivedUnitFacade
) getInput()).innerDerivedUnit());
157 super.markViewPartDirty();
160 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
165 * @see org.eclipse.jface.viewers.Viewer#refresh()
169 protected void showParts() {
170 // FIXME (CM) : Need to clean out this code.
171 // Too much type checking to decide which detail view to display.
172 // Need to build in a mechanism where navigators / editors are 'aware'
173 // of the corresponding detail viewer.
174 Object input
= getInput();
175 if (input
instanceof TaxonBase
) {
176 createTaxonSections(rootElement
);
178 } else if (input
instanceof NonViralName
) {
179 createNameSections(rootElement
);
181 } else if (input
instanceof Reference
) {
182 createReferenceSections(rootElement
);
184 } else if (input
instanceof Team
) {
185 createTeamDetailSection(rootElement
);
187 } else if (input
instanceof Person
) {
188 createPersonDetailSection(rootElement
);
190 } else if (input
instanceof TeamOrPersonBase
) {
191 createTeamOrPersonBaseDetailSection(rootElement
);
193 } else if (input
instanceof DescriptionBase
) {
194 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
195 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
196 UsageTermCollection
.uuidUseMarkerType
);
197 Boolean isUseDescription
= false;
198 for (Marker marker
: descriptionMarkers
) {
199 if (marker
.getMarkerType().equals(useMarkertype
)) {
200 isUseDescription
= true;
203 if (((DescriptionBase
) input
).isImageGallery()) {
204 createImageGallerySection(rootElement
);
206 } else if (isUseDescription
) {
207 createUseDescriptionSection(rootElement
);
209 createDescriptionSection(rootElement
);
212 } else if (input
instanceof DescriptionElementBase
) {
213 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
214 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
215 UsageTermCollection
.uuidUseMarkerType
);
216 Boolean isUseDescription
= false;
217 for (Marker marker
: descriptionMarkers
) {
218 if (marker
.getMarkerType().equals(useMarkertype
)) {
219 isUseDescription
= true;
223 if (isUseDescription
== true && input
instanceof CategoricalData
) {
224 createUseRecordSection(rootElement
);
226 createDescriptionElementSection(rootElement
);
229 } else if (input
instanceof Media
) {
230 createMediaElementSection(rootElement
);
232 } else if (input
instanceof DerivedUnitFacade
) {
233 createFOSection(rootElement
);
235 } else if (input
instanceof FeatureNodeContainer
) {
236 createFeatureDistributionSection(rootElement
);
238 } else if (input
instanceof PolytomousKey
) {
239 // createPolytomousKeySection(rootElement);
241 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
242 createPolytomousKeyNodeSection(rootElement
);
243 } else if (input
instanceof User
) {
244 createUserSection(rootElement
);
245 } else if (input
instanceof Group
) {
246 createGroupSection(rootElement
);
247 } else if (input
instanceof TaxonRelationship
) {
248 createTaxonRelationshipSection(rootElement
);
249 } else if (input
instanceof TermVocabulary
) {
250 createTermVocabularySection(rootElement
);
251 } else if (input
instanceof DefinedTermBase
) {
252 createDefinedTermSection(rootElement
);
262 private void createGroupSection(RootElement parent
) {
265 GroupDetailSection groupDetailSection
= (GroupDetailSection
) formFactory
.createCdmDetailSection(
266 DetailType
.GROUP
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
267 | ExpandableComposite
.EXPANDED
);
268 MemberDetailSection memberDetailSection
= (MemberDetailSection
) formFactory
.createEntityDetailSection(
269 EntityDetailType
.MEMBER
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
270 | ExpandableComposite
.EXPANDED
);
271 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= (GrantedAuthorityDetailSection
) formFactory
272 .createEntityDetailSection(EntityDetailType
.GRANTED_AUTHORITY
, getConversationHolder(), parent
,
273 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
275 addPart(groupDetailSection
);
276 addPart(memberDetailSection
);
277 addPart(grantedAuthorityDetailSection
);
283 * @see org.eclipse.jface.viewers.Viewer#getSelection()
287 public ISelection
getSelection() {
295 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
296 * .ISelection, boolean)
300 public void setSelection(ISelection selection
, boolean reveal
) {
301 this.selection
= selection
;
302 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
303 fireSelectionChanged(selectionChangedEvent
);
307 * createTaxonSections(RootElement parent)
311 private void createTaxonSections(RootElement parent
) {
314 TaxonBaseDetailSection taxonBaseDetailSection
= (TaxonBaseDetailSection
) formFactory
.createCdmDetailSection(
315 DetailType
.TAXONBASE
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
317 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
319 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
.createCdmDetailSection(
320 DetailType
.NONVIRALNAME
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
321 | ExpandableComposite
.EXPANDED
);
323 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
325 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
326 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
, getConversationHolder(), parent
, this,
327 ExpandableComposite
.TWISTIE
);
329 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
331 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
332 .createEntityDetailSection(EntityDetailType
.NOMENCLATURALSTATUS
, getConversationHolder(), parent
,
333 ExpandableComposite
.TWISTIE
);
335 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
337 ProtologueSection protologSection
= (ProtologueSection
) formFactory
.createEntityDetailSection(
338 EntityDetailType
.PROTOLOG
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
340 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
342 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
.createEntityDetailSection(
343 EntityDetailType
.TYPEDESIGNATION
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
345 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
347 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
348 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
, getConversationHolder(), parent
,
349 ExpandableComposite
.TWISTIE
);
351 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
353 ParsingMessagesSection parsingMessagesSection
= (ParsingMessagesSection
) formFactory
.createCdmDetailSection(
354 DetailType
.PARSINGMESSAGE
, getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
356 addPart(taxonBaseDetailSection
);
357 addPart(nonViralNameSection
);
358 addPart(nomenclaturalStatusSection
);
359 addPart(protologSection
);
360 addPart(referenceDetailSection
);
361 addPart(typeDesignationSection
);
362 addPart(nameRelationshipSection
);
363 addPart(parsingMessagesSection
);
371 private void createNameSections(RootElement parent
) {
373 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
.createCdmDetailSection(
374 DetailType
.NONVIRALNAME
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
375 | ExpandableComposite
.EXPANDED
);
377 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
379 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
380 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
, getConversationHolder(), parent
, this,
381 ExpandableComposite
.TWISTIE
);
383 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
385 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
386 .createEntityDetailSection(EntityDetailType
.NOMENCLATURALSTATUS
, getConversationHolder(), parent
,
387 ExpandableComposite
.TWISTIE
);
389 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
391 ProtologueSection protologSection
= (ProtologueSection
) formFactory
.createEntityDetailSection(
392 EntityDetailType
.PROTOLOG
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
394 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
396 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
.createEntityDetailSection(
397 EntityDetailType
.TYPEDESIGNATION
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
399 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
401 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
402 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
, getConversationHolder(), parent
,
403 ExpandableComposite
.TWISTIE
);
405 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
407 addPart(nonViralNameSection
);
408 addPart(nomenclaturalStatusSection
);
409 addPart(protologSection
);
410 addPart(referenceDetailSection
);
411 addPart(typeDesignationSection
);
412 addPart(nameRelationshipSection
);
416 * createReferenceSections
420 private void createReferenceSections(RootElement parent
) {
423 ReferenceDetailSection referenceDetailSection
= (ReferenceDetailSection
) formFactory
.createCdmDetailSection(
424 DetailType
.REFERENCEBASE
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
425 | ExpandableComposite
.EXPANDED
);
427 addPart(referenceDetailSection
);
431 * createTeamOrPersonBaseDetailSection
435 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
437 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= (TeamOrPersonBaseDetailSection
) formFactory
438 .createCdmDetailSection(DetailType
.TEAMORPERSONBASE
, getConversationHolder(), parent
, this,
439 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
441 addPart(teamOrPersonBaseDetailSection
);
445 * createTeamDetailSection
449 private void createTeamDetailSection(RootElement parent
) {
451 TeamDetailSection teamDetailSection
= (TeamDetailSection
) formFactory
.createCdmDetailSection(DetailType
.TEAM
,
452 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
454 addPart(teamDetailSection
);
458 * createPersonDetailSection
462 private void createPersonDetailSection(RootElement parent
) {
464 PersonDetailSection personDetailSection
= (PersonDetailSection
) formFactory
.createCdmDetailSection(
465 DetailType
.PERSON
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
466 | ExpandableComposite
.EXPANDED
);
467 addPart(personDetailSection
);
471 * createDescriptionElementSection
475 private void createDescriptionElementSection(RootElement parent
) {
478 DescriptionElementDetailSection descriptionElementDetailSection
= (DescriptionElementDetailSection
) formFactory
479 .createCdmDetailSection(DetailType
.DESCRIPTIONELEMENT
, getConversationHolder(), parent
, this,
480 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
482 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
484 DescriptionElementSourceSection descriptionElementSourceSection
= (DescriptionElementSourceSection
) formFactory
485 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONELEMENTSOURCE
, getConversationHolder(), parent
,
486 ExpandableComposite
.TWISTIE
);
488 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
490 DescriptionElementMediaSection descriptionElementMediaSection
= (DescriptionElementMediaSection
) formFactory
491 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONELEMENTMEDIA
, getConversationHolder(), parent
,
492 ExpandableComposite
.TWISTIE
);
494 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
496 addPart(descriptionElementDetailSection
);
497 addPart(descriptionElementSourceSection
);
498 addPart(descriptionElementMediaSection
);
502 * createDescriptionSection
506 private void createDescriptionSection(RootElement parent
) {
508 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
509 .createCdmDetailSection(DetailType
.DESCRIPTION
, getConversationHolder(), parent
, this,
510 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
512 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
514 NaturalLanguageSection naturalLanguageSection
= (NaturalLanguageSection
) formFactory
.createCdmDetailSection(
515 DetailType
.NATURAL_LANGUAGE
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
516 | ExpandableComposite
.EXPANDED
);
518 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
520 DescribedSpecimenSection describedSpecimenSection
= (DescribedSpecimenSection
) formFactory
521 .createEntityDetailSection(EntityDetailType
.DESCRIBED_SPECIMEN
, getConversationHolder(), parent
,
522 ExpandableComposite
.TWISTIE
);
524 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
526 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
527 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
, getConversationHolder(), parent
,
528 ExpandableComposite
.TWISTIE
);
530 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
532 ScopeSection scopeSection
= (ScopeSection
) formFactory
.createEntityDetailSection(EntityDetailType
.SCOPE
,
533 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 addPart(descriptionDetailSection
);
538 addPart(naturalLanguageSection
);
539 addPart(describedSpecimenSection
);
540 addPart(descriptionSourceSection
);
541 addPart(scopeSection
);
545 * Creates the use Description section
549 private void createUseDescriptionSection(RootElement parent
) {
551 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
552 .createCdmDetailSection(DetailType
.DESCRIPTION
, getConversationHolder(), parent
, this,
553 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
555 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
557 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
558 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
, getConversationHolder(), parent
,
559 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
561 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
563 addPart(descriptionDetailSection
);
564 addPart(descriptionSourceSection
);
571 private void createImageGallerySection(RootElement parent
) {
573 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
574 .createCdmDetailSection(DetailType
.DESCRIPTION
, getConversationHolder(), parent
, this,
575 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
577 addPart(descriptionDetailSection
);
581 * createMediaElementSection
586 private void createMediaElementSection(RootElement parent
) {
588 MediaDetailsSection mediaDetailSection
= (MediaDetailsSection
) formFactory
.createCdmDetailSection(
589 DetailType
.MEDIA
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
590 | ExpandableComposite
.EXPANDED
);
592 addPart(mediaDetailSection
);
596 * createDerivedUnitBaseElementSection
600 private void createDerivedUnitBaseElementSection(RootElement parent
) {
603 GeneralDetailSection generalDetailSection
= formFactory
.createGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
605 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
607 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
609 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
611 FieldObservationDetailSection fieldObservationDetailSection
= formFactory
.createFieldObservationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
613 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
615 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
617 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
619 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
621 addPart(generalDetailSection
);
622 addPart(gatheringEventDetailSection
);
623 addPart(fieldObservationDetailSection
);
624 addPart(derivedUnitBaseDetailSection
);
625 addPart(determinationDetailSection
);
631 private void createFeatureDistributionSection(RootElement parent
) {
634 FeatureDistributionDetailSection featureDistributionSection
= (FeatureDistributionDetailSection
) formFactory
635 .createCdmDetailSection(DetailType
.FEATURE_DISTRIBUTION
, getConversationHolder(), parent
, this,
636 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
638 addPart(featureDistributionSection
);
642 * createPolytomousKeyNodeSection
646 private void createPolytomousKeyNodeSection(RootElement parent
) {
649 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
650 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
, getConversationHolder(), parent
, this,
651 ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
653 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
655 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= (PolytomousKeyNodeDetailSection
) formFactory
656 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY_NODE
, getConversationHolder(), parent
, this,
657 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
659 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
661 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
.createEntityDetailSection(
662 EntityDetailType
.TAXONOMIC_SCOPE
, getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
663 | ExpandableComposite
.COMPACT
);
665 addPart(polytomousKeyDetailSection
);
666 addPart(polytomousKeyNodeDetailSection
);
667 addPart(taxonomicScopeSection
);
672 * create the UseRecordSection
676 private void createUseRecordSection(RootElement parent
) {
679 UseRecordDetailSection descriptionUseRecordSection
= (UseRecordDetailSection
) formFactory
680 .createCdmDetailSection(DetailType
.USE_RECORD
, getConversationHolder(), parent
, this,
681 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
683 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
685 addPart(descriptionUseRecordSection
);
694 private void createUserSection(RootElement parent
) {
697 UserDetailSection userDetailSection
= (UserDetailSection
) formFactory
.createCdmDetailSection(DetailType
.USER
,
698 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
700 GroupsByUserDetailSection groupByUserDetailSection
= (GroupsByUserDetailSection
) formFactory
701 .createEntityDetailSection(EntityDetailType
.GROUPS_BY_USER
, getConversationHolder(), parent
,
702 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
704 addPart(userDetailSection
);
705 addPart(groupByUserDetailSection
);
709 * createTaxonRelationshipSection
713 private void createTaxonRelationshipSection(RootElement parent
) {
716 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= (TaxonRelationshipDetailSection
) formFactory
717 .createCdmDetailSection(DetailType
.TAXON_RELATIONSHIP
, getConversationHolder(), parent
, this,
718 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
720 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= (ReferencedEntityDetailSection
) formFactory
721 .createCdmDetailSection(DetailType
.REFERENCED_ENTITY
, getConversationHolder(), parent
, this,
722 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
723 addPart(taxonRelationshipDetailSection
);
724 addPart(referencedEntityBaseDetailSection
);
730 private void createTermVocabularySection(RootElement parent
) {
733 TermVocabularyDetailSection termVocabularyDetailSection
= (TermVocabularyDetailSection
) formFactory
734 .createCdmDetailSection(DetailType
.TERM_VOCABULARY
, getConversationHolder(), parent
, this,
735 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
736 addPart(termVocabularyDetailSection
);
740 * createDefinedTermSection
744 private void createDefinedTermSection(RootElement parent
) {
747 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(
748 getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
749 | ExpandableComposite
.EXPANDED
);
750 addPart(definedTermDetailSection
);
753 private void createFOSection(RootElement parent
){
756 GeneralDetailSection generalDetailSection
= formFactory
.createFOSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
758 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
760 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
762 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
764 FieldObservationDetailSection fieldObservationDetailSection
=formFactory
.createFODetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
766 addPart(generalDetailSection
);
767 addPart(gatheringEventDetailSection
);
768 addPart(fieldObservationDetailSection
);