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
.FeatureNodeContainer
;
56 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
57 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
58 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
59 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
60 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
121 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
125 * The DetailsViewer handles the content of the details view (
126 * {@link DetailsViewPart}).<br>
127 * Depending on the type of the selected element the section of the details view
131 * @created Feb 12, 2010
134 public class DetailsViewer
extends AbstractCdmDataViewer
{
136 private ISelection selection
;
140 * Constructor for DetailsViewer.
144 * a {@link org.eclipse.swt.widgets.Composite} object.
146 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
149 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
150 super(parent
, viewPart
);
153 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
154 // since we are getting implementations of DerivedUnitBase from the bulk
156 // and not derived unit facade objects,
162 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
166 public void setInput(Object input
) {
167 if(input
instanceof TreeNode
){
168 input
= ((TreeNode
) input
).getValue();
170 if(input
instanceof GbifResponse
){
171 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
173 if (input
.getClass().equals(DerivedUnit
.class)) {
174 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
176 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
177 PreferencesUtil
.getDerivedUnitConfigurator());
178 } catch (DerivedUnitFacadeNotSupportedException e
) {
179 // MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
182 else if(input
instanceof FieldUnit
){
183 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
185 super.setInput(input
);
189 protected void markViewPartDirty() {
190 if (getInput() instanceof DerivedUnitFacade
) {
191 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
192 if(facade
.innerDerivedUnit()!=null){
193 getViewPart().changed(facade
.innerDerivedUnit());
195 else if(facade
.innerFieldUnit()!=null){
196 getViewPart().changed(facade
.innerFieldUnit());
200 super.markViewPartDirty();
204 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
209 * @see org.eclipse.jface.viewers.Viewer#refresh()
213 protected void showParts() {
214 // FIXME (CM) : Need to clean out this code.
215 // Too much type checking to decide which detail view to display.
216 // Need to build in a mechanism where navigators / editors are 'aware'
217 // of the corresponding detail viewer.
218 Object input
= getInput();
221 if (input
instanceof TaxonBase
) {
222 createTaxonSections(rootElement
);
224 } else if (input
instanceof NonViralName
) {
225 createNameSections(rootElement
);
227 } else if (input
instanceof Reference
) {
228 createReferenceSections(rootElement
);
230 } else if (input
instanceof Team
) {
231 createTeamDetailSection(rootElement
);
233 } else if (input
instanceof Person
) {
234 createPersonDetailSection(rootElement
);
236 } else if (input
instanceof TeamOrPersonBase
) {
237 createTeamOrPersonBaseDetailSection(rootElement
);
239 } else if (input
instanceof DescriptionBase
) {
240 if(input
instanceof SpecimenDescription
){
241 //TODO: add more sections to DetailsView for SpecimenDescription
242 createSpecimenDescriptionSection(rootElement
);
245 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
246 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
247 UsageTermCollection
.uuidUseMarkerType
);
248 Boolean isUseDescription
= false;
249 for (Marker marker
: descriptionMarkers
) {
250 if (marker
.getMarkerType().equals(useMarkertype
)) {
251 isUseDescription
= true;
254 if (((DescriptionBase
) input
).isImageGallery()) {
255 createImageGallerySection(rootElement
);
257 } else if (isUseDescription
) {
258 createUseDescriptionSection(rootElement
);
260 createDescriptionSection(rootElement
);
264 } else if (input
instanceof DescriptionElementBase
) {
265 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
266 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
267 UsageTermCollection
.uuidUseMarkerType
);
268 Boolean isUseDescription
= false;
269 for (Marker marker
: descriptionMarkers
) {
270 if (marker
.getMarkerType().equals(useMarkertype
)) {
271 isUseDescription
= true;
275 if (isUseDescription
== true && input
instanceof CategoricalData
) {
276 createUseRecordSection(rootElement
);
278 createDescriptionElementSection(rootElement
);
281 } else if (input
instanceof Media
) {
282 createMediaElementSection(rootElement
);
284 } else if (input
instanceof DerivedUnitFacade
) {
285 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
286 createFieldUnitSection(rootElement
);
288 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
289 createDerivedUnitBaseElementSection(rootElement
);
291 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
292 //TissueSample should only be created by using it's own class
293 //in future using only one class with different SpecimenOrObservationTypes is desired
294 // createTissueSampleSection(rootElement);
297 createDerivedUnitBaseElementSection(rootElement
);
299 } else if (input
instanceof DnaSample
){
300 DnaSample dnaSample
= (DnaSample
)input
;
301 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
302 createTissueSampleSection(rootElement
);
304 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
305 createDnaSampleSection(rootElement
);
307 } else if (input
instanceof MediaSpecimen
){
308 createMediaSpecimenSection(rootElement
);
310 else if(input
instanceof Amplification
){
311 createAmplificationSection(rootElement
);
313 else if(input
instanceof Sequence
){
314 createSequenceSection(rootElement
);
316 else if(input
instanceof SingleRead
){
317 createSingleReadSection(rootElement
);
319 else if (input
instanceof FeatureNodeContainer
) {
320 createFeatureDistributionSection(rootElement
);
322 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
323 createPolytomousKeyNodeSection(rootElement
);
324 } else if (input
instanceof User
) {
325 createUserSection(rootElement
);
326 } else if (input
instanceof Group
) {
327 createGroupSection(rootElement
);
328 } else if (input
instanceof TaxonRelationship
) {
329 createTaxonRelationshipSection(rootElement
);
330 } else if (input
instanceof TermVocabulary
) {
331 createTermVocabularySection(rootElement
);
332 } else if (input
instanceof DefinedTermBase
) {
333 createDefinedTermSection(rootElement
);
336 createEmptySection(rootElement
);
345 private void createEmptySection(RootElement parent
) {
348 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
350 addPart(emptySection
);
356 private void createGroupSection(RootElement parent
) {
359 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
360 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
361 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
363 addPart(groupDetailSection
);
364 addPart(memberDetailSection
);
365 addPart(grantedAuthorityDetailSection
);
371 * @see org.eclipse.jface.viewers.Viewer#getSelection()
375 public ISelection
getSelection() {
383 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
384 * .ISelection, boolean)
388 public void setSelection(ISelection selection
, boolean reveal
) {
389 this.selection
= selection
;
390 if(this.selection
!=null){
391 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
392 fireSelectionChanged(selectionChangedEvent
);
397 * createTaxonSections(RootElement parent)
401 private void createTaxonSections(RootElement parent
) {
404 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
405 ExpandableComposite
.EXPANDED
| ExpandableComposite
.EXPANDED
);
407 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
408 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
409 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
411 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
412 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
413 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
415 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
416 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
417 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
419 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
420 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
421 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
424 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
425 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
426 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
428 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
429 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
431 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
432 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
434 addPart(protologSection
);
435 addPart(typeDesignationSection
);
436 addPart(nameRelationshipSection
);
440 addPart(parsingMessagesSection
);
441 addPart(taxonBaseDetailSection
);
442 addPart(nonViralNameSection
);
443 addPart(nomenclaturalStatusSection
);
444 addPart(referenceDetailSection
);
452 private void createNameSections(RootElement parent
) {
454 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
455 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
456 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
458 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
459 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
460 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
462 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
463 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
464 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
466 addPart(nonViralNameSection
);
467 addPart(nomenclaturalStatusSection
);
468 addPart(referenceDetailSection
);
470 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
471 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
472 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
474 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
475 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
477 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
478 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
479 addPart(protologSection
);
480 addPart(typeDesignationSection
);
481 addPart(nameRelationshipSection
);
486 * createReferenceSections
490 private void createReferenceSections(RootElement parent
) {
493 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
494 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
496 addPart(referenceDetailSection
);
500 * createTeamOrPersonBaseDetailSection
504 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
506 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
508 addPart(teamOrPersonBaseDetailSection
);
512 * createTeamDetailSection
516 private void createTeamDetailSection(RootElement parent
) {
518 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
520 addPart(teamDetailSection
);
524 * createPersonDetailSection
528 private void createPersonDetailSection(RootElement parent
) {
530 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
531 addPart(personDetailSection
);
535 * createDescriptionElementSection
539 private void createDescriptionElementSection(RootElement parent
) {
542 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
544 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
546 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
548 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
550 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
552 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
554 addPart(descriptionElementDetailSection
);
555 addPart(descriptionElementSourceSection
);
556 addPart(descriptionElementMediaSection
);
560 * createDescriptionSection
564 private void createDescriptionSection(RootElement parent
) {
566 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
568 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
570 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
572 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
574 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
576 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
578 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
579 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
580 // getConversationHolder(), parent, Section.TWISTIE);
582 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
584 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
586 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
588 addPart(descriptionDetailSection
);
589 addPart(naturalLanguageSection
);
590 addPart(describedSpecimenSection
);
591 // addPart(descriptionSourceSection);
592 addPart(scopeSection
);
596 * createDescriptionSection
600 private void createSpecimenDescriptionSection(RootElement parent
) {
602 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
603 addPart(descriptionDetailSection
);
607 * Creates the use Description section
611 private void createUseDescriptionSection(RootElement parent
) {
613 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
615 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
617 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
619 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
621 addPart(descriptionDetailSection
);
622 addPart(descriptionSourceSection
);
630 private void createImageGallerySection(RootElement parent
) {
632 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
634 addPart(descriptionDetailSection
);
638 * createMediaElementSection
643 private void createMediaElementSection(RootElement parent
) {
646 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
648 addPart(mediaDetailSection
);
652 * createDerivedUnitBaseElementSection
656 private void createDerivedUnitBaseElementSection(RootElement parent
) {
659 //different order of sections (Specimen Details as second section and expanded)
660 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
661 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
662 addPart(derivedUnitGeneralDetailSection
);
664 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
666 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
667 addPart(derivedUnitBaseDetailSection
);
669 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
671 OriginalLabelDataSection originalLabelDataSection
= formFactory
.createOriginalLabelDataSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
672 addPart(originalLabelDataSection
);
674 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
676 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
677 addPart(taxonAssociationDetailSection
);
680 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
681 addPart(derivedUnitGeneralDetailSection
);
683 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
685 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
686 addPart(gatheringEventDetailSection
);
688 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
690 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
691 addPart(fieldUnitDetailSection
);
693 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
695 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
696 addPart(derivedUnitBaseDetailSection
);
698 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
700 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
701 addPart(determinationDetailSection
);
706 private void createFieldUnitSection(RootElement parent
) {
709 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
711 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
713 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
715 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
717 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
719 addPart(fielUnitGeneralDetailSection
);
720 addPart(gatheringEventDetailSection
);
721 addPart(fieldUnitDetailSection
);
723 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
724 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
725 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
726 addPart(determinationDetailSection
);
730 private void createTissueSampleSection(RootElement parent
) {
733 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
735 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
737 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
740 addPart(sampleDesignationDetailSection
);
743 private void createDnaSampleSection(RootElement parent
) {
746 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
748 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
750 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
752 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
754 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
757 addPart(qualitySection
);
758 addPart(sampleDesignationDetailSection
);
761 private void createAmplificationSection(RootElement parent
) {
763 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
765 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
767 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
769 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
771 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
773 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
775 AmplificationGelPhotoCollectionDetailSection gelPhotoSection
= formFactory
.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
778 addPart(generalSection
);
779 addPart(primerSection
);
780 addPart(cloningSection
);
781 addPart(gelPhotoSection
);
784 private void createSequenceSection(RootElement parent
) {
787 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
789 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
791 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
793 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
795 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
799 addPart(referenceSection
);
800 addPart(contigFileSection
);
803 private void createSingleReadSection(RootElement parent
) {
806 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
808 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
810 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
813 addPart(pherogramSection
);
816 private void createMediaSpecimenSection(RootElement parent
) {
819 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
820 addPart(generalSection
);
822 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
824 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
825 addPart(rightsSection
);
834 private void createFeatureDistributionSection(RootElement parent
) {
837 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
839 addPart(featureDistributionSection
);
843 * createPolytomousKeyNodeSection
847 private void createPolytomousKeyNodeSection(RootElement parent
) {
850 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
852 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
854 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
856 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
858 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
860 addPart(polytomousKeyDetailSection
);
861 addPart(polytomousKeyNodeDetailSection
);
862 addPart(taxonomicScopeSection
);
867 * create the UseRecordSection
871 private void createUseRecordSection(RootElement parent
) {
874 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
876 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
878 addPart(descriptionUseRecordSection
);
888 private void createUserSection(RootElement parent
) {
891 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
893 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
895 addPart(userDetailSection
);
896 addPart(groupByUserDetailSection
);
900 * createTaxonRelationshipSection
904 private void createTaxonRelationshipSection(RootElement parent
) {
907 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
909 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
910 addPart(taxonRelationshipDetailSection
);
911 addPart(referencedEntityBaseDetailSection
);
917 private void createTermVocabularySection(RootElement parent
) {
920 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
921 addPart(termVocabularyDetailSection
);
925 * createDefinedTermSection
929 private void createDefinedTermSection(RootElement parent
) {
932 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
933 addPart(definedTermDetailSection
);