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
.AmplificationGeneralDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.ArtworkGeneralDetailSection
;
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
.DnaSampleGeneralDetailSection
;
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
.LivingPlantPhotoGeneralDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenDeterminationDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.PreservedSpecimenGeneralDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SequenceGeneralDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SingleReadGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenScanGeneralDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.TissueSampleGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
112 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
116 * The DetailsViewer handles the content of the details view (
117 * {@link DetailsViewPart}).<br>
118 * Depending on the type of the selected element the section of the details view
122 * @created Feb 12, 2010
125 public class DetailsViewer
extends AbstractCdmDataViewer
{
127 private ISelection selection
;
131 * Constructor for DetailsViewer.
135 * a {@link org.eclipse.swt.widgets.Composite} object.
137 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
140 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
141 super(parent
, viewPart
);
144 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
145 // since we are getting implementations of DerivedUnitBase from the bulk
147 // and not derived unit facade objects,
153 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
157 public void setInput(Object input
) {
158 if (input
instanceof DerivedUnit
) {
159 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
160 if(derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.PreservedSpecimen
161 ||derivedUnit
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
162 // Do nothing! This is the case if the new DetailsViews are used that are based on
163 // the DerivedUnits themselves instead of the DerivedUnitFacade
167 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
168 PreferencesUtil
.getDerivedUnitConfigurator());
169 } catch (DerivedUnitFacadeNotSupportedException e
) {
170 AbstractUtility
.error(getClass(), e
);
174 else if(input
instanceof FieldUnit
){
175 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
177 super.setInput(input
);
181 protected void markViewPartDirty() {
182 if (getInput() instanceof DerivedUnitFacade
) {
183 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
184 if(facade
.innerDerivedUnit()!=null){
185 getViewPart().changed(facade
.innerDerivedUnit());
187 else if(facade
.innerFieldUnit()!=null){
188 getViewPart().changed(facade
.innerFieldUnit());
192 super.markViewPartDirty();
196 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
201 * @see org.eclipse.jface.viewers.Viewer#refresh()
205 protected void showParts() {
206 // FIXME (CM) : Need to clean out this code.
207 // Too much type checking to decide which detail view to display.
208 // Need to build in a mechanism where navigators / editors are 'aware'
209 // of the corresponding detail viewer.
210 Object input
= getInput();
211 if (input
instanceof TaxonBase
) {
212 createTaxonSections(rootElement
);
214 } else if (input
instanceof NonViralName
) {
215 createNameSections(rootElement
);
217 } else if (input
instanceof Reference
) {
218 createReferenceSections(rootElement
);
220 } else if (input
instanceof Team
) {
221 createTeamDetailSection(rootElement
);
223 } else if (input
instanceof Person
) {
224 createPersonDetailSection(rootElement
);
226 } else if (input
instanceof TeamOrPersonBase
) {
227 createTeamOrPersonBaseDetailSection(rootElement
);
229 } else if (input
instanceof DescriptionBase
) {
230 if(input
instanceof SpecimenDescription
){
231 //TODO: add more sections to DetailsView for SpecimenDescription
232 createSpecimenDescriptionSection(rootElement
);
235 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
) input
).getMarkers();
236 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
237 UsageTermCollection
.uuidUseMarkerType
);
238 Boolean isUseDescription
= false;
239 for (Marker marker
: descriptionMarkers
) {
240 if (marker
.getMarkerType().equals(useMarkertype
)) {
241 isUseDescription
= true;
244 if (((DescriptionBase
) input
).isImageGallery()) {
245 createImageGallerySection(rootElement
);
247 } else if (isUseDescription
) {
248 createUseDescriptionSection(rootElement
);
250 createDescriptionSection(rootElement
);
254 } else if (input
instanceof DescriptionElementBase
) {
255 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
256 MarkerType useMarkertype
= (MarkerType
) CdmStore
.getService(ITermService
.class).find(
257 UsageTermCollection
.uuidUseMarkerType
);
258 Boolean isUseDescription
= false;
259 for (Marker marker
: descriptionMarkers
) {
260 if (marker
.getMarkerType().equals(useMarkertype
)) {
261 isUseDescription
= true;
265 if (isUseDescription
== true && input
instanceof CategoricalData
) {
266 createUseRecordSection(rootElement
);
268 createDescriptionElementSection(rootElement
);
271 } else if (input
instanceof Media
) {
272 createMediaElementSection(rootElement
);
274 } else if (input
instanceof DerivedUnitFacade
) {
275 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
276 createFieldUnitSection(rootElement
);
278 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
279 createDerivedUnitBaseElementSection(rootElement
);
281 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
282 createTissueSampleSection(rootElement
);
284 // else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.DnaSample){
285 // createDnaSampleSection(rootElement);
287 //FIXME: change to specific SpecimenOrObservationType
288 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
289 createSpecimenScanSection(rootElement
);
291 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
292 createLivingPlantPhotoSection(rootElement
);
294 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.StillImage
){
295 createArtworkSection(rootElement
);
298 createDerivedUnitBaseElementSection(rootElement
);
300 } else if (input
instanceof SpecimenOrObservationBase
){
301 SpecimenOrObservationType recordBasis
= ((SpecimenOrObservationBase
<?
>) input
).getRecordBasis();
302 if(recordBasis
==SpecimenOrObservationType
.PreservedSpecimen
){
303 createPreservedSpecimenSpecimenSection(rootElement
);
305 else if(recordBasis
==SpecimenOrObservationType
.FieldUnit
){
306 createFieldUnitSection(rootElement
);
308 else if(recordBasis
==SpecimenOrObservationType
.DnaSample
){
309 createDnaSampleSection(rootElement
);
312 else if(input
instanceof Amplification
){
313 createAmplificationSection(rootElement
);
315 else if(input
instanceof Sequence
){
316 createSequenceSection(rootElement
);
318 else if(input
instanceof SingleRead
){
319 createSingleReadSection(rootElement
);
321 else if (input
instanceof FeatureNodeContainer
) {
322 createFeatureDistributionSection(rootElement
);
324 } else if (input
instanceof PolytomousKey
) {
325 //createPolytomousKeySection(rootElement);
327 } else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
328 createPolytomousKeyNodeSection(rootElement
);
329 } else if (input
instanceof User
) {
330 createUserSection(rootElement
);
331 } else if (input
instanceof Group
) {
332 createGroupSection(rootElement
);
333 } else if (input
instanceof TaxonRelationship
) {
334 createTaxonRelationshipSection(rootElement
);
335 } else if (input
instanceof TermVocabulary
) {
336 createTermVocabularySection(rootElement
);
337 } else if (input
instanceof DefinedTermBase
) {
338 createDefinedTermSection(rootElement
);
349 private void createGroupSection(RootElement parent
) {
352 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
353 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
354 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
356 addPart(groupDetailSection
);
357 addPart(memberDetailSection
);
358 addPart(grantedAuthorityDetailSection
);
364 * @see org.eclipse.jface.viewers.Viewer#getSelection()
368 public ISelection
getSelection() {
376 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
377 * .ISelection, boolean)
381 public void setSelection(ISelection selection
, boolean reveal
) {
382 this.selection
= selection
;
383 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
384 fireSelectionChanged(selectionChangedEvent
);
388 * createTaxonSections(RootElement parent)
392 private void createTaxonSections(RootElement parent
) {
395 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
397 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
399 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
400 | ExpandableComposite
.EXPANDED
);
402 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
404 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
406 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
408 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
);
410 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
412 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
414 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
416 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
418 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
420 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
422 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
424 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this, ExpandableComposite
.EXPANDED
);
426 addPart(taxonBaseDetailSection
);
427 addPart(nonViralNameSection
);
428 addPart(nomenclaturalStatusSection
);
429 addPart(protologSection
);
430 addPart(referenceDetailSection
);
431 addPart(typeDesignationSection
);
432 addPart(nameRelationshipSection
);
433 addPart(parsingMessagesSection
);
441 private void createNameSections(RootElement parent
) {
443 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
445 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
447 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
449 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
451 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
453 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
455 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
457 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
459 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
461 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
463 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
465 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
467 addPart(nonViralNameSection
);
468 addPart(nomenclaturalStatusSection
);
469 addPart(protologSection
);
470 addPart(referenceDetailSection
);
471 addPart(typeDesignationSection
);
472 addPart(nameRelationshipSection
);
476 * createReferenceSections
480 private void createReferenceSections(RootElement parent
) {
483 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
485 addPart(referenceDetailSection
);
489 * createTeamOrPersonBaseDetailSection
493 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
495 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
497 addPart(teamOrPersonBaseDetailSection
);
501 * createTeamDetailSection
505 private void createTeamDetailSection(RootElement parent
) {
507 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
509 addPart(teamDetailSection
);
513 * createPersonDetailSection
517 private void createPersonDetailSection(RootElement parent
) {
519 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
520 addPart(personDetailSection
);
524 * createDescriptionElementSection
528 private void createDescriptionElementSection(RootElement parent
) {
531 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
533 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
535 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
537 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
539 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
541 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
543 addPart(descriptionElementDetailSection
);
544 addPart(descriptionElementSourceSection
);
545 addPart(descriptionElementMediaSection
);
549 * createDescriptionSection
553 private void createDescriptionSection(RootElement parent
) {
555 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
557 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
559 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
561 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
563 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
565 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
567 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
568 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
569 // getConversationHolder(), parent, Section.TWISTIE);
571 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
573 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
575 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
577 addPart(descriptionDetailSection
);
578 addPart(naturalLanguageSection
);
579 addPart(describedSpecimenSection
);
580 // addPart(descriptionSourceSection);
581 addPart(scopeSection
);
585 * createDescriptionSection
589 private void createSpecimenDescriptionSection(RootElement parent
) {
591 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
592 addPart(descriptionDetailSection
);
596 * Creates the use Description section
600 private void createUseDescriptionSection(RootElement parent
) {
602 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
604 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
606 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
608 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
610 addPart(descriptionDetailSection
);
611 addPart(descriptionSourceSection
);
619 private void createImageGallerySection(RootElement parent
) {
621 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
623 addPart(descriptionDetailSection
);
627 * createMediaElementSection
632 private void createMediaElementSection(RootElement parent
) {
634 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
636 addPart(mediaDetailSection
);
640 * createDerivedUnitBaseElementSection
644 private void createDerivedUnitBaseElementSection(RootElement parent
) {
647 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
649 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
651 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
653 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
655 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
657 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
659 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
661 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
663 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
665 addPart(derivedUnitGeneralDetailSection
);
666 addPart(gatheringEventDetailSection
);
667 addPart(fieldUnitDetailSection
);
668 addPart(derivedUnitBaseDetailSection
);
669 addPart(determinationDetailSection
);
673 private void createFieldUnitSection(RootElement parent
) {
676 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
678 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
680 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
682 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
684 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
686 addPart(fielUnitGeneralDetailSection
);
687 addPart(gatheringEventDetailSection
);
688 addPart(fieldUnitDetailSection
);
691 private void createPreservedSpecimenSpecimenSection(RootElement parent
) {
694 PreservedSpecimenGeneralDetailSection section
= formFactory
.createPreservedSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
696 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
698 PreservedSpecimenDetailSection derivedUnitBaseDetailSection
= formFactory
.createPreservedSpecimenDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
700 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
702 PreservedSpecimenDeterminationDetailSection determinationDetailSection
= formFactory
.createPreservedSpecimenDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
705 addPart(derivedUnitBaseDetailSection
);
706 addPart(determinationDetailSection
);
709 private void createTissueSampleSection(RootElement parent
) {
712 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
714 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
719 private void createDnaSampleSection(RootElement parent
) {
721 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
723 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
728 private void createAmplificationSection(RootElement parent
) {
730 AmplificationGeneralDetailSection section
= formFactory
.createAmplificationGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
732 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
737 private void createSequenceSection(RootElement parent
) {
739 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
741 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
746 private void createSingleReadSection(RootElement parent
) {
748 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
750 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
755 private void createSpecimenScanSection(RootElement parent
) {
757 SpecimenScanGeneralDetailSection section
= formFactory
.createSpecimenScanGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
759 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
764 private void createLivingPlantPhotoSection(RootElement parent
) {
766 LivingPlantPhotoGeneralDetailSection section
= formFactory
.createLivingPlantPhotoGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
768 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
773 private void createArtworkSection(RootElement parent
) {
775 ArtworkGeneralDetailSection section
= formFactory
.createArtworkGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
777 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
787 private void createFeatureDistributionSection(RootElement parent
) {
790 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
792 addPart(featureDistributionSection
);
796 * createPolytomousKeyNodeSection
800 private void createPolytomousKeyNodeSection(RootElement parent
) {
803 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
805 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
807 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
809 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
811 TaxonomicScopeSection taxonomicScopeSection
= formFactory
.createTaxonomicScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.COMPACT
);
813 addPart(polytomousKeyDetailSection
);
814 addPart(polytomousKeyNodeDetailSection
);
815 addPart(taxonomicScopeSection
);
820 * create the UseRecordSection
824 private void createUseRecordSection(RootElement parent
) {
827 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
829 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
831 addPart(descriptionUseRecordSection
);
841 private void createUserSection(RootElement parent
) {
844 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
846 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
848 addPart(userDetailSection
);
849 addPart(groupByUserDetailSection
);
853 * createTaxonRelationshipSection
857 private void createTaxonRelationshipSection(RootElement parent
) {
860 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
862 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
863 addPart(taxonRelationshipDetailSection
);
864 addPart(referencedEntityBaseDetailSection
);
870 private void createTermVocabularySection(RootElement parent
) {
873 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
874 addPart(termVocabularyDetailSection
);
878 * createDefinedTermSection
882 private void createDefinedTermSection(RootElement parent
) {
885 AbstractFormSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
886 addPart(definedTermDetailSection
);