4 * Copyright (C) 2011 EDIT
5 * European Distributed Institute of Taxonomy
6 * http://www.e-taxonomy.eu
8 * The contents of this file are subject to the Mozilla Public License Version 1.1
9 * See LICENSE.TXT at the top of this package for the full license terms.
12 package eu
.etaxonomy
.taxeditor
.view
.detail
;
16 import org
.eclipse
.jface
.viewers
.ISelection
;
17 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
18 import org
.eclipse
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
20 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
22 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
24 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
29 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
30 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
31 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
32 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
33 import eu
.etaxonomy
.cdm
.model
.common
.User
;
34 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
35 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
36 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
37 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
38 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
39 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
40 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
41 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
42 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldObservation
;
43 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
44 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
45 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
46 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
47 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
48 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
49 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
50 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
51 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
52 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
53 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
54 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.DetailType
;
55 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.EntityDetailType
;
56 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
57 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
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
.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
, 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(
155 ((DerivedUnitFacade
) getInput()).innerDerivedUnit());
158 super.markViewPartDirty();
161 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
166 * @see org.eclipse.jface.viewers.Viewer#refresh()
170 protected void showParts() {
171 // FIXME (CM) : Need to clean out this code.
172 // Too much type checking to decide which detail view to display.
173 // Need to build in a mechanism where navigators / editors are 'aware'
174 // of the corresponding detail viewer.
175 Object input
= getInput();
176 if (input
instanceof TaxonBase
) {
177 createTaxonSections(rootElement
);
179 } else if (input
instanceof NonViralName
) {
180 createNameSections(rootElement
);
182 } else if (input
instanceof Reference
) {
183 createReferenceSections(rootElement
);
185 } else if (input
instanceof Team
) {
186 createTeamDetailSection(rootElement
);
188 } else if (input
instanceof Person
) {
189 createPersonDetailSection(rootElement
);
191 } else if (input
instanceof TeamOrPersonBase
) {
192 createTeamOrPersonBaseDetailSection(rootElement
);
194 } else if (input
instanceof DescriptionBase
) {
195 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
196 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(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(UsageTermCollection
.uuidUseMarkerType
);
215 Boolean isUseDescription
= false;
216 for (Marker marker
: descriptionMarkers
) {
217 if (marker
.getMarkerType().equals(useMarkertype
)) {
218 isUseDescription
= true;
222 if (isUseDescription
== true && input
instanceof CategoricalData
) {
223 createUseRecordSection(rootElement
);
226 createDescriptionElementSection(rootElement
);
229 } else if (input
instanceof Media
) {
230 createMediaElementSection(rootElement
);
232 } else if (input
instanceof DerivedUnitFacade
) {
233 createDerivedUnitBaseElementSection(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
)
242 || (input
instanceof PolytomousKeyRelationship
)) {
243 createPolytomousKeyNodeSection(rootElement
);
244 } else if (input
instanceof User
) {
245 createUserSection(rootElement
);
246 } else if (input
instanceof Group
) {
247 createGroupSection(rootElement
);
248 } else if (input
instanceof TaxonRelationship
) {
249 createTaxonRelationshipSection(rootElement
);
250 } else if (input
instanceof TermVocabulary
) {
251 createTermVocabularySection(rootElement
);
252 } else if (input
instanceof DefinedTermBase
) {
253 createDefinedTermSection(rootElement
);
264 private void createGroupSection(RootElement parent
) {
267 GroupDetailSection groupDetailSection
= (GroupDetailSection
) formFactory
268 .createCdmDetailSection(DetailType
.GROUP
,
269 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
270 | ExpandableComposite
.EXPANDED
);
271 MemberDetailSection memberDetailSection
= (MemberDetailSection
) formFactory
272 .createEntityDetailSection(EntityDetailType
.MEMBER
,
273 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
274 | ExpandableComposite
.EXPANDED
);
275 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= (GrantedAuthorityDetailSection
) formFactory
276 .createEntityDetailSection(EntityDetailType
.GRANTED_AUTHORITY
,
277 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
278 | ExpandableComposite
.EXPANDED
);
280 addPart(groupDetailSection
);
281 addPart(memberDetailSection
);
282 addPart(grantedAuthorityDetailSection
);
288 * @see org.eclipse.jface.viewers.Viewer#getSelection()
292 public ISelection
getSelection() {
300 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
301 * .ISelection, boolean)
305 public void setSelection(ISelection selection
, boolean reveal
) {
306 this.selection
= selection
;
307 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
308 fireSelectionChanged(selectionChangedEvent
);
312 * createTaxonSections(RootElement parent)
315 private void createTaxonSections(RootElement parent
) {
318 TaxonBaseDetailSection taxonBaseDetailSection
= (TaxonBaseDetailSection
) formFactory
319 .createCdmDetailSection(DetailType
.TAXONBASE
,
320 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
322 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
324 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
325 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
326 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
327 | ExpandableComposite
.EXPANDED
);
329 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
331 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
332 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
333 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
335 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
337 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
338 .createEntityDetailSection(
339 EntityDetailType
.NOMENCLATURALSTATUS
,
340 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
342 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
344 ProtologueSection protologSection
= (ProtologueSection
) formFactory
345 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
346 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
348 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
350 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
351 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
352 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
354 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
356 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
357 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
358 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
360 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
362 ParsingMessagesSection parsingMessagesSection
= (ParsingMessagesSection
) formFactory
363 .createCdmDetailSection(DetailType
.PARSINGMESSAGE
,
364 getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
366 addPart(taxonBaseDetailSection
);
367 addPart(nonViralNameSection
);
368 addPart(nomenclaturalStatusSection
);
369 addPart(protologSection
);
370 addPart(referenceDetailSection
);
371 addPart(typeDesignationSection
);
372 addPart(nameRelationshipSection
);
373 addPart(parsingMessagesSection
);
380 private void createNameSections(RootElement parent
) {
382 NonViralNameDetailSection nonViralNameSection
= (NonViralNameDetailSection
) formFactory
383 .createCdmDetailSection(DetailType
.NONVIRALNAME
,
384 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
385 | ExpandableComposite
.EXPANDED
);
387 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
389 NomenclaturalReferenceDetailSection referenceDetailSection
= (NomenclaturalReferenceDetailSection
) formFactory
390 .createCdmDetailSection(DetailType
.NOMENCLATURALREFERENCE
,
391 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
393 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
395 NomenclaturalStatusSection nomenclaturalStatusSection
= (NomenclaturalStatusSection
) formFactory
396 .createEntityDetailSection(
397 EntityDetailType
.NOMENCLATURALSTATUS
,
398 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
400 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
402 ProtologueSection protologSection
= (ProtologueSection
) formFactory
403 .createEntityDetailSection(EntityDetailType
.PROTOLOG
,
404 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
406 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
408 TypeDesignationSection typeDesignationSection
= (TypeDesignationSection
) formFactory
409 .createEntityDetailSection(EntityDetailType
.TYPEDESIGNATION
,
410 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 NameRelationshipDetailSection nameRelationshipSection
= (NameRelationshipDetailSection
) formFactory
415 .createEntityDetailSection(EntityDetailType
.NAME_RELATIONSHIP
,
416 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
418 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
420 addPart(nonViralNameSection
);
421 addPart(nomenclaturalStatusSection
);
422 addPart(protologSection
);
423 addPart(referenceDetailSection
);
424 addPart(typeDesignationSection
);
425 addPart(nameRelationshipSection
);
429 * createReferenceSections
432 private void createReferenceSections(RootElement parent
) {
435 ReferenceDetailSection referenceDetailSection
= (ReferenceDetailSection
) formFactory
436 .createCdmDetailSection(DetailType
.REFERENCEBASE
,
437 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
438 | ExpandableComposite
.EXPANDED
);
440 addPart(referenceDetailSection
);
444 * createTeamOrPersonBaseDetailSection
447 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
449 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= (TeamOrPersonBaseDetailSection
) formFactory
450 .createCdmDetailSection(DetailType
.TEAMORPERSONBASE
,
451 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
452 | ExpandableComposite
.EXPANDED
);
454 addPart(teamOrPersonBaseDetailSection
);
458 * createTeamDetailSection
461 private void createTeamDetailSection(RootElement parent
) {
463 TeamDetailSection teamDetailSection
= (TeamDetailSection
) formFactory
464 .createCdmDetailSection(DetailType
.TEAM
,
465 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
466 | ExpandableComposite
.EXPANDED
);
468 addPart(teamDetailSection
);
472 * createPersonDetailSection
475 private void createPersonDetailSection(RootElement parent
) {
477 PersonDetailSection personDetailSection
= (PersonDetailSection
) formFactory
478 .createCdmDetailSection(DetailType
.PERSON
,
479 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
480 | ExpandableComposite
.EXPANDED
);
481 addPart(personDetailSection
);
485 * createDescriptionElementSection
488 private void createDescriptionElementSection(RootElement parent
) {
491 DescriptionElementDetailSection descriptionElementDetailSection
= (DescriptionElementDetailSection
) formFactory
492 .createCdmDetailSection(DetailType
.DESCRIPTIONELEMENT
,
493 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
494 | ExpandableComposite
.EXPANDED
);
496 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
498 DescriptionElementSourceSection descriptionElementSourceSection
= (DescriptionElementSourceSection
) formFactory
499 .createEntityDetailSection(
500 EntityDetailType
.DESCRIPTIONELEMENTSOURCE
,
501 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
503 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
505 DescriptionElementMediaSection descriptionElementMediaSection
= (DescriptionElementMediaSection
) formFactory
506 .createEntityDetailSection(
507 EntityDetailType
.DESCRIPTIONELEMENTMEDIA
,
508 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
510 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
512 addPart(descriptionElementDetailSection
);
513 addPart(descriptionElementSourceSection
);
514 addPart(descriptionElementMediaSection
);
518 * createDescriptionSection
521 private void createDescriptionSection(RootElement parent
) {
523 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
524 .createCdmDetailSection(DetailType
.DESCRIPTION
,
525 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
526 | ExpandableComposite
.EXPANDED
);
528 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
530 NaturalLanguageSection naturalLanguageSection
= (NaturalLanguageSection
) formFactory
531 .createCdmDetailSection(DetailType
.NATURAL_LANGUAGE
,
532 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
533 | ExpandableComposite
.EXPANDED
);
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 DescribedSpecimenSection describedSpecimenSection
= (DescribedSpecimenSection
) formFactory
538 .createEntityDetailSection(EntityDetailType
.DESCRIBED_SPECIMEN
,
539 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
541 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
543 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
544 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
545 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
547 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
549 ScopeSection scopeSection
= (ScopeSection
) formFactory
550 .createEntityDetailSection(EntityDetailType
.SCOPE
,
551 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
553 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
555 addPart(descriptionDetailSection
);
556 addPart(naturalLanguageSection
);
557 addPart(describedSpecimenSection
);
558 addPart(descriptionSourceSection
);
559 addPart(scopeSection
);
563 * Creates the use Description section
566 private void createUseDescriptionSection(RootElement parent
) {
568 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
569 .createCdmDetailSection(DetailType
.DESCRIPTION
,
570 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
571 | ExpandableComposite
.EXPANDED
);
573 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
575 DescriptionSourceSection descriptionSourceSection
= (DescriptionSourceSection
) formFactory
576 .createEntityDetailSection(EntityDetailType
.DESCRIPTIONSOURCE
,
577 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
578 | ExpandableComposite
.EXPANDED
);
580 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
582 addPart(descriptionDetailSection
);
583 addPart(descriptionSourceSection
);
591 private void createImageGallerySection(RootElement parent
) {
593 DescriptionDetailSection descriptionDetailSection
= (DescriptionDetailSection
) formFactory
594 .createCdmDetailSection(DetailType
.DESCRIPTION
,
595 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
596 | ExpandableComposite
.EXPANDED
);
598 addPart(descriptionDetailSection
);
602 * createMediaElementSection
606 private void createMediaElementSection(RootElement parent
) {
608 MediaDetailsSection mediaDetailSection
= (MediaDetailsSection
) formFactory
609 .createCdmDetailSection(DetailType
.MEDIA
,
610 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
611 | ExpandableComposite
.EXPANDED
);
613 addPart(mediaDetailSection
);
617 * createDerivedUnitBaseElementSection
620 private void createDerivedUnitBaseElementSection(RootElement parent
) {
623 GeneralDetailSection generalDetailSection
= (GeneralDetailSection
) formFactory
.createCdmDetailSection(DetailType
.DERIVED_UNIT_GENERAL
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
625 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
627 GatheringEventDetailSection gatheringEventDetailSection
= (GatheringEventDetailSection
) formFactory
.createCdmDetailSection(DetailType
.GATHERING_EVENT
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
629 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
631 FieldObservationDetailSection fieldObservationDetailSection
= (FieldObservationDetailSection
) formFactory
.createCdmDetailSection(DetailType
.FIELD_OBSERVATION
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
633 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
635 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= (DerivedUnitBaseDetailSection
) formFactory
.createCdmDetailSection(DetailType
.DERIVED_UNIT
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
637 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
639 DeterminationDetailSection determinationDetailSection
= (DeterminationDetailSection
) formFactory
.createCdmDetailSection(DetailType
.DETERMINATION
, getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
641 addPart(generalDetailSection
);
642 addPart(gatheringEventDetailSection
);
643 addPart(fieldObservationDetailSection
);
644 addPart(derivedUnitBaseDetailSection
);
645 addPart(determinationDetailSection
);
652 private void createFeatureDistributionSection(RootElement parent
) {
655 FeatureDistributionDetailSection featureDistributionSection
= (FeatureDistributionDetailSection
) formFactory
656 .createCdmDetailSection(DetailType
.FEATURE_DISTRIBUTION
,
657 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
658 | ExpandableComposite
.EXPANDED
);
660 addPart(featureDistributionSection
);
664 * createPolytomousKeyNodeSection
667 private void createPolytomousKeyNodeSection(RootElement parent
) {
670 PolytomousKeyDetailSection polytomousKeyDetailSection
= (PolytomousKeyDetailSection
) formFactory
671 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY
,
672 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
673 | ExpandableComposite
.COMPACT
);
675 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
677 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= (PolytomousKeyNodeDetailSection
) formFactory
678 .createCdmDetailSection(DetailType
.POLYTOMOUS_KEY_NODE
,
679 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
680 | ExpandableComposite
.EXPANDED
);
682 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
684 TaxonomicScopeSection taxonomicScopeSection
= (TaxonomicScopeSection
) formFactory
685 .createEntityDetailSection(EntityDetailType
.TAXONOMIC_SCOPE
,
686 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
688 addPart(polytomousKeyDetailSection
);
689 addPart(polytomousKeyNodeDetailSection
);
690 addPart(taxonomicScopeSection
);
695 * create the UseRecordSection
698 private void createUseRecordSection(RootElement parent
) {
701 UseRecordDetailSection descriptionUseRecordSection
= (UseRecordDetailSection
) formFactory
702 .createCdmDetailSection(DetailType
.USE_RECORD
,
703 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
704 | ExpandableComposite
.EXPANDED
);
706 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
708 addPart(descriptionUseRecordSection
);
717 private void createUserSection(RootElement parent
) {
720 UserDetailSection userDetailSection
= (UserDetailSection
) formFactory
721 .createCdmDetailSection(DetailType
.USER
,
722 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
723 | ExpandableComposite
.EXPANDED
);
725 GroupsByUserDetailSection groupByUserDetailSection
= (GroupsByUserDetailSection
) formFactory
726 .createEntityDetailSection(EntityDetailType
.GROUPS_BY_USER
,
727 getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
728 | ExpandableComposite
.EXPANDED
);
730 addPart(userDetailSection
);
731 addPart(groupByUserDetailSection
);
735 * createTaxonRelationshipSection
738 private void createTaxonRelationshipSection(RootElement parent
) {
741 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= (TaxonRelationshipDetailSection
) formFactory
742 .createCdmDetailSection(DetailType
.TAXON_RELATIONSHIP
,
743 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
744 | ExpandableComposite
.EXPANDED
);
746 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= (ReferencedEntityDetailSection
) formFactory
747 .createCdmDetailSection(DetailType
.REFERENCED_ENTITY
,
748 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
749 | ExpandableComposite
.EXPANDED
);
750 addPart(taxonRelationshipDetailSection
);
751 addPart(referencedEntityBaseDetailSection
);
757 private void createTermVocabularySection(RootElement parent
) {
760 TermVocabularyDetailSection termVocabularyDetailSection
= (TermVocabularyDetailSection
) formFactory
761 .createCdmDetailSection(DetailType
.TERM_VOCABULARY
,
762 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
763 | ExpandableComposite
.EXPANDED
);
764 addPart(termVocabularyDetailSection
);
768 * createDefinedTermSection
771 private void createDefinedTermSection(RootElement parent
) {
774 AbstractFormSection definedTermDetailSection
= formFactory
775 .createDefinedTermDetailSection(getInput().getClass(),
776 getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
777 | ExpandableComposite
.EXPANDED
);
778 addPart(definedTermDetailSection
);