4 * Copyright (C) 2011 EDIT
5 * European Distributed Institute of Taxonomy
6 * http://www.e-taxonomy.eu
8 * The contents of this file are subject to the Mozilla Public License Version 1.1
9 * See LICENSE.TXT at the top of this package for the full license terms.
12 package eu
.etaxonomy
.taxeditor
.view
.detail
;
16 import org
.eclipse
.jface
.viewers
.ISelection
;
17 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
18 import org
.eclipse
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
20 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
22 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
24 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
28 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
29 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
30 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
31 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
32 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
33 import eu
.etaxonomy
.cdm
.model
.common
.User
;
34 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
35 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
36 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
37 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
38 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
39 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
40 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
41 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
42 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
43 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
44 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
45 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
46 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
49 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
50 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
51 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
52 import eu
.etaxonomy
.taxeditor
.editor
.UsageTermCollection
;
53 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
54 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
55 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
56 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
57 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
58 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
59 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.ArtworkGeneralDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
115 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
119 * The DetailsViewer handles the content of the details view (
120 * {@link DetailsViewPart}).<br>
121 * Depending on the type of the selected element the section of the details view
125 * @created Feb 12, 2010
128 public class DetailsViewer
extends AbstractCdmDataViewer
{
130 private ISelection selection
;
134 * Constructor for DetailsViewer.
138 * a {@link org.eclipse.swt.widgets.Composite} object.
140 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
143 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
144 super(parent
, viewPart
);
147 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
148 // since we are getting implementations of DerivedUnitBase from the bulk
150 // and not derived unit facade objects,
156 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
160 public void setInput(Object input
) {
161 if (input
instanceof DerivedUnit
) {
162 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
163 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.BULK_EDITOR_AVOID_FACADE
)){
165 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
166 PreferencesUtil
.getDerivedUnitConfigurator());
167 } catch (DerivedUnitFacadeNotSupportedException e
) {
168 AbstractUtility
.error(getClass(), e
);
172 else if(input
instanceof FieldUnit
){
173 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
175 super.setInput(input
);
179 protected void markViewPartDirty() {
180 if (getInput() instanceof DerivedUnitFacade
) {
181 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
182 if(facade
.innerDerivedUnit()!=null){
183 getViewPart().changed(facade
.innerDerivedUnit());
185 else if(facade
.innerFieldUnit()!=null){
186 getViewPart().changed(facade
.innerFieldUnit());
190 super.markViewPartDirty();
194 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
199 * @see org.eclipse.jface.viewers.Viewer#refresh()
203 protected void showParts() {
204 // FIXME (CM) : Need to clean out this code.
205 // Too much type checking to decide which detail view to display.
206 // Need to build in a mechanism where navigators / editors are 'aware'
207 // of the corresponding detail viewer.
208 Object input
= getInput();
209 if (input
instanceof TaxonBase
) {
210 createTaxonSections(rootElement
);
212 } else if (input
instanceof NonViralName
) {
213 createNameSections(rootElement
);
215 } else if (input
instanceof Reference
) {
216 createReferenceSections(rootElement
);
218 } else if (input
instanceof Team
) {
219 createTeamDetailSection(rootElement
);
221 } else if (input
instanceof Person
) {
222 createPersonDetailSection(rootElement
);
224 } else if (input
instanceof TeamOrPersonBase
) {
225 createTeamOrPersonBaseDetailSection(rootElement
);
227 } else if (input
instanceof DescriptionBase
) {
228 if(input
instanceof SpecimenDescription
){
229 //TODO: add more sections to DetailsView for SpecimenDescription
230 createSpecimenDescriptionSection(rootElement
);
233 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
234 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
235 UsageTermCollection
.uuidUseMarkerType
);
236 Boolean isUseDescription
= false;
237 for (Marker marker
: descriptionMarkers
) {
238 if (marker
.getMarkerType().equals(useMarkertype
)) {
239 isUseDescription
= true;
242 if (((DescriptionBase
) input
).isImageGallery()) {
243 createImageGallerySection(rootElement
);
245 } else if (isUseDescription
) {
246 createUseDescriptionSection(rootElement
);
248 createDescriptionSection(rootElement
);
252 } else if (input
instanceof DescriptionElementBase
) {
253 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
254 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
255 UsageTermCollection
.uuidUseMarkerType
);
256 Boolean isUseDescription
= false;
257 for (Marker marker
: descriptionMarkers
) {
258 if (marker
.getMarkerType().equals(useMarkertype
)) {
259 isUseDescription
= true;
263 if (isUseDescription
== true && input
instanceof CategoricalData
) {
264 createUseRecordSection(rootElement
);
266 createDescriptionElementSection(rootElement
);
269 } else if (input
instanceof Media
) {
270 createMediaElementSection(rootElement
);
272 } else if (input
instanceof DerivedUnitFacade
) {
273 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
274 createFieldUnitSection(rootElement
);
276 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
277 createDerivedUnitBaseElementSection(rootElement
);
279 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
280 createTissueSampleSection(rootElement
);
282 // else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.DnaSample){
283 // createDnaSampleSection(rootElement);
285 //FIXME: change to specific SpecimenOrObservationType
286 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
287 createSpecimenScanSection(rootElement
);
289 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
290 createLivingPlantPhotoSection(rootElement
);
292 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
293 createArtworkSection(rootElement
);
296 createDerivedUnitBaseElementSection(rootElement
);
298 } else if (input
instanceof SpecimenOrObservationBase
){
299 SpecimenOrObservationType recordBasis
= ((SpecimenOrObservationBase
<?
>) input
).getRecordBasis();
300 if(recordBasis
==SpecimenOrObservationType
.PreservedSpecimen
){
301 createPreservedSpecimenSpecimenSection(rootElement
);
303 else if(recordBasis
==SpecimenOrObservationType
.FieldUnit
){
304 createFieldUnitSection(rootElement
);
306 else if(recordBasis
==SpecimenOrObservationType
.DnaSample
){
307 createDnaSampleSection(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 PolytomousKey
) {
323 //createPolytomousKeySection(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
);
347 private void createGroupSection(RootElement parent
) {
350 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
351 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
352 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
354 addPart(groupDetailSection
);
355 addPart(memberDetailSection
);
356 addPart(grantedAuthorityDetailSection
);
362 * @see org.eclipse.jface.viewers.Viewer#getSelection()
366 public ISelection
getSelection() {
374 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
375 * .ISelection, boolean)
379 public void setSelection(ISelection selection
, boolean reveal
) {
380 this.selection
= selection
;
381 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
382 fireSelectionChanged(selectionChangedEvent
);
386 * createTaxonSections(RootElement parent)
390 private void createTaxonSections(RootElement parent
) {
393 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
395 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
397 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
398 | ExpandableComposite
.EXPANDED
);
400 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
402 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
404 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
406 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
408 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
410 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
416 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
418 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
420 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
422 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
424 addPart(taxonBaseDetailSection
);
425 addPart(nonViralNameSection
);
426 addPart(nomenclaturalStatusSection
);
427 addPart(protologSection
);
428 addPart(referenceDetailSection
);
429 addPart(typeDesignationSection
);
430 addPart(nameRelationshipSection
);
431 addPart(parsingMessagesSection
);
439 private void createNameSections(RootElement parent
) {
441 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
443 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
445 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
447 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
449 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
451 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
453 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
455 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
457 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
459 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
461 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
463 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
465 addPart(nonViralNameSection
);
466 addPart(nomenclaturalStatusSection
);
467 addPart(protologSection
);
468 addPart(referenceDetailSection
);
469 addPart(typeDesignationSection
);
470 addPart(nameRelationshipSection
);
474 * createReferenceSections
478 private void createReferenceSections(RootElement parent
) {
481 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
483 addPart(referenceDetailSection
);
487 * createTeamOrPersonBaseDetailSection
491 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
493 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
495 addPart(teamOrPersonBaseDetailSection
);
499 * createTeamDetailSection
503 private void createTeamDetailSection(RootElement parent
) {
505 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
507 addPart(teamDetailSection
);
511 * createPersonDetailSection
515 private void createPersonDetailSection(RootElement parent
) {
517 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
518 addPart(personDetailSection
);
522 * createDescriptionElementSection
526 private void createDescriptionElementSection(RootElement parent
) {
529 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
531 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
533 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
539 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
541 addPart(descriptionElementDetailSection
);
542 addPart(descriptionElementSourceSection
);
543 addPart(descriptionElementMediaSection
);
547 * createDescriptionSection
551 private void createDescriptionSection(RootElement parent
) {
553 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
555 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
557 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
559 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
561 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
563 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
565 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
566 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
567 // getConversationHolder(), parent, Section.TWISTIE);
569 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
571 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
573 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
575 addPart(descriptionDetailSection
);
576 addPart(naturalLanguageSection
);
577 addPart(describedSpecimenSection
);
578 // addPart(descriptionSourceSection);
579 addPart(scopeSection
);
583 * createDescriptionSection
587 private void createSpecimenDescriptionSection(RootElement parent
) {
589 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
590 addPart(descriptionDetailSection
);
594 * Creates the use Description section
598 private void createUseDescriptionSection(RootElement parent
) {
600 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
602 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
604 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
606 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
608 addPart(descriptionDetailSection
);
609 addPart(descriptionSourceSection
);
617 private void createImageGallerySection(RootElement parent
) {
619 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
621 addPart(descriptionDetailSection
);
625 * createMediaElementSection
630 private void createMediaElementSection(RootElement parent
) {
632 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
634 addPart(mediaDetailSection
);
638 * createDerivedUnitBaseElementSection
642 private void createDerivedUnitBaseElementSection(RootElement parent
) {
645 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
647 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
649 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
651 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
653 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
659 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
661 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
663 addPart(derivedUnitGeneralDetailSection
);
664 addPart(gatheringEventDetailSection
);
665 addPart(fieldUnitDetailSection
);
666 addPart(derivedUnitBaseDetailSection
);
667 addPart(determinationDetailSection
);
671 private void createFieldUnitSection(RootElement parent
) {
674 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
676 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
678 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
680 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
682 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
684 addPart(fielUnitGeneralDetailSection
);
685 addPart(gatheringEventDetailSection
);
686 addPart(fieldUnitDetailSection
);
689 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
692 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
694 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
696 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
698 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
700 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
703 addPart(derivedUnitBaseDetailSection
);
704 addPart(determinationDetailSection
);
707 private void createTissueSampleSection(RootElement parent
) {
710 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
715 private void createDnaSampleSection(RootElement parent
) {
717 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
722 private void createAmplificationSection(RootElement parent
) {
724 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
726 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
728 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
730 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
732 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
735 addPart(generalSection
);
736 addPart(primerSection
);
737 addPart(cloningSection
);
740 private void createSequenceSection(RootElement parent
) {
742 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
747 private void createSingleReadSection(RootElement parent
) {
749 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
754 private void createSpecimenScanSection(RootElement parent
) {
756 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
761 private void createLivingPlantPhotoSection(RootElement parent
) {
763 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
768 private void createArtworkSection(RootElement parent
) {
770 ArtworkGeneralDetailSection section
= formFactory
.createArtworkGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
780 private void createFeatureDistributionSection(RootElement parent
) {
783 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
785 addPart(featureDistributionSection
);
789 * createPolytomousKeyNodeSection
793 private void createPolytomousKeyNodeSection(RootElement parent
) {
796 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
798 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
800 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
802 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
804 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
806 addPart(polytomousKeyDetailSection
);
807 addPart(polytomousKeyNodeDetailSection
);
808 addPart(taxonomicScopeSection
);
813 * create the UseRecordSection
817 private void createUseRecordSection(RootElement parent
) {
820 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
822 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
824 addPart(descriptionUseRecordSection
);
834 private void createUserSection(RootElement parent
) {
837 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
839 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
841 addPart(userDetailSection
);
842 addPart(groupByUserDetailSection
);
846 * createTaxonRelationshipSection
850 private void createTaxonRelationshipSection(RootElement parent
) {
853 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
855 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
856 addPart(taxonRelationshipDetailSection
);
857 addPart(referencedEntityBaseDetailSection
);
863 private void createTermVocabularySection(RootElement parent
) {
866 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
867 addPart(termVocabularyDetailSection
);
871 * createDefinedTermSection
875 private void createDefinedTermSection(RootElement parent
) {
878 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
879 addPart(definedTermDetailSection
);