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
.PreferencesUtil
;
57 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
58 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
59 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
60 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
67 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
68 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
69 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
70 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
71 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
72 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
73 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
74 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
75 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
76 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
77 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
78 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
79 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
81 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.AmplificationCloningDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.AmplificationGeneralDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.AmplificationPrimerDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.ArtworkGeneralDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DnaSampleGeneralDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.LivingPlantPhotoGeneralDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDeterminationDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SequenceGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SingleReadGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenScanGeneralDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.TissueSampleGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
114 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
118 * The DetailsViewer handles the content of the details view (
119 * {@link DetailsViewPart}).<br>
120 * Depending on the type of the selected element the section of the details view
124 * @created Feb 12, 2010
127 public class DetailsViewer
extends AbstractCdmDataViewer
{
129 private ISelection selection
;
133 * Constructor for DetailsViewer.
137 * a {@link org.eclipse.swt.widgets.Composite} object.
139 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
142 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
143 super(parent
, viewPart
);
146 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
147 // since we are getting implementations of DerivedUnitBase from the bulk
149 // and not derived unit facade objects,
155 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
159 public void setInput(Object input
) {
160 if (input
instanceof DerivedUnit
) {
161 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
162 if(derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.PreservedSpecimen
163 ||derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
164 // Do nothing! This is the case if the new DetailsViews are used that are based on
165 // the DerivedUnits themselves instead of the DerivedUnitFacade
169 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
170 PreferencesUtil
.getDerivedUnitConfigurator());
171 } catch (DerivedUnitFacadeNotSupportedException e
) {
172 AbstractUtility
.error(getClass(), e
);
176 else if(input
instanceof FieldUnit
){
177 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
179 super.setInput(input
);
183 protected void markViewPartDirty() {
184 if (getInput() instanceof DerivedUnitFacade
) {
185 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
186 if(facade
.innerDerivedUnit()!=null){
187 getViewPart().changed(facade
.innerDerivedUnit());
189 else if(facade
.innerFieldUnit()!=null){
190 getViewPart().changed(facade
.innerFieldUnit());
194 super.markViewPartDirty();
198 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
203 * @see org.eclipse.jface.viewers.Viewer#refresh()
207 protected void showParts() {
208 // FIXME (CM) : Need to clean out this code.
209 // Too much type checking to decide which detail view to display.
210 // Need to build in a mechanism where navigators / editors are 'aware'
211 // of the corresponding detail viewer.
212 Object input
= getInput();
213 if (input
instanceof TaxonBase
) {
214 createTaxonSections(rootElement
);
216 } else if (input
instanceof NonViralName
) {
217 createNameSections(rootElement
);
219 } else if (input
instanceof Reference
) {
220 createReferenceSections(rootElement
);
222 } else if (input
instanceof Team
) {
223 createTeamDetailSection(rootElement
);
225 } else if (input
instanceof Person
) {
226 createPersonDetailSection(rootElement
);
228 } else if (input
instanceof TeamOrPersonBase
) {
229 createTeamOrPersonBaseDetailSection(rootElement
);
231 } else if (input
instanceof DescriptionBase
) {
232 if(input
instanceof SpecimenDescription
){
233 //TODO: add more sections to DetailsView for SpecimenDescription
234 createSpecimenDescriptionSection(rootElement
);
237 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
238 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
239 UsageTermCollection
.uuidUseMarkerType
);
240 Boolean isUseDescription
= false;
241 for (Marker marker
: descriptionMarkers
) {
242 if (marker
.getMarkerType().equals(useMarkertype
)) {
243 isUseDescription
= true;
246 if (((DescriptionBase
) input
).isImageGallery()) {
247 createImageGallerySection(rootElement
);
249 } else if (isUseDescription
) {
250 createUseDescriptionSection(rootElement
);
252 createDescriptionSection(rootElement
);
256 } else if (input
instanceof DescriptionElementBase
) {
257 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
258 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
259 UsageTermCollection
.uuidUseMarkerType
);
260 Boolean isUseDescription
= false;
261 for (Marker marker
: descriptionMarkers
) {
262 if (marker
.getMarkerType().equals(useMarkertype
)) {
263 isUseDescription
= true;
267 if (isUseDescription
== true && input
instanceof CategoricalData
) {
268 createUseRecordSection(rootElement
);
270 createDescriptionElementSection(rootElement
);
273 } else if (input
instanceof Media
) {
274 createMediaElementSection(rootElement
);
276 } else if (input
instanceof DerivedUnitFacade
) {
277 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
278 createFieldUnitSection(rootElement
);
280 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
281 createDerivedUnitBaseElementSection(rootElement
);
283 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
284 createTissueSampleSection(rootElement
);
286 // else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.DnaSample){
287 // createDnaSampleSection(rootElement);
289 //FIXME: change to specific SpecimenOrObservationType
290 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
291 createSpecimenScanSection(rootElement
);
293 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
294 createLivingPlantPhotoSection(rootElement
);
296 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
297 createArtworkSection(rootElement
);
300 createDerivedUnitBaseElementSection(rootElement
);
302 } else if (input
instanceof SpecimenOrObservationBase
){
303 SpecimenOrObservationType recordBasis
= ((SpecimenOrObservationBase
<?
>) input
).getRecordBasis();
304 if(recordBasis
==SpecimenOrObservationType
.PreservedSpecimen
){
305 createPreservedSpecimenSpecimenSection(rootElement
);
307 else if(recordBasis
==SpecimenOrObservationType
.FieldUnit
){
308 createFieldUnitSection(rootElement
);
310 else if(recordBasis
==SpecimenOrObservationType
.DnaSample
){
311 createDnaSampleSection(rootElement
);
314 else if(input
instanceof Amplification
){
315 createAmplificationSection(rootElement
);
317 else if(input
instanceof Sequence
){
318 createSequenceSection(rootElement
);
320 else if(input
instanceof SingleRead
){
321 createSingleReadSection(rootElement
);
323 else if (input
instanceof FeatureNodeContainer
) {
324 createFeatureDistributionSection(rootElement
);
326 } else if (input
instanceof PolytomousKey
) {
327 //createPolytomousKeySection(rootElement);
329 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
330 createPolytomousKeyNodeSection(rootElement
);
331 } else if (input
instanceof User
) {
332 createUserSection(rootElement
);
333 } else if (input
instanceof Group
) {
334 createGroupSection(rootElement
);
335 } else if (input
instanceof TaxonRelationship
) {
336 createTaxonRelationshipSection(rootElement
);
337 } else if (input
instanceof TermVocabulary
) {
338 createTermVocabularySection(rootElement
);
339 } else if (input
instanceof DefinedTermBase
) {
340 createDefinedTermSection(rootElement
);
351 private void createGroupSection(RootElement parent
) {
354 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
355 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
356 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
358 addPart(groupDetailSection
);
359 addPart(memberDetailSection
);
360 addPart(grantedAuthorityDetailSection
);
366 * @see org.eclipse.jface.viewers.Viewer#getSelection()
370 public ISelection
getSelection() {
378 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
379 * .ISelection, boolean)
383 public void setSelection(ISelection selection
, boolean reveal
) {
384 this.selection
= selection
;
385 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
386 fireSelectionChanged(selectionChangedEvent
);
390 * createTaxonSections(RootElement parent)
394 private void createTaxonSections(RootElement parent
) {
397 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
399 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
401 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
402 | ExpandableComposite
.EXPANDED
);
404 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
406 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
408 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
410 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
412 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
414 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
416 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
418 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
420 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
422 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
424 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
426 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
428 addPart(taxonBaseDetailSection
);
429 addPart(nonViralNameSection
);
430 addPart(nomenclaturalStatusSection
);
431 addPart(protologSection
);
432 addPart(referenceDetailSection
);
433 addPart(typeDesignationSection
);
434 addPart(nameRelationshipSection
);
435 addPart(parsingMessagesSection
);
443 private void createNameSections(RootElement parent
) {
445 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
447 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
449 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
451 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
453 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
455 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
457 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
459 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
461 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
463 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
465 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
467 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
469 addPart(nonViralNameSection
);
470 addPart(nomenclaturalStatusSection
);
471 addPart(protologSection
);
472 addPart(referenceDetailSection
);
473 addPart(typeDesignationSection
);
474 addPart(nameRelationshipSection
);
478 * createReferenceSections
482 private void createReferenceSections(RootElement parent
) {
485 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
487 addPart(referenceDetailSection
);
491 * createTeamOrPersonBaseDetailSection
495 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
497 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
499 addPart(teamOrPersonBaseDetailSection
);
503 * createTeamDetailSection
507 private void createTeamDetailSection(RootElement parent
) {
509 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
511 addPart(teamDetailSection
);
515 * createPersonDetailSection
519 private void createPersonDetailSection(RootElement parent
) {
521 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
522 addPart(personDetailSection
);
526 * createDescriptionElementSection
530 private void createDescriptionElementSection(RootElement parent
) {
533 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
535 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
539 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
541 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
543 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
545 addPart(descriptionElementDetailSection
);
546 addPart(descriptionElementSourceSection
);
547 addPart(descriptionElementMediaSection
);
551 * createDescriptionSection
555 private void createDescriptionSection(RootElement parent
) {
557 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
559 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
561 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
563 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
565 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
567 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
569 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
570 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
571 // getConversationHolder(), parent, Section.TWISTIE);
573 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
575 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
577 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
579 addPart(descriptionDetailSection
);
580 addPart(naturalLanguageSection
);
581 addPart(describedSpecimenSection
);
582 // addPart(descriptionSourceSection);
583 addPart(scopeSection
);
587 * createDescriptionSection
591 private void createSpecimenDescriptionSection(RootElement parent
) {
593 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
594 addPart(descriptionDetailSection
);
598 * Creates the use Description section
602 private void createUseDescriptionSection(RootElement parent
) {
604 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
606 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
608 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
610 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
612 addPart(descriptionDetailSection
);
613 addPart(descriptionSourceSection
);
621 private void createImageGallerySection(RootElement parent
) {
623 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
625 addPart(descriptionDetailSection
);
629 * createMediaElementSection
634 private void createMediaElementSection(RootElement parent
) {
636 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
638 addPart(mediaDetailSection
);
642 * createDerivedUnitBaseElementSection
646 private void createDerivedUnitBaseElementSection(RootElement parent
) {
649 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
651 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
653 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
659 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
661 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
663 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
665 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
667 addPart(derivedUnitGeneralDetailSection
);
668 addPart(gatheringEventDetailSection
);
669 addPart(fieldUnitDetailSection
);
670 addPart(derivedUnitBaseDetailSection
);
671 addPart(determinationDetailSection
);
675 private void createFieldUnitSection(RootElement parent
) {
678 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
680 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
682 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
684 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
686 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
688 addPart(fielUnitGeneralDetailSection
);
689 addPart(gatheringEventDetailSection
);
690 addPart(fieldUnitDetailSection
);
693 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
696 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
698 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
700 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
702 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
704 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
707 addPart(derivedUnitBaseDetailSection
);
708 addPart(determinationDetailSection
);
711 private void createTissueSampleSection(RootElement parent
) {
714 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
719 private void createDnaSampleSection(RootElement parent
) {
721 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
726 private void createAmplificationSection(RootElement parent
) {
728 AmplificationGeneralDetailSection generalSection
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
730 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
732 AmplificationPrimerDetailSection primerSection
= formFactory
.createAmplificationPrimerDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
734 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
736 AmplificationCloningDetailSection cloningSection
= formFactory
.createAmplificationCloningDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
739 addPart(generalSection
);
740 addPart(primerSection
);
741 addPart(cloningSection
);
744 private void createSequenceSection(RootElement parent
) {
746 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
751 private void createSingleReadSection(RootElement parent
) {
753 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
758 private void createSpecimenScanSection(RootElement parent
) {
760 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
765 private void createLivingPlantPhotoSection(RootElement parent
) {
767 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
772 private void createArtworkSection(RootElement parent
) {
774 ArtworkGeneralDetailSection section
= formFactory
.createArtworkGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
784 private void createFeatureDistributionSection(RootElement parent
) {
787 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
789 addPart(featureDistributionSection
);
793 * createPolytomousKeyNodeSection
797 private void createPolytomousKeyNodeSection(RootElement parent
) {
800 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
802 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
804 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
806 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
808 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
810 addPart(polytomousKeyDetailSection
);
811 addPart(polytomousKeyNodeDetailSection
);
812 addPart(taxonomicScopeSection
);
817 * create the UseRecordSection
821 private void createUseRecordSection(RootElement parent
) {
824 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
826 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
828 addPart(descriptionUseRecordSection
);
838 private void createUserSection(RootElement parent
) {
841 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
843 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
845 addPart(userDetailSection
);
846 addPart(groupByUserDetailSection
);
850 * createTaxonRelationshipSection
854 private void createTaxonRelationshipSection(RootElement parent
) {
857 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
859 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
860 addPart(taxonRelationshipDetailSection
);
861 addPart(referencedEntityBaseDetailSection
);
867 private void createTermVocabularySection(RootElement parent
) {
870 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
871 addPart(termVocabularyDetailSection
);
875 * createDefinedTermSection
879 private void createDefinedTermSection(RootElement parent
) {
882 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
883 addPart(definedTermDetailSection
);