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
.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
.AbstractUtility
;
48 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
49 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
50 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
51 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
52 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
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 DerivedUnit
) {
142 input
= DerivedUnitFacade
.NewInstance((DerivedUnit
) 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 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
) || (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
);
263 private void createGroupSection(RootElement parent
) {
266 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
267 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
268 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
270 addPart(groupDetailSection
);
271 addPart(memberDetailSection
);
272 addPart(grantedAuthorityDetailSection
);
278 * @see org.eclipse.jface.viewers.Viewer#getSelection()
282 public ISelection
getSelection() {
290 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
291 * .ISelection, boolean)
295 public void setSelection(ISelection selection
, boolean reveal
) {
296 this.selection
= selection
;
297 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
298 fireSelectionChanged(selectionChangedEvent
);
302 * createTaxonSections(RootElement parent)
306 private void createTaxonSections(RootElement parent
) {
309 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
311 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
313 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
314 | ExpandableComposite
.EXPANDED
);
316 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
318 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
320 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
322 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
324 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
326 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
328 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
330 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
332 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
334 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
336 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
338 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
340 addPart(taxonBaseDetailSection
);
341 addPart(nonViralNameSection
);
342 addPart(nomenclaturalStatusSection
);
343 addPart(protologSection
);
344 addPart(referenceDetailSection
);
345 addPart(typeDesignationSection
);
346 addPart(nameRelationshipSection
);
347 addPart(parsingMessagesSection
);
355 private void createNameSections(RootElement parent
) {
357 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
359 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
361 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
363 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
365 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
367 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
369 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
371 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
373 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
375 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
377 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
379 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
381 addPart(nonViralNameSection
);
382 addPart(nomenclaturalStatusSection
);
383 addPart(protologSection
);
384 addPart(referenceDetailSection
);
385 addPart(typeDesignationSection
);
386 addPart(nameRelationshipSection
);
390 * createReferenceSections
394 private void createReferenceSections(RootElement parent
) {
397 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
399 addPart(referenceDetailSection
);
403 * createTeamOrPersonBaseDetailSection
407 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
409 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
411 addPart(teamOrPersonBaseDetailSection
);
415 * createTeamDetailSection
419 private void createTeamDetailSection(RootElement parent
) {
421 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
423 addPart(teamDetailSection
);
427 * createPersonDetailSection
431 private void createPersonDetailSection(RootElement parent
) {
433 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
434 addPart(personDetailSection
);
438 * createDescriptionElementSection
442 private void createDescriptionElementSection(RootElement parent
) {
445 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
447 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
449 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
451 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
453 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
455 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
457 addPart(descriptionElementDetailSection
);
458 addPart(descriptionElementSourceSection
);
459 addPart(descriptionElementMediaSection
);
463 * createDescriptionSection
467 private void createDescriptionSection(RootElement parent
) {
469 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
471 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
473 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
475 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
477 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
479 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
481 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
482 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
483 // getConversationHolder(), parent, Section.TWISTIE);
485 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
487 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
489 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
491 addPart(descriptionDetailSection
);
492 addPart(naturalLanguageSection
);
493 addPart(describedSpecimenSection
);
494 // addPart(descriptionSourceSection);
495 addPart(scopeSection
);
499 * Creates the use Description section
503 private void createUseDescriptionSection(RootElement parent
) {
505 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
507 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
509 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
511 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
513 addPart(descriptionDetailSection
);
514 addPart(descriptionSourceSection
);
522 private void createImageGallerySection(RootElement parent
) {
524 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
526 addPart(descriptionDetailSection
);
530 * createMediaElementSection
535 private void createMediaElementSection(RootElement parent
) {
537 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
539 addPart(mediaDetailSection
);
543 * createDerivedUnitBaseElementSection
547 private void createDerivedUnitBaseElementSection(RootElement parent
) {
550 GeneralDetailSection generalDetailSection
= formFactory
.createGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
552 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
554 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
556 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
558 FieldObservationDetailSection fieldObservationDetailSection
= formFactory
.createFieldObservationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
560 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
562 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
564 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
566 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
568 addPart(generalDetailSection
);
569 addPart(gatheringEventDetailSection
);
570 addPart(fieldObservationDetailSection
);
571 addPart(derivedUnitBaseDetailSection
);
572 addPart(determinationDetailSection
);
579 private void createFeatureDistributionSection(RootElement parent
) {
582 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
584 addPart(featureDistributionSection
);
588 * createPolytomousKeyNodeSection
592 private void createPolytomousKeyNodeSection(RootElement parent
) {
595 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
597 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
599 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
601 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
603 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
605 addPart(polytomousKeyDetailSection
);
606 addPart(polytomousKeyNodeDetailSection
);
607 addPart(taxonomicScopeSection
);
612 * create the UseRecordSection
616 private void createUseRecordSection(RootElement parent
) {
619 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
621 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
623 addPart(descriptionUseRecordSection
);
633 private void createUserSection(RootElement parent
) {
636 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
638 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
640 addPart(userDetailSection
);
641 addPart(groupByUserDetailSection
);
645 * createTaxonRelationshipSection
649 private void createTaxonRelationshipSection(RootElement parent
) {
652 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
654 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
655 addPart(taxonRelationshipDetailSection
);
656 addPart(referencedEntityBaseDetailSection
);
662 private void createTermVocabularySection(RootElement parent
) {
665 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
666 addPart(termVocabularyDetailSection
);
670 * createDefinedTermSection
674 private void createDefinedTermSection(RootElement parent
) {
677 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
678 addPart(definedTermDetailSection
);
681 private void createFODetailsView(RootElement parent
) {
684 GeneralDetailSection generalDetailSection
= formFactory
.createFOSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
686 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
688 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
690 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
692 FieldObservationDetailSection fieldObservationDetailSection
= formFactory
.createFODetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
694 addPart(generalDetailSection
);
695 addPart(gatheringEventDetailSection
);
696 addPart(fieldObservationDetailSection
);