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
.jface
.viewers
.TreeNode
;
19 import org
.eclipse
.swt
.SWT
;
20 import org
.eclipse
.swt
.widgets
.Composite
;
21 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
24 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
25 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
26 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
28 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
29 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
30 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
31 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
32 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
33 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
34 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
35 import eu
.etaxonomy
.cdm
.model
.common
.User
;
36 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
37 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
38 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
39 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
40 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
41 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
42 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
43 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
44 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
45 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
46 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
49 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
50 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
51 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
52 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
53 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
54 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
55 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
56 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
57 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
58 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
59 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
60 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
61 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
123 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
127 * The DetailsViewer handles the content of the details view (
128 * {@link DetailsViewPart}).<br>
129 * Depending on the type of the selected element the section of the details view
133 * @created Feb 12, 2010
136 public class DetailsViewer
extends AbstractCdmDataViewer
{
138 private ISelection selection
;
142 * Constructor for DetailsViewer.
146 * a {@link org.eclipse.swt.widgets.Composite} object.
148 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
151 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
152 super(parent
, viewPart
);
155 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
156 // since we are getting implementations of DerivedUnitBase from the bulk
158 // and not derived unit facade objects,
164 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
168 public void setInput(Object input
) {
169 if(input
instanceof TreeNode
){
170 input
= ((TreeNode
) input
).getValue();
172 if(input
instanceof GbifResponse
){
173 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
175 if (input
.getClass().equals(DerivedUnit
.class)) {
176 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
178 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
179 PreferencesUtil
.getDerivedUnitConfigurator());
180 } catch (DerivedUnitFacadeNotSupportedException e
) {
181 AbstractUtility
.error(getClass(), e
);
184 else if(input
instanceof FieldUnit
){
185 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
187 super.setInput(input
);
191 protected void markViewPartDirty() {
192 if (getInput() instanceof DerivedUnitFacade
) {
193 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
194 if(facade
.innerDerivedUnit()!=null){
195 getViewPart().changed(facade
.innerDerivedUnit());
197 else if(facade
.innerFieldUnit()!=null){
198 getViewPart().changed(facade
.innerFieldUnit());
202 super.markViewPartDirty();
206 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
211 * @see org.eclipse.jface.viewers.Viewer#refresh()
215 protected void showParts() {
216 // FIXME (CM) : Need to clean out this code.
217 // Too much type checking to decide which detail view to display.
218 // Need to build in a mechanism where navigators / editors are 'aware'
219 // of the corresponding detail viewer.
220 Object input
= getInput();
223 if (input
instanceof TaxonBase
) {
224 createTaxonSections(rootElement
);
226 } else if (input
instanceof NonViralName
) {
227 createNameSections(rootElement
);
229 } else if (input
instanceof Reference
) {
230 createReferenceSections(rootElement
);
232 } else if (input
instanceof Team
) {
233 createTeamDetailSection(rootElement
);
235 } else if (input
instanceof Person
) {
236 createPersonDetailSection(rootElement
);
238 } else if (input
instanceof TeamOrPersonBase
) {
239 createTeamOrPersonBaseDetailSection(rootElement
);
241 } else if (input
instanceof DescriptionBase
) {
242 if(input
instanceof SpecimenDescription
){
243 //TODO: add more sections to DetailsView for SpecimenDescription
244 createSpecimenDescriptionSection(rootElement
);
247 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
248 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
249 UsageTermCollection
.uuidUseMarkerType
);
250 Boolean isUseDescription
= false;
251 for (Marker marker
: descriptionMarkers
) {
252 if (marker
.getMarkerType().equals(useMarkertype
)) {
253 isUseDescription
= true;
256 if (((DescriptionBase
) input
).isImageGallery()) {
257 createImageGallerySection(rootElement
);
259 } else if (isUseDescription
) {
260 createUseDescriptionSection(rootElement
);
262 createDescriptionSection(rootElement
);
266 } else if (input
instanceof DescriptionElementBase
) {
267 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
268 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
269 UsageTermCollection
.uuidUseMarkerType
);
270 Boolean isUseDescription
= false;
271 for (Marker marker
: descriptionMarkers
) {
272 if (marker
.getMarkerType().equals(useMarkertype
)) {
273 isUseDescription
= true;
277 if (isUseDescription
== true && input
instanceof CategoricalData
) {
278 createUseRecordSection(rootElement
);
280 createDescriptionElementSection(rootElement
);
283 } else if (input
instanceof Media
) {
284 createMediaElementSection(rootElement
);
286 } else if (input
instanceof DerivedUnitFacade
) {
287 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
288 createFieldUnitSection(rootElement
);
290 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
291 createDerivedUnitBaseElementSection(rootElement
);
293 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
294 createTissueSampleSection(rootElement
);
296 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
297 createSpecimenScanSection(rootElement
);
299 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
300 createLivingPlantPhotoSection(rootElement
);
302 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
303 createMediaSpecimenSection(rootElement
);
306 createDerivedUnitBaseElementSection(rootElement
);
308 } else if (input
instanceof DnaSample
){
309 createDnaSampleSection(rootElement
);
310 } else if (input
instanceof MediaSpecimen
){
311 createMediaSpecimenSection(rootElement
);
313 else if(input
instanceof Amplification
){
314 createAmplificationSection(rootElement
);
316 else if(input
instanceof Sequence
){
317 createSequenceSection(rootElement
);
319 else if(input
instanceof SingleRead
){
320 createSingleReadSection(rootElement
);
322 else if (input
instanceof FeatureNodeContainer
) {
323 createFeatureDistributionSection(rootElement
);
325 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
326 createPolytomousKeyNodeSection(rootElement
);
327 } else if (input
instanceof User
) {
328 createUserSection(rootElement
);
329 } else if (input
instanceof Group
) {
330 createGroupSection(rootElement
);
331 } else if (input
instanceof TaxonRelationship
) {
332 createTaxonRelationshipSection(rootElement
);
333 } else if (input
instanceof TermVocabulary
) {
334 createTermVocabularySection(rootElement
);
335 } else if (input
instanceof DefinedTermBase
) {
336 createDefinedTermSection(rootElement
);
339 createEmptySection(rootElement
);
348 private void createEmptySection(RootElement parent
) {
351 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
353 addPart(emptySection
);
359 private void createGroupSection(RootElement parent
) {
362 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
363 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
364 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
366 addPart(groupDetailSection
);
367 addPart(memberDetailSection
);
368 addPart(grantedAuthorityDetailSection
);
374 * @see org.eclipse.jface.viewers.Viewer#getSelection()
378 public ISelection
getSelection() {
386 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
387 * .ISelection, boolean)
391 public void setSelection(ISelection selection
, boolean reveal
) {
392 this.selection
= selection
;
393 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
394 fireSelectionChanged(selectionChangedEvent
);
398 * createTaxonSections(RootElement parent)
402 private void createTaxonSections(RootElement parent
) {
405 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
407 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
409 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
410 | ExpandableComposite
.EXPANDED
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
416 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
418 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
420 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
422 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
424 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
426 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
428 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
430 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
432 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
434 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
436 addPart(taxonBaseDetailSection
);
437 addPart(nonViralNameSection
);
438 addPart(nomenclaturalStatusSection
);
439 addPart(protologSection
);
440 addPart(referenceDetailSection
);
441 addPart(typeDesignationSection
);
442 addPart(nameRelationshipSection
);
443 addPart(parsingMessagesSection
);
451 private void createNameSections(RootElement parent
) {
453 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
455 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
457 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
459 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
461 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
463 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
465 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
467 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
469 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
471 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
473 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
475 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
477 addPart(nonViralNameSection
);
478 addPart(nomenclaturalStatusSection
);
479 addPart(protologSection
);
480 addPart(referenceDetailSection
);
481 addPart(typeDesignationSection
);
482 addPart(nameRelationshipSection
);
486 * createReferenceSections
490 private void createReferenceSections(RootElement parent
) {
493 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
495 addPart(referenceDetailSection
);
499 * createTeamOrPersonBaseDetailSection
503 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
505 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
507 addPart(teamOrPersonBaseDetailSection
);
511 * createTeamDetailSection
515 private void createTeamDetailSection(RootElement parent
) {
517 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
519 addPart(teamDetailSection
);
523 * createPersonDetailSection
527 private void createPersonDetailSection(RootElement parent
) {
529 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
530 addPart(personDetailSection
);
534 * createDescriptionElementSection
538 private void createDescriptionElementSection(RootElement parent
) {
541 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
543 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
545 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
547 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
549 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
551 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
553 addPart(descriptionElementDetailSection
);
554 addPart(descriptionElementSourceSection
);
555 addPart(descriptionElementMediaSection
);
559 * createDescriptionSection
563 private void createDescriptionSection(RootElement parent
) {
565 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
567 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
569 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
571 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
573 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
575 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
577 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
578 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
579 // getConversationHolder(), parent, Section.TWISTIE);
581 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
583 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
585 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
587 addPart(descriptionDetailSection
);
588 addPart(naturalLanguageSection
);
589 addPart(describedSpecimenSection
);
590 // addPart(descriptionSourceSection);
591 addPart(scopeSection
);
595 * createDescriptionSection
599 private void createSpecimenDescriptionSection(RootElement parent
) {
601 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
602 addPart(descriptionDetailSection
);
606 * Creates the use Description section
610 private void createUseDescriptionSection(RootElement parent
) {
612 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
614 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
616 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
618 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
620 addPart(descriptionDetailSection
);
621 addPart(descriptionSourceSection
);
629 private void createImageGallerySection(RootElement parent
) {
631 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
633 addPart(descriptionDetailSection
);
637 * createMediaElementSection
642 private void createMediaElementSection(RootElement parent
) {
645 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
647 addPart(mediaDetailSection
);
651 * createDerivedUnitBaseElementSection
655 private void createDerivedUnitBaseElementSection(RootElement parent
) {
658 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
660 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
662 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
664 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
666 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
668 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
670 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
672 addPart(derivedUnitGeneralDetailSection
);
673 addPart(gatheringEventDetailSection
);
674 addPart(fieldUnitDetailSection
);
675 addPart(derivedUnitBaseDetailSection
);
677 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
678 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
679 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
680 addPart(determinationDetailSection
);
686 private void createFieldUnitSection(RootElement parent
) {
689 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
691 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
693 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
695 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
697 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
699 addPart(fielUnitGeneralDetailSection
);
700 addPart(gatheringEventDetailSection
);
701 addPart(fieldUnitDetailSection
);
703 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
704 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
705 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
706 addPart(determinationDetailSection
);
710 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
713 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
715 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
717 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
719 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
721 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
724 addPart(derivedUnitBaseDetailSection
);
725 addPart(determinationDetailSection
);
728 private void createTissueSampleSection(RootElement parent
) {
731 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
736 private void createDnaSampleSection(RootElement parent
) {
739 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
741 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
743 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
746 addPart(qualitySection
);
749 private void createAmplificationSection(RootElement parent
) {
751 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
753 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
755 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
757 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
759 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
761 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
763 AmplificationGelPhotoCollectionDetailSection gelPhotoSection
= formFactory
.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
766 addPart(generalSection
);
767 addPart(primerSection
);
768 addPart(cloningSection
);
769 addPart(gelPhotoSection
);
772 private void createSequenceSection(RootElement parent
) {
775 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
777 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
779 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
781 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
783 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
787 addPart(referenceSection
);
788 addPart(contigFileSection
);
791 private void createSingleReadSection(RootElement parent
) {
794 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
796 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
798 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
801 addPart(pherogramSection
);
804 private void createSpecimenScanSection(RootElement parent
) {
806 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
811 private void createLivingPlantPhotoSection(RootElement parent
) {
813 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
818 private void createMediaSpecimenSection(RootElement parent
) {
820 MediaSpecimenGeneralDetailSection section
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
830 private void createFeatureDistributionSection(RootElement parent
) {
833 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
835 addPart(featureDistributionSection
);
839 * createPolytomousKeyNodeSection
843 private void createPolytomousKeyNodeSection(RootElement parent
) {
846 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
848 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
850 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
852 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
854 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
856 addPart(polytomousKeyDetailSection
);
857 addPart(polytomousKeyNodeDetailSection
);
858 addPart(taxonomicScopeSection
);
863 * create the UseRecordSection
867 private void createUseRecordSection(RootElement parent
) {
870 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
872 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
874 addPart(descriptionUseRecordSection
);
884 private void createUserSection(RootElement parent
) {
887 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
889 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
891 addPart(userDetailSection
);
892 addPart(groupByUserDetailSection
);
896 * createTaxonRelationshipSection
900 private void createTaxonRelationshipSection(RootElement parent
) {
903 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
905 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
906 addPart(taxonRelationshipDetailSection
);
907 addPart(referencedEntityBaseDetailSection
);
913 private void createTermVocabularySection(RootElement parent
) {
916 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
917 addPart(termVocabularyDetailSection
);
921 * createDefinedTermSection
925 private void createDefinedTermSection(RootElement parent
) {
928 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
929 addPart(definedTermDetailSection
);