3 * Copyright (C) 2011 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.view
.detail
;
15 import org
.eclipse
.jface
.viewers
.ISelection
;
16 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
21 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
22 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
23 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
24 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
27 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
29 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
30 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
31 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
32 import eu
.etaxonomy
.cdm
.model
.common
.User
;
33 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
34 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
35 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
36 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
37 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
38 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
39 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
40 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
41 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
42 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
43 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
44 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
45 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
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsSection
;
53 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralSection
;
54 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventSection
;
55 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsSection
;
56 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsSection
;
57 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralSection
;
58 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
95 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
99 * The DetailsViewer handles the content of the details view (
100 * {@link DetailsViewPart}).<br>
101 * Depending on the type of the selected element the section of the details view
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 DerivedUnit
) {
143 input
= DerivedUnitFacade
.NewInstance((DerivedUnit
) input
,PreferencesUtil
.getDerivedUnitConfigurator());
144 } catch (DerivedUnitFacadeNotSupportedException e
) {
145 AbstractUtility
.error(getClass(), e
);
148 else if(input
instanceof FieldUnit
){
149 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
,PreferencesUtil
.getDerivedUnitConfigurator());
151 super.setInput(input
);
155 protected void markViewPartDirty() {
156 if (getInput() instanceof DerivedUnitFacade
) {
157 DerivedUnitFacade derivedUnitFacade
= (DerivedUnitFacade
) getInput();
158 DerivedUnit innerDerivedUnit
= derivedUnitFacade
.innerDerivedUnit();
159 FieldUnit innerFieldUnit
= derivedUnitFacade
.innerFieldUnit();
160 if(innerDerivedUnit
!=null){
161 getViewPart().changed(innerDerivedUnit
);
163 else if(innerFieldUnit
!=null){
164 getViewPart().changed(innerFieldUnit
);
168 super.markViewPartDirty();
171 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
176 * @see org.eclipse.jface.viewers.Viewer#refresh()
180 protected void showParts() {
181 // FIXME (CM) : Need to clean out this code.
182 // Too much type checking to decide which detail view to display.
183 // Need to build in a mechanism where navigators / editors are 'aware'
184 // of the corresponding detail viewer.
185 Object input
= getInput();
186 if (input
instanceof TaxonBase
) {
187 createTaxonSections(rootElement
);
189 } else if (input
instanceof NonViralName
) {
190 createNameSections(rootElement
);
192 } else if (input
instanceof Reference
) {
193 createReferenceSections(rootElement
);
195 } else if (input
instanceof Team
) {
196 createTeamDetailSection(rootElement
);
198 } else if (input
instanceof Person
) {
199 createPersonDetailSection(rootElement
);
201 } else if (input
instanceof TeamOrPersonBase
) {
202 createTeamOrPersonBaseDetailSection(rootElement
);
204 } else if (input
instanceof DescriptionBase
) {
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
);
223 } else if (input
instanceof DescriptionElementBase
) {
224 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
225 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
226 UsageTermCollection
.uuidUseMarkerType
);
227 Boolean isUseDescription
= false;
228 for (Marker marker
: descriptionMarkers
) {
229 if (marker
.getMarkerType().equals(useMarkertype
)) {
230 isUseDescription
= true;
234 if (isUseDescription
== true && input
instanceof CategoricalData
) {
235 createUseRecordSection(rootElement
);
237 createDescriptionElementSection(rootElement
);
240 } else if (input
instanceof Media
) {
241 createMediaElementSection(rootElement
);
243 } else if (input
instanceof DerivedUnitFacade
) {
244 DerivedUnitFacade derivedUnitFacade
= (DerivedUnitFacade
)input
;
246 if(derivedUnitFacade
.getType()==SpecimenOrObservationType
.FieldUnit
){
247 createFieldObservationDetailsView(rootElement
);
249 createSpecimenDetailsView(rootElement
);
251 } else if (input
instanceof FeatureNodeContainer
) {
252 createFeatureDistributionSection(rootElement
);
254 } else if (input
instanceof PolytomousKey
) {
255 // createPolytomousKeySection(rootElement);
257 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
258 createPolytomousKeyNodeSection(rootElement
);
259 } else if (input
instanceof User
) {
260 createUserSection(rootElement
);
261 } else if (input
instanceof Group
) {
262 createGroupSection(rootElement
);
263 } else if (input
instanceof TaxonRelationship
) {
264 createTaxonRelationshipSection(rootElement
);
265 } else if (input
instanceof TermVocabulary
) {
266 createTermVocabularySection(rootElement
);
267 } else if (input
instanceof DefinedTermBase
) {
268 createDefinedTermSection(rootElement
);
278 private void createGroupSection(RootElement parent
) {
281 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
282 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
283 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
285 addPart(groupDetailSection
);
286 addPart(memberDetailSection
);
287 addPart(grantedAuthorityDetailSection
);
293 * @see org.eclipse.jface.viewers.Viewer#getSelection()
297 public ISelection
getSelection() {
305 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
306 * .ISelection, boolean)
310 public void setSelection(ISelection selection
, boolean reveal
) {
311 this.selection
= selection
;
312 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
313 fireSelectionChanged(selectionChangedEvent
);
317 * createTaxonSections(RootElement parent)
321 private void createTaxonSections(RootElement parent
) {
324 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
326 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
328 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
329 | ExpandableComposite
.EXPANDED
);
331 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
333 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
335 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
337 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
339 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
341 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
343 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
345 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
347 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
349 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
351 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
353 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
355 addPart(taxonBaseDetailSection
);
356 addPart(nonViralNameSection
);
357 addPart(nomenclaturalStatusSection
);
358 addPart(protologSection
);
359 addPart(referenceDetailSection
);
360 addPart(typeDesignationSection
);
361 addPart(nameRelationshipSection
);
362 addPart(parsingMessagesSection
);
370 private void createNameSections(RootElement parent
) {
372 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
374 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
376 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
378 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
380 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
382 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
384 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
386 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
388 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
390 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
392 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
394 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
396 addPart(nonViralNameSection
);
397 addPart(nomenclaturalStatusSection
);
398 addPart(protologSection
);
399 addPart(referenceDetailSection
);
400 addPart(typeDesignationSection
);
401 addPart(nameRelationshipSection
);
405 * createReferenceSections
409 private void createReferenceSections(RootElement parent
) {
412 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
414 addPart(referenceDetailSection
);
418 * createTeamOrPersonBaseDetailSection
422 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
424 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
426 addPart(teamOrPersonBaseDetailSection
);
430 * createTeamDetailSection
434 private void createTeamDetailSection(RootElement parent
) {
436 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
438 addPart(teamDetailSection
);
442 * createPersonDetailSection
446 private void createPersonDetailSection(RootElement parent
) {
448 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
449 addPart(personDetailSection
);
453 * createDescriptionElementSection
457 private void createDescriptionElementSection(RootElement parent
) {
460 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
462 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
464 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
466 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
468 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
470 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
472 addPart(descriptionElementDetailSection
);
473 addPart(descriptionElementSourceSection
);
474 addPart(descriptionElementMediaSection
);
478 * createDescriptionSection
482 private void createDescriptionSection(RootElement parent
) {
484 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
486 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
488 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
490 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
492 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
494 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
496 // DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
498 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
500 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
502 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
504 addPart(descriptionDetailSection
);
505 addPart(naturalLanguageSection
);
506 addPart(describedSpecimenSection
);
507 // addPart(descriptionSourceSection);
508 addPart(scopeSection
);
512 * Creates the use Description section
516 private void createUseDescriptionSection(RootElement parent
) {
518 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
520 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
522 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
524 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
526 addPart(descriptionDetailSection
);
527 addPart(descriptionSourceSection
);
534 private void createImageGallerySection(RootElement parent
) {
536 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
538 addPart(descriptionDetailSection
);
542 * createMediaElementSection
547 private void createMediaElementSection(RootElement parent
) {
549 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
551 addPart(mediaDetailSection
);
555 * createDerivedUnitBaseElementSection
559 private void createFieldObservationDetailsView(RootElement parent
) {
562 FieldObservationGeneralSection fieldObservationSection
= formFactory
.createFieldObservationGeneralSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
564 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
566 GatheringEventSection gatheringEventDetailSection
= formFactory
.createGatheringEventSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
568 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
570 FieldObservationDetailsSection fieldObservationDetailSection
= formFactory
.createFieldObservationDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
572 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
574 // DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
576 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
578 // DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
580 addPart(fieldObservationSection
);
581 addPart(gatheringEventDetailSection
);
582 addPart(fieldObservationDetailSection
);
583 // addPart(derivedUnitBaseDetailSection);
584 // addPart(determinationDetailSection);
588 * createDerivedUnitBaseElementSection
592 private void createSpecimenDetailsView(RootElement parent
) {
595 SpecimenGeneralSection specimenSection
= formFactory
.createSpecimenSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
597 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
599 SpecimenDetailsSection specimenDetailsSection
= formFactory
.createSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
601 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
603 DerivedUnitDetailsSection derivedUnitDetailsSection
= formFactory
.createDerivedUnitDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
605 addPart(specimenSection
);
606 addPart(specimenDetailsSection
);
607 addPart(derivedUnitDetailsSection
);
613 private void createFeatureDistributionSection(RootElement parent
) {
616 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
618 addPart(featureDistributionSection
);
622 * createPolytomousKeyNodeSection
626 private void createPolytomousKeyNodeSection(RootElement parent
) {
629 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
631 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
633 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
635 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
637 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
639 addPart(polytomousKeyDetailSection
);
640 addPart(polytomousKeyNodeDetailSection
);
641 addPart(taxonomicScopeSection
);
646 * create the UseRecordSection
650 private void createUseRecordSection(RootElement parent
) {
653 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 addPart(descriptionUseRecordSection
);
666 private void createUserSection(RootElement parent
) {
669 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
671 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
673 addPart(userDetailSection
);
674 addPart(groupByUserDetailSection
);
678 * createTaxonRelationshipSection
682 private void createTaxonRelationshipSection(RootElement parent
) {
685 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
687 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
688 addPart(taxonRelationshipDetailSection
);
689 addPart(referencedEntityBaseDetailSection
);
695 private void createTermVocabularySection(RootElement parent
) {
698 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
699 addPart(termVocabularyDetailSection
);
703 * createDefinedTermSection
707 private void createDefinedTermSection(RootElement parent
) {
710 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
711 addPart(definedTermDetailSection
);