4 * Copyright (C) 2011 EDIT
5 * European Distributed Institute of Taxonomy
6 * http://www.e-taxonomy.eu
8 * The contents of this file are subject to the Mozilla Public License Version 1.1
9 * See LICENSE.TXT at the top of this package for the full license terms.
12 package eu
.etaxonomy
.taxeditor
.view
.detail
;
16 import org
.eclipse
.jface
.viewers
.ISelection
;
17 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
18 import org
.eclipse
.jface
.viewers
.TreeNode
;
19 import org
.eclipse
.swt
.SWT
;
20 import org
.eclipse
.swt
.widgets
.Composite
;
21 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
23 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
24 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
25 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
26 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
27 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
28 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
29 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
30 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
31 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
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
.PolytomousKeyNode
;
38 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
39 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
40 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
41 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
42 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
43 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
44 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
45 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
46 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
48 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
49 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
50 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
51 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
52 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
53 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
54 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
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
.UsageTermCollection
;
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
.EmptySection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
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
.supplemental
.RightsSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
116 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
120 * The DetailsViewer handles the content of the details view (
121 * {@link DetailsViewPart}).<br>
122 * Depending on the type of the selected element the section of the details view
126 * @created Feb 12, 2010
129 public class DetailsViewer
extends AbstractCdmDataViewer
{
131 private ISelection selection
;
135 * Constructor for DetailsViewer.
139 * a {@link org.eclipse.swt.widgets.Composite} object.
141 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
144 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
145 super(parent
, viewPart
);
148 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
149 // since we are getting implementations of DerivedUnitBase from the bulk
151 // and not derived unit facade objects,
154 public void setInput(Object input
) {
155 if(input
instanceof TreeNode
){
156 input
= ((TreeNode
) input
).getValue();
158 if(input
instanceof GbifResponse
){
159 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
161 if (input
.getClass().equals(DerivedUnit
.class)) {
162 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
164 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
165 PreferencesUtil
.getDerivedUnitConfigurator());
166 } catch (DerivedUnitFacadeNotSupportedException e
) {
167 // MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
170 else if(input
instanceof FieldUnit
){
171 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
173 super.setInput(input
);
177 protected void markViewPartDirty() {
178 if (getInput() instanceof DerivedUnitFacade
) {
179 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
180 if(facade
.innerDerivedUnit()!=null){
181 getViewPart().changed(facade
.innerDerivedUnit());
183 else if(facade
.innerFieldUnit()!=null){
184 getViewPart().changed(facade
.innerFieldUnit());
188 super.markViewPartDirty();
192 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
197 protected void showParts() {
198 // FIXME (CM) : Need to clean out this code.
199 // Too much type checking to decide which detail view to display.
200 // Need to build in a mechanism where navigators / editors are 'aware'
201 // of the corresponding detail viewer.
202 Object input
= getInput();
205 if (input
instanceof TaxonBase
) {
206 createTaxonSections(rootElement
);
208 } else if (input
instanceof NonViralName
) {
209 createNameSections(rootElement
);
211 } else if (input
instanceof Reference
) {
212 createReferenceSections(rootElement
);
214 } else if (input
instanceof Team
) {
215 createTeamDetailSection(rootElement
);
217 } else if (input
instanceof Person
) {
218 createPersonDetailSection(rootElement
);
220 } else if (input
instanceof TeamOrPersonBase
) {
221 createTeamOrPersonBaseDetailSection(rootElement
);
223 } else if (input
instanceof DescriptionBase
) {
224 if(input
instanceof SpecimenDescription
){
225 //TODO: add more sections to DetailsView for SpecimenDescription
226 createSpecimenDescriptionSection(rootElement
);
229 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
231 Boolean isUseDescription
= false;
232 for (Marker marker
: descriptionMarkers
) {
233 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
234 isUseDescription
= true;
237 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
238 createImageGallerySection(rootElement
);
240 } else if (isUseDescription
) {
241 createUseDescriptionSection(rootElement
);
243 createDescriptionSection(rootElement
);
247 } else if (input
instanceof DescriptionElementBase
) {
248 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
250 Boolean isUseDescription
= false;
251 for (Marker marker
: descriptionMarkers
) {
252 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
253 isUseDescription
= true;
257 if (isUseDescription
== true && input
instanceof CategoricalData
) {
258 createUseRecordSection(rootElement
);
260 createDescriptionElementSection(rootElement
);
263 } else if (input
instanceof Media
) {
264 createMediaElementSection(rootElement
);
266 } else if (input
instanceof DerivedUnitFacade
) {
267 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
268 if(((DerivedUnitFacade
) input
).innerFieldUnit()==null){
269 MessagingUtils
.error(DetailsViewer
.class, "FieldUnit of facade is null", null);
272 createFieldUnitSection(rootElement
);
275 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
276 if(((DerivedUnitFacade
) input
).innerDerivedUnit()==null){
277 MessagingUtils
.error(DetailsViewer
.class, "DerivedUnit of facade is null", null);
280 createDerivedUnitBaseElementSection(rootElement
);
283 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
284 //TissueSample should only be created by using it's own class
285 //in future using only one class with different SpecimenOrObservationTypes is desired
286 // createTissueSampleSection(rootElement);
289 createDerivedUnitBaseElementSection(rootElement
);
291 } else if (input
instanceof DnaSample
){
292 DnaSample dnaSample
= (DnaSample
)input
;
293 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
294 createTissueSampleSection(rootElement
);
296 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
297 createDnaSampleSection(rootElement
);
299 } else if (input
instanceof MediaSpecimen
){
300 createMediaSpecimenSection(rootElement
);
302 else if(input
instanceof Sequence
){
303 createSequenceSection(rootElement
);
305 else if(input
instanceof SingleRead
){
306 createSingleReadSection(rootElement
);
308 else if (input
instanceof FeatureNodeContainer
) {
309 createFeatureDistributionSection(rootElement
);
311 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
312 createPolytomousKeyNodeSection(rootElement
);
313 } else if (input
instanceof User
) {
314 createUserSection(rootElement
);
315 } else if (input
instanceof Group
) {
316 createGroupSection(rootElement
);
317 } else if (input
instanceof TaxonRelationship
) {
318 createTaxonRelationshipSection(rootElement
);
319 } else if (input
instanceof TermVocabulary
) {
320 createTermVocabularySection(rootElement
);
321 } else if (input
instanceof DefinedTermBase
) {
322 createDefinedTermSection(rootElement
);
325 createEmptySection(rootElement
);
334 private void createEmptySection(RootElement parent
) {
337 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
339 addPart(emptySection
);
345 private void createGroupSection(RootElement parent
) {
348 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
349 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
350 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
352 addPart(groupDetailSection
);
353 addPart(memberDetailSection
);
354 addPart(grantedAuthorityDetailSection
);
360 * @see org.eclipse.jface.viewers.Viewer#getSelection()
364 public ISelection
getSelection() {
370 public void setSelection(ISelection selection
, boolean reveal
) {
371 this.selection
= selection
;
372 if(this.selection
!=null){
373 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
374 fireSelectionChanged(selectionChangedEvent
);
379 * createTaxonSections(RootElement parent)
383 private void createTaxonSections(RootElement parent
) {
386 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
387 ExpandableComposite
.EXPANDED
| ExpandableComposite
.EXPANDED
);
389 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
390 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
391 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
393 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
394 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
395 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
397 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
398 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
399 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
401 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
402 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
403 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
406 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
407 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
408 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
410 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
411 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
413 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
414 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
416 addPart(protologSection
);
417 addPart(typeDesignationSection
);
418 addPart(nameRelationshipSection
);
422 addPart(parsingMessagesSection
);
423 addPart(taxonBaseDetailSection
);
424 addPart(nonViralNameSection
);
425 addPart(nomenclaturalStatusSection
);
426 addPart(referenceDetailSection
);
434 private void createNameSections(RootElement parent
) {
436 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(getConversationHolder(), parent
, this,
437 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
438 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
440 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
441 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
442 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
444 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
445 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
446 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
448 addPart(nonViralNameSection
);
449 addPart(nomenclaturalStatusSection
);
450 addPart(referenceDetailSection
);
452 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
453 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
454 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
456 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
457 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
459 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
460 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
461 addPart(protologSection
);
462 addPart(typeDesignationSection
);
463 addPart(nameRelationshipSection
);
468 * createReferenceSections
472 private void createReferenceSections(RootElement parent
) {
475 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
476 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
478 addPart(referenceDetailSection
);
482 * createTeamOrPersonBaseDetailSection
486 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
488 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
490 addPart(teamOrPersonBaseDetailSection
);
494 * createTeamDetailSection
498 private void createTeamDetailSection(RootElement parent
) {
500 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
502 addPart(teamDetailSection
);
506 * createPersonDetailSection
510 private void createPersonDetailSection(RootElement parent
) {
512 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
513 addPart(personDetailSection
);
517 * createDescriptionElementSection
521 private void createDescriptionElementSection(RootElement parent
) {
524 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
526 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
528 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
530 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
532 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
534 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
536 addPart(descriptionElementDetailSection
);
537 addPart(descriptionElementSourceSection
);
538 addPart(descriptionElementMediaSection
);
542 * createDescriptionSection
546 private void createDescriptionSection(RootElement parent
) {
548 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
550 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
552 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
554 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
556 DescribedSpecimenSection describedSpecimenSection
= formFactory
.createDescribedSpecimenSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
558 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
560 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
561 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
562 // getConversationHolder(), parent, Section.TWISTIE);
564 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
566 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
568 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
570 addPart(descriptionDetailSection
);
571 addPart(naturalLanguageSection
);
572 addPart(describedSpecimenSection
);
573 // addPart(descriptionSourceSection);
574 addPart(scopeSection
);
578 * createDescriptionSection
582 private void createSpecimenDescriptionSection(RootElement parent
) {
584 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
585 addPart(descriptionDetailSection
);
589 * Creates the use Description section
593 private void createUseDescriptionSection(RootElement parent
) {
595 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
597 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
599 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
601 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
603 addPart(descriptionDetailSection
);
604 addPart(descriptionSourceSection
);
612 private void createImageGallerySection(RootElement parent
) {
614 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
616 addPart(descriptionDetailSection
);
620 * createMediaElementSection
625 private void createMediaElementSection(RootElement parent
) {
628 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
630 addPart(mediaDetailSection
);
634 * createDerivedUnitBaseElementSection
638 private void createDerivedUnitBaseElementSection(RootElement parent
) {
641 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
642 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
643 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
644 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
646 addPart(derivedUnitGeneralDetailSection
);
648 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
650 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
651 addPart(derivedUnitBaseDetailSection
);
653 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
655 OriginalLabelDataSection originalLabelDataSection
= formFactory
.createOriginalLabelDataSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
656 addPart(originalLabelDataSection
);
658 //for editors working with facades
659 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
660 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
661 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
662 addPart(gatheringEventDetailSection
);
664 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
665 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
666 addPart(fieldUnitDetailSection
);
669 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
670 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
671 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
672 addPart(determinationDetailSection
);
674 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_TAXON_ASSOCIATIONS
)){
675 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
676 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
677 addPart(taxonAssociationDetailSection
);
682 private void createFieldUnitSection(RootElement parent
) {
685 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
687 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
689 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
691 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
693 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
695 addPart(fielUnitGeneralDetailSection
);
696 addPart(gatheringEventDetailSection
);
697 addPart(fieldUnitDetailSection
);
699 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
700 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
701 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
702 addPart(determinationDetailSection
);
706 private void createTissueSampleSection(RootElement parent
) {
709 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
711 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
713 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
716 addPart(sampleDesignationDetailSection
);
719 private void createDnaSampleSection(RootElement parent
) {
722 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
724 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
726 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
728 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
730 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
733 addPart(qualitySection
);
734 addPart(sampleDesignationDetailSection
);
737 private void createSequenceSection(RootElement parent
) {
740 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
742 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
744 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
746 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
748 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
752 addPart(referenceSection
);
753 addPart(contigFileSection
);
756 private void createSingleReadSection(RootElement parent
) {
759 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
762 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
764 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
765 addPart(pherogramSection
);
769 private void createMediaSpecimenSection(RootElement parent
) {
772 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
773 addPart(generalSection
);
775 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
777 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
778 addPart(rightsSection
);
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
);