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
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
52 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
53 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
54 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
55 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
56 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
57 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
58 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
59 import eu
.etaxonomy
.taxeditor
.store
.UsageTermCollection
;
60 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
61 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
62 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
63 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
64 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
65 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
66 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.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
.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
.DerivedUnitBaseDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
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
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmDataViewer
;
117 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
121 * The DetailsViewer handles the content of the details view (
122 * {@link DetailsViewPart}).<br>
123 * Depending on the type of the selected element the section of the details view
127 * @created Feb 12, 2010
130 public class DetailsViewer
extends AbstractCdmDataViewer
{
132 private ISelection selection
;
134 public DetailsViewer(Composite parent
, AbstractCdmViewPart viewPart
) {
135 super(parent
, viewPart
);
138 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
139 // since we are getting implementations of DerivedUnitBase from the bulk
141 // and not derived unit facade objects,
144 public void setInput(Object input
) {
145 if(input
instanceof TreeNode
){
146 input
= ((TreeNode
) input
).getValue();
148 if(input
instanceof GbifResponse
){
149 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
151 if (input
.getClass().equals(DerivedUnit
.class)) {
152 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
154 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
155 PreferencesUtil
.getDerivedUnitConfigurator());
156 } catch (DerivedUnitFacadeNotSupportedException e
) {
157 // 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
160 else if(input
instanceof FieldUnit
){
161 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
163 super.setInput(input
);
167 protected void markViewPartDirty() {
168 if (getInput() instanceof DerivedUnitFacade
) {
169 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
170 if(facade
.innerDerivedUnit()!=null){
171 getViewPart().changed(facade
.innerDerivedUnit());
173 else if(facade
.innerFieldUnit()!=null){
174 getViewPart().changed(facade
.innerFieldUnit());
178 super.markViewPartDirty();
182 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
187 protected void showParts() {
188 // FIXME (CM) : Need to clean out this code.
189 // Too much type checking to decide which detail view to display.
190 // Need to build in a mechanism where navigators / editors are 'aware'
191 // of the corresponding detail viewer.
192 Object input
= getInput();
195 if (input
instanceof TaxonBase
) {
196 if(((TaxonBase
) input
).getName()==null){
197 createEmptySection(rootElement
);
200 createTaxonSections(rootElement
);
203 } else if (input
instanceof NonViralName
) {
204 createNameSections(rootElement
);
206 } else if (input
instanceof Reference
) {
207 createReferenceSections(rootElement
);
209 } else if (input
instanceof Team
) {
210 createTeamDetailSection(rootElement
);
212 } else if (input
instanceof Person
) {
213 createPersonDetailSection(rootElement
);
215 } else if (input
instanceof TeamOrPersonBase
) {
216 createTeamOrPersonBaseDetailSection(rootElement
);
218 } else if (input
instanceof DescriptionBase
) {
219 if(input
instanceof SpecimenDescription
){
220 //TODO: add more sections to DetailsView for SpecimenDescription
221 createSpecimenDescriptionSection(rootElement
);
224 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
226 Boolean isUseDescription
= false;
227 for (Marker marker
: descriptionMarkers
) {
228 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
229 isUseDescription
= true;
232 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
233 createImageGallerySection(rootElement
);
235 } else if (isUseDescription
) {
236 createUseDescriptionSection(rootElement
);
238 createDescriptionSection(rootElement
);
242 } else if (input
instanceof DescriptionElementBase
) {
243 Set
<Marker
> descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
245 Boolean isUseDescription
= false;
246 for (Marker marker
: descriptionMarkers
) {
247 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
248 isUseDescription
= true;
252 if (isUseDescription
== true && input
instanceof CategoricalData
) {
253 createUseRecordSection(rootElement
);
255 createDescriptionElementSection(rootElement
);
258 } else if (input
instanceof Media
) {
259 createMediaElementSection(rootElement
);
261 } else if (input
instanceof DerivedUnitFacade
) {
262 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
263 if(((DerivedUnitFacade
) input
).innerFieldUnit()==null){
264 MessagingUtils
.error(DetailsViewer
.class, "FieldUnit of facade is null", null);
267 createFieldUnitSection(rootElement
);
270 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
271 if(((DerivedUnitFacade
) input
).innerDerivedUnit()==null){
272 MessagingUtils
.error(DetailsViewer
.class, "DerivedUnit of facade is null", null);
275 createDerivedUnitBaseElementSection(rootElement
);
278 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
279 //TissueSample should only be created by using it's own class
280 //in future using only one class with different SpecimenOrObservationTypes is desired
281 // createTissueSampleSection(rootElement);
284 createDerivedUnitBaseElementSection(rootElement
);
286 } else if (input
instanceof DnaSample
){
287 DnaSample dnaSample
= (DnaSample
)input
;
288 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
289 createTissueSampleSection(rootElement
);
291 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
292 createDnaSampleSection(rootElement
);
294 } else if (input
instanceof MediaSpecimen
){
295 createMediaSpecimenSection(rootElement
);
297 else if(input
instanceof Sequence
){
298 createSequenceSection(rootElement
);
300 else if(input
instanceof SingleRead
){
301 createSingleReadSection(rootElement
);
303 else if (input
instanceof FeatureNodeContainer
) {
304 createFeatureDistributionSection(rootElement
);
306 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
307 createPolytomousKeyNodeSection(rootElement
);
308 } else if (input
instanceof User
) {
309 createUserSection(rootElement
);
310 } else if (input
instanceof Group
) {
311 createGroupSection(rootElement
);
312 } else if (input
instanceof TaxonRelationship
) {
313 createTaxonRelationshipSection(rootElement
);
314 } else if (input
instanceof TermVocabulary
) {
315 createTermVocabularySection(rootElement
);
316 } else if (input
instanceof DefinedTermBase
) {
317 createDefinedTermSection(rootElement
);
320 createEmptySection(rootElement
);
326 private void createEmptySection(RootElement parent
) {
329 EmptySection emptySection
= formFactory
.createEmptySection(formFactory
, parent
, SWT
.NONE
);
331 addPart(emptySection
);
334 private void createGroupSection(RootElement parent
) {
337 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
338 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
339 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
341 addPart(groupDetailSection
);
342 addPart(memberDetailSection
);
343 addPart(grantedAuthorityDetailSection
);
348 public ISelection
getSelection() {
354 public void setSelection(ISelection selection
, boolean reveal
) {
355 this.selection
= selection
;
356 if(this.selection
!=null){
357 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
358 fireSelectionChanged(selectionChangedEvent
);
362 private void createTaxonSections(RootElement parent
) {
365 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
366 ExpandableComposite
.EXPANDED
| ExpandableComposite
.EXPANDED
);
367 if (!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_SIMPLE_NAME_DETAILS_SECTION
)){
368 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
369 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
370 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
372 addPart(taxonBaseDetailSection
);
374 NonViralNameDetailSection nonViralNameSection
= formFactory
375 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
376 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
377 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
378 if (!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_SIMPLE_NAME_DETAILS_SECTION
)){
379 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
380 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
381 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
383 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
384 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
385 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
387 addPart(nomenclaturalStatusSection
);
388 addPart(referenceDetailSection
);
391 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
) && !PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_SIMPLE_NAME_DETAILS_SECTION
)){
392 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
393 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
395 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
396 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
398 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
399 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
401 addPart(protologSection
);
402 addPart(typeDesignationSection
);
403 addPart(nameRelationshipSection
);
406 addPart(parsingMessagesSection
);
408 addPart(nonViralNameSection
);
412 private void createNameSections(RootElement parent
) {
414 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(
415 getConversationHolder(), parent
, this, false, ExpandableComposite
.TWISTIE
416 | ExpandableComposite
.EXPANDED
);
417 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
419 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
420 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
421 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
423 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
424 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
425 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
427 addPart(nonViralNameSection
);
428 addPart(nomenclaturalStatusSection
);
429 addPart(referenceDetailSection
);
431 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.IS_RL
)){
432 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
433 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
435 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
436 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
438 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
439 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
440 addPart(protologSection
);
441 addPart(typeDesignationSection
);
442 addPart(nameRelationshipSection
);
446 private void createReferenceSections(RootElement parent
) {
449 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
450 ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
452 addPart(referenceDetailSection
);
455 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
457 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
459 addPart(teamOrPersonBaseDetailSection
);
462 private void createTeamDetailSection(RootElement parent
) {
464 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
466 addPart(teamDetailSection
);
469 private void createPersonDetailSection(RootElement parent
) {
471 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
472 addPart(personDetailSection
);
475 private void createDescriptionElementSection(RootElement parent
) {
478 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
480 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
482 DescriptionElementSourceSection descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
484 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
486 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
488 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
490 addPart(descriptionElementDetailSection
);
491 addPart(descriptionElementSourceSection
);
492 addPart(descriptionElementMediaSection
);
495 private void createDescriptionSection(RootElement parent
) {
497 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
499 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
501 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
503 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
505 // DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
507 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
509 // DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
510 // .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
511 // getConversationHolder(), parent, Section.TWISTIE);
513 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
515 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
517 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
519 addPart(descriptionDetailSection
);
520 addPart(naturalLanguageSection
);
521 // addPart(describedSpecimenSection);
522 // addPart(descriptionSourceSection);
523 addPart(scopeSection
);
526 private void createSpecimenDescriptionSection(RootElement parent
) {
528 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
529 addPart(descriptionDetailSection
);
532 private void createUseDescriptionSection(RootElement parent
) {
534 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
536 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
538 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
540 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
542 addPart(descriptionDetailSection
);
543 addPart(descriptionSourceSection
);
547 private void createImageGallerySection(RootElement parent
) {
549 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
551 addPart(descriptionDetailSection
);
554 private void createMediaElementSection(RootElement parent
) {
557 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
559 addPart(mediaDetailSection
);
562 private void createDerivedUnitBaseElementSection(RootElement parent
) {
565 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
566 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
567 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
568 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
570 addPart(derivedUnitGeneralDetailSection
);
572 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
574 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
575 addPart(derivedUnitBaseDetailSection
);
577 //for editors working with facades
578 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
579 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
580 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
581 addPart(gatheringEventDetailSection
);
583 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
584 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
585 addPart(fieldUnitDetailSection
);
589 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_TAXON_ASSOCIATIONS
)){
590 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
591 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
592 addPart(taxonAssociationDetailSection
);
594 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
595 DerivedUnitFacadeIdentifierSection identifierDetailSection
= formFactory
.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
596 addPart(identifierDetailSection
);
598 if(!PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
599 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
600 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
601 addPart(determinationDetailSection
);
604 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
605 DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection
= formFactory
.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
606 addPart(derivedUnitTypeDesignationSection
);
610 private void createFieldUnitSection(RootElement parent
) {
613 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
615 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
617 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
619 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
621 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
623 addPart(fielUnitGeneralDetailSection
);
624 addPart(gatheringEventDetailSection
);
625 addPart(fieldUnitDetailSection
);
627 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
628 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
629 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
630 addPart(determinationDetailSection
);
634 private void createTissueSampleSection(RootElement parent
) {
637 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
639 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
641 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
644 addPart(sampleDesignationDetailSection
);
647 private void createDnaSampleSection(RootElement parent
) {
650 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
652 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
654 DnaSamplePreparationPreservationSection preparationPreservationSection
= formFactory
.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
656 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
658 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
660 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
662 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
665 addPart(preparationPreservationSection
);
666 addPart(qualitySection
);
667 addPart(sampleDesignationDetailSection
);
670 private void createSequenceSection(RootElement parent
) {
673 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
675 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
677 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
679 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
681 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
685 addPart(referenceSection
);
686 addPart(contigFileSection
);
689 private void createSingleReadSection(RootElement parent
) {
692 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
695 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
697 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
698 addPart(pherogramSection
);
702 private void createMediaSpecimenSection(RootElement parent
) {
705 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
706 addPart(generalSection
);
708 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
710 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
);
711 addPart(rightsSection
);
715 private void createFeatureDistributionSection(RootElement parent
) {
718 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
720 addPart(featureDistributionSection
);
723 private void createPolytomousKeyNodeSection(RootElement parent
) {
726 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
);
728 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
730 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
732 addPart(polytomousKeyDetailSection
);
733 addPart(polytomousKeyNodeDetailSection
);
737 private void createUseRecordSection(RootElement parent
) {
740 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
742 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
744 addPart(descriptionUseRecordSection
);
749 private void createUserSection(RootElement parent
) {
752 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
754 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
756 addPart(userDetailSection
);
757 addPart(groupByUserDetailSection
);
760 private void createTaxonRelationshipSection(RootElement parent
) {
763 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
765 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
766 addPart(taxonRelationshipDetailSection
);
767 addPart(referencedEntityBaseDetailSection
);
770 private void createTermVocabularySection(RootElement parent
) {
773 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
774 addPart(termVocabularyDetailSection
);
777 private void createDefinedTermSection(RootElement parent
) {
780 AbstractFormSection
<?
> definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, ExpandableComposite
.TWISTIE
| ExpandableComposite
.EXPANDED
);
781 addPart(definedTermDetailSection
);
785 public void update(CdmDataChangeMap arg0
) {