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
.description
.SpecimenDescription
;
40 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
41 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
42 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
43 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
44 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
45 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
46 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
47 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
48 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
49 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
50 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
51 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
52 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
53 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
54 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
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
.PolytomousKeyDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
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 * The DetailsViewer handles the content of the details view (
102 * {@link DetailsViewPart}).<br>
103 * Depending on the type of the selected element the section of the details view
107 * @created Feb 12, 2010
110 public class DetailsViewer
extends AbstractCdmDataViewer
{
112 private ISelection selection
;
116 * Constructor for DetailsViewer.
120 * a {@link org.eclipse.swt.widgets.Composite} object.
122 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
125 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
126 super(parent
, viewPart
);
129 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
130 // since we are getting implementations of DerivedUnitBase from the bulk
132 // and not derived unit facade objects,
138 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
142 public void setInput(Object input
) {
143 if (input
instanceof DerivedUnit
) {
145 input
= DerivedUnitFacade
.NewInstance((DerivedUnit
) input
,
146 PreferencesUtil
.getDerivedUnitConfigurator());
147 } catch (DerivedUnitFacadeNotSupportedException e
) {
148 AbstractUtility
.error(getClass(), e
);
151 else if(input
instanceof FieldUnit
){
152 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
154 super.setInput(input
);
158 protected void markViewPartDirty() {
159 if (getInput() instanceof DerivedUnitFacade
) {
160 getViewPart().changed(((DerivedUnitFacade
) getInput()).innerDerivedUnit());
163 super.markViewPartDirty();
166 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
171 * @see org.eclipse.jface.viewers.Viewer#refresh()
175 protected void showParts() {
176 // FIXME (CM) : Need to clean out this code.
177 // Too much type checking to decide which detail view to display.
178 // Need to build in a mechanism where navigators / editors are 'aware'
179 // of the corresponding detail viewer.
180 Object input
= getInput();
181 if (input
instanceof TaxonBase
) {
182 createTaxonSections(rootElement
);
184 } else if (input
instanceof NonViralName
) {
185 createNameSections(rootElement
);
187 } else if (input
instanceof Reference
) {
188 createReferenceSections(rootElement
);
190 } else if (input
instanceof Team
) {
191 createTeamDetailSection(rootElement
);
193 } else if (input
instanceof Person
) {
194 createPersonDetailSection(rootElement
);
196 } else if (input
instanceof TeamOrPersonBase
) {
197 createTeamOrPersonBaseDetailSection(rootElement
);
199 } else if (input
instanceof DescriptionBase
) {
200 if(input
instanceof SpecimenDescription
){
201 //TODO: add more sections to DetailsView for SpecimenDescription
202 createSpecimenDescriptionSection(rootElement
);
205 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
206 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
207 UsageTermCollection
.uuidUseMarkerType
);
208 Boolean isUseDescription
= false;
209 for (Marker marker
: descriptionMarkers
) {
210 if (marker
.getMarkerType().equals(useMarkertype
)) {
211 isUseDescription
= true;
214 if (((DescriptionBase
) input
).isImageGallery()) {
215 createImageGallerySection(rootElement
);
217 } else if (isUseDescription
) {
218 createUseDescriptionSection(rootElement
);
220 createDescriptionSection(rootElement
);
224 } else if (input
instanceof DescriptionElementBase
) {
225 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
226 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
227 UsageTermCollection
.uuidUseMarkerType
);
228 Boolean isUseDescription
= false;
229 for (Marker marker
: descriptionMarkers
) {
230 if (marker
.getMarkerType().equals(useMarkertype
)) {
231 isUseDescription
= true;
235 if (isUseDescription
== true && input
instanceof CategoricalData
) {
236 createUseRecordSection(rootElement
);
238 createDescriptionElementSection(rootElement
);
241 } else if (input
instanceof Media
) {
242 createMediaElementSection(rootElement
);
244 } else if (input
instanceof DerivedUnitFacade
) {
245 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
246 createFieldUnitSection(rootElement
);
249 createDerivedUnitBaseElementSection(rootElement
);
252 } else if (input
instanceof FieldUnit
) {
253 createFieldUnitSection(rootElement
);
255 } else if (input
instanceof FeatureNodeContainer
) {
256 createFeatureDistributionSection(rootElement
);
258 } else if (input
instanceof PolytomousKey
) {
259 //createPolytomousKeySection(rootElement);
261 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
262 createPolytomousKeyNodeSection(rootElement
);
263 } else if (input
instanceof User
) {
264 createUserSection(rootElement
);
265 } else if (input
instanceof Group
) {
266 createGroupSection(rootElement
);
267 } else if (input
instanceof TaxonRelationship
) {
268 createTaxonRelationshipSection(rootElement
);
269 } else if (input
instanceof TermVocabulary
) {
270 createTermVocabularySection(rootElement
);
271 } else if (input
instanceof DefinedTermBase
) {
272 createDefinedTermSection(rootElement
);
283 private void createGroupSection(RootElement parent
) {
286 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
287 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
288 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
290 addPart(groupDetailSection
);
291 addPart(memberDetailSection
);
292 addPart(grantedAuthorityDetailSection
);
298 * @see org.eclipse.jface.viewers.Viewer#getSelection()
302 public ISelection
getSelection() {
310 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
311 * .ISelection, boolean)
315 public void setSelection(ISelection selection
, boolean reveal
) {
316 this.selection
= selection
;
317 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
318 fireSelectionChanged(selectionChangedEvent
);
322 * createTaxonSections(RootElement parent)
326 private void createTaxonSections(RootElement parent
) {
329 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
331 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
333 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
334 | ExpandableComposite
.EXPANDED
);
336 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
338 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
340 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
342 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
344 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
346 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
348 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
350 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
352 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
354 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
356 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
358 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
360 addPart(taxonBaseDetailSection
);
361 addPart(nonViralNameSection
);
362 addPart(nomenclaturalStatusSection
);
363 addPart(protologSection
);
364 addPart(referenceDetailSection
);
365 addPart(typeDesignationSection
);
366 addPart(nameRelationshipSection
);
367 addPart(parsingMessagesSection
);
375 private void createNameSections(RootElement parent
) {
377 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
379 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
381 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
383 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
385 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
387 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
389 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
391 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
393 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
395 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
397 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
399 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
401 addPart(nonViralNameSection
);
402 addPart(nomenclaturalStatusSection
);
403 addPart(protologSection
);
404 addPart(referenceDetailSection
);
405 addPart(typeDesignationSection
);
406 addPart(nameRelationshipSection
);
410 * createReferenceSections
414 private void createReferenceSections(RootElement parent
) {
417 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
419 addPart(referenceDetailSection
);
423 * createTeamOrPersonBaseDetailSection
427 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
429 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
431 addPart(teamOrPersonBaseDetailSection
);
435 * createTeamDetailSection
439 private void createTeamDetailSection(RootElement parent
) {
441 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
443 addPart(teamDetailSection
);
447 * createPersonDetailSection
451 private void createPersonDetailSection(RootElement parent
) {
453 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
454 addPart(personDetailSection
);
458 * createDescriptionElementSection
462 private void createDescriptionElementSection(RootElement parent
) {
465 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
467 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
469 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
471 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
473 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
475 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
477 addPart(descriptionElementDetailSection
);
478 addPart(descriptionElementSourceSection
);
479 addPart(descriptionElementMediaSection
);
483 * createDescriptionSection
487 private void createDescriptionSection(RootElement parent
) {
489 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
491 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
493 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
495 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
497 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
499 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
501 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
502 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
503 // getConversationHolder(), parent, Section.TWISTIE);
505 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
507 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
509 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
511 addPart(descriptionDetailSection
);
512 addPart(naturalLanguageSection
);
513 addPart(describedSpecimenSection
);
514 // addPart(descriptionSourceSection);
515 addPart(scopeSection
);
519 * createDescriptionSection
523 private void createSpecimenDescriptionSection(RootElement parent
) {
525 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
526 addPart(descriptionDetailSection
);
530 * Creates the use Description section
534 private void createUseDescriptionSection(RootElement parent
) {
536 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
538 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
540 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
542 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
544 addPart(descriptionDetailSection
);
545 addPart(descriptionSourceSection
);
553 private void createImageGallerySection(RootElement parent
) {
555 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
557 addPart(descriptionDetailSection
);
561 * createMediaElementSection
566 private void createMediaElementSection(RootElement parent
) {
568 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
570 addPart(mediaDetailSection
);
574 * createDerivedUnitBaseElementSection
578 private void createDerivedUnitBaseElementSection(RootElement parent
) {
581 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
583 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
585 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
587 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
589 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
591 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
593 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
595 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
597 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
599 addPart(derivedUnitGeneralDetailSection
);
600 addPart(gatheringEventDetailSection
);
601 addPart(fieldUnitDetailSection
);
602 addPart(derivedUnitBaseDetailSection
);
603 addPart(determinationDetailSection
);
608 * createDerivedUnitBaseElementSection
612 private void createFieldUnitSection(RootElement parent
) {
615 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
617 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
619 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
621 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
623 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
625 addPart(fielUnitGeneralDetailSection
);
626 addPart(gatheringEventDetailSection
);
627 addPart(fieldUnitDetailSection
);
633 private void createFeatureDistributionSection(RootElement parent
) {
636 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
638 addPart(featureDistributionSection
);
642 * createPolytomousKeyNodeSection
646 private void createPolytomousKeyNodeSection(RootElement parent
) {
649 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
651 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
653 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
659 addPart(polytomousKeyDetailSection
);
660 addPart(polytomousKeyNodeDetailSection
);
661 addPart(taxonomicScopeSection
);
666 * create the UseRecordSection
670 private void createUseRecordSection(RootElement parent
) {
673 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
675 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
677 addPart(descriptionUseRecordSection
);
687 private void createUserSection(RootElement parent
) {
690 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
692 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
694 addPart(userDetailSection
);
695 addPart(groupByUserDetailSection
);
699 * createTaxonRelationshipSection
703 private void createTaxonRelationshipSection(RootElement parent
) {
706 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
708 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
709 addPart(taxonRelationshipDetailSection
);
710 addPart(referencedEntityBaseDetailSection
);
716 private void createTermVocabularySection(RootElement parent
) {
719 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
720 addPart(termVocabularyDetailSection
);
724 * createDefinedTermSection
728 private void createDefinedTermSection(RootElement parent
) {
731 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
732 addPart(definedTermDetailSection
);