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 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
161 if(facade
.innerDerivedUnit()!=null){
162 getViewPart().changed(facade
.innerDerivedUnit());
164 else if(facade
.innerFieldUnit()!=null){
165 getViewPart().changed(facade
.innerFieldUnit());
169 super.markViewPartDirty();
172 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
177 * @see org.eclipse.jface.viewers.Viewer#refresh()
181 protected void showParts() {
182 // FIXME (CM) : Need to clean out this code.
183 // Too much type checking to decide which detail view to display.
184 // Need to build in a mechanism where navigators / editors are 'aware'
185 // of the corresponding detail viewer.
186 Object input
= getInput();
187 if (input
instanceof TaxonBase
) {
188 createTaxonSections(rootElement
);
190 } else if (input
instanceof NonViralName
) {
191 createNameSections(rootElement
);
193 } else if (input
instanceof Reference
) {
194 createReferenceSections(rootElement
);
196 } else if (input
instanceof Team
) {
197 createTeamDetailSection(rootElement
);
199 } else if (input
instanceof Person
) {
200 createPersonDetailSection(rootElement
);
202 } else if (input
instanceof TeamOrPersonBase
) {
203 createTeamOrPersonBaseDetailSection(rootElement
);
205 } else if (input
instanceof DescriptionBase
) {
206 if(input
instanceof SpecimenDescription
){
207 //TODO: add more sections to DetailsView for SpecimenDescription
208 createSpecimenDescriptionSection(rootElement
);
211 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
212 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
213 UsageTermCollection
.uuidUseMarkerType
);
214 Boolean isUseDescription
= false;
215 for (Marker marker
: descriptionMarkers
) {
216 if (marker
.getMarkerType().equals(useMarkertype
)) {
217 isUseDescription
= true;
220 if (((DescriptionBase
) input
).isImageGallery()) {
221 createImageGallerySection(rootElement
);
223 } else if (isUseDescription
) {
224 createUseDescriptionSection(rootElement
);
226 createDescriptionSection(rootElement
);
230 } else if (input
instanceof DescriptionElementBase
) {
231 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
232 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
233 UsageTermCollection
.uuidUseMarkerType
);
234 Boolean isUseDescription
= false;
235 for (Marker marker
: descriptionMarkers
) {
236 if (marker
.getMarkerType().equals(useMarkertype
)) {
237 isUseDescription
= true;
241 if (isUseDescription
== true && input
instanceof CategoricalData
) {
242 createUseRecordSection(rootElement
);
244 createDescriptionElementSection(rootElement
);
247 } else if (input
instanceof Media
) {
248 createMediaElementSection(rootElement
);
250 } else if (input
instanceof DerivedUnitFacade
) {
251 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
252 createFieldUnitSection(rootElement
);
255 createDerivedUnitBaseElementSection(rootElement
);
258 } else if (input
instanceof FieldUnit
) {
259 createFieldUnitSection(rootElement
);
261 } else if (input
instanceof FeatureNodeContainer
) {
262 createFeatureDistributionSection(rootElement
);
264 } else if (input
instanceof PolytomousKey
) {
265 //createPolytomousKeySection(rootElement);
267 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
268 createPolytomousKeyNodeSection(rootElement
);
269 } else if (input
instanceof User
) {
270 createUserSection(rootElement
);
271 } else if (input
instanceof Group
) {
272 createGroupSection(rootElement
);
273 } else if (input
instanceof TaxonRelationship
) {
274 createTaxonRelationshipSection(rootElement
);
275 } else if (input
instanceof TermVocabulary
) {
276 createTermVocabularySection(rootElement
);
277 } else if (input
instanceof DefinedTermBase
) {
278 createDefinedTermSection(rootElement
);
289 private void createGroupSection(RootElement parent
) {
292 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
293 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
294 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
296 addPart(groupDetailSection
);
297 addPart(memberDetailSection
);
298 addPart(grantedAuthorityDetailSection
);
304 * @see org.eclipse.jface.viewers.Viewer#getSelection()
308 public ISelection
getSelection() {
316 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
317 * .ISelection, boolean)
321 public void setSelection(ISelection selection
, boolean reveal
) {
322 this.selection
= selection
;
323 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
324 fireSelectionChanged(selectionChangedEvent
);
328 * createTaxonSections(RootElement parent)
332 private void createTaxonSections(RootElement parent
) {
335 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
337 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
339 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
340 | ExpandableComposite
.EXPANDED
);
342 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
344 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
346 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
348 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
350 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
352 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
354 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
356 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
358 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
360 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
362 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
364 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(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
);
381 private void createNameSections(RootElement parent
) {
383 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
385 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
387 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
389 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
391 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
393 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
395 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
397 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
399 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
401 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
403 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, 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
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
425 addPart(referenceDetailSection
);
429 * createTeamOrPersonBaseDetailSection
433 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
435 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
437 addPart(teamOrPersonBaseDetailSection
);
441 * createTeamDetailSection
445 private void createTeamDetailSection(RootElement parent
) {
447 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
449 addPart(teamDetailSection
);
453 * createPersonDetailSection
457 private void createPersonDetailSection(RootElement parent
) {
459 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
460 addPart(personDetailSection
);
464 * createDescriptionElementSection
468 private void createDescriptionElementSection(RootElement parent
) {
471 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
473 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
475 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
477 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
479 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
481 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
483 addPart(descriptionElementDetailSection
);
484 addPart(descriptionElementSourceSection
);
485 addPart(descriptionElementMediaSection
);
489 * createDescriptionSection
493 private void createDescriptionSection(RootElement parent
) {
495 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
497 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
499 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
501 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
503 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
505 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
507 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
508 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
509 // getConversationHolder(), parent, Section.TWISTIE);
511 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
513 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
515 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
517 addPart(descriptionDetailSection
);
518 addPart(naturalLanguageSection
);
519 addPart(describedSpecimenSection
);
520 // addPart(descriptionSourceSection);
521 addPart(scopeSection
);
525 * createDescriptionSection
529 private void createSpecimenDescriptionSection(RootElement parent
) {
531 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
532 addPart(descriptionDetailSection
);
536 * Creates the use Description section
540 private void createUseDescriptionSection(RootElement parent
) {
542 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
544 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
546 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
548 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
550 addPart(descriptionDetailSection
);
551 addPart(descriptionSourceSection
);
559 private void createImageGallerySection(RootElement parent
) {
561 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
563 addPart(descriptionDetailSection
);
567 * createMediaElementSection
572 private void createMediaElementSection(RootElement parent
) {
574 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
576 addPart(mediaDetailSection
);
580 * createDerivedUnitBaseElementSection
584 private void createDerivedUnitBaseElementSection(RootElement parent
) {
587 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
589 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
591 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
593 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
595 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
597 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
599 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
601 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
603 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
605 addPart(derivedUnitGeneralDetailSection
);
606 addPart(gatheringEventDetailSection
);
607 addPart(fieldUnitDetailSection
);
608 addPart(derivedUnitBaseDetailSection
);
609 addPart(determinationDetailSection
);
614 * createDerivedUnitBaseElementSection
618 private void createFieldUnitSection(RootElement parent
) {
621 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
623 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
625 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
627 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
629 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
631 addPart(fielUnitGeneralDetailSection
);
632 addPart(gatheringEventDetailSection
);
633 addPart(fieldUnitDetailSection
);
639 private void createFeatureDistributionSection(RootElement parent
) {
642 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
644 addPart(featureDistributionSection
);
648 * createPolytomousKeyNodeSection
652 private void createPolytomousKeyNodeSection(RootElement parent
) {
655 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
657 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
659 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
661 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
663 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
665 addPart(polytomousKeyDetailSection
);
666 addPart(polytomousKeyNodeDetailSection
);
667 addPart(taxonomicScopeSection
);
672 * create the UseRecordSection
676 private void createUseRecordSection(RootElement parent
) {
679 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
681 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
683 addPart(descriptionUseRecordSection
);
693 private void createUserSection(RootElement parent
) {
696 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
698 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
700 addPart(userDetailSection
);
701 addPart(groupByUserDetailSection
);
705 * createTaxonRelationshipSection
709 private void createTaxonRelationshipSection(RootElement parent
) {
712 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
714 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
715 addPart(taxonRelationshipDetailSection
);
716 addPart(referencedEntityBaseDetailSection
);
722 private void createTermVocabularySection(RootElement parent
) {
725 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
726 addPart(termVocabularyDetailSection
);
730 * createDefinedTermSection
734 private void createDefinedTermSection(RootElement parent
) {
737 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
738 addPart(definedTermDetailSection
);