Project

General

Profile

Download (45.3 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2011 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9

    
10
package eu.etaxonomy.taxeditor.view.e4.details;
11

    
12
import java.util.HashSet;
13
import java.util.Set;
14

    
15
import javax.inject.Inject;
16

    
17
import org.eclipse.e4.core.di.annotations.Optional;
18
import org.eclipse.e4.ui.di.UIEventTopic;
19
import org.eclipse.jface.viewers.ISelection;
20
import org.eclipse.jface.viewers.IStructuredSelection;
21
import org.eclipse.jface.viewers.SelectionChangedEvent;
22
import org.eclipse.jface.viewers.TreeNode;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.ui.forms.widgets.ExpandableComposite;
25

    
26
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
27
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
28
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
29
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
30
import eu.etaxonomy.cdm.model.agent.Person;
31
import eu.etaxonomy.cdm.model.agent.Team;
32
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
33
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
34
import eu.etaxonomy.cdm.model.common.Group;
35
import eu.etaxonomy.cdm.model.common.Marker;
36
import eu.etaxonomy.cdm.model.common.TermVocabulary;
37
import eu.etaxonomy.cdm.model.common.User;
38
import eu.etaxonomy.cdm.model.description.CategoricalData;
39
import eu.etaxonomy.cdm.model.description.Character;
40
import eu.etaxonomy.cdm.model.description.DescriptionBase;
41
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
42
import eu.etaxonomy.cdm.model.description.Distribution;
43
import eu.etaxonomy.cdm.model.description.FeatureNode;
44
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
45
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
46
import eu.etaxonomy.cdm.model.media.Media;
47
import eu.etaxonomy.cdm.model.molecular.DnaSample;
48
import eu.etaxonomy.cdm.model.molecular.Sequence;
49
import eu.etaxonomy.cdm.model.molecular.SingleRead;
50
import eu.etaxonomy.cdm.model.name.TaxonName;
51
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
52
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
53
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
54
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
55
import eu.etaxonomy.cdm.model.reference.Reference;
56
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
57
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
58
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
59
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
60
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
61
import eu.etaxonomy.taxeditor.model.AbstractUtility;
62
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
63
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
64
import eu.etaxonomy.taxeditor.model.MessagingUtils;
65
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
66
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
67
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
68
import eu.etaxonomy.taxeditor.store.UsageTermCollection;
69
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
70
import eu.etaxonomy.taxeditor.ui.element.RootElement;
71
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
72
import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
73
import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
74
import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
75
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
76
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
77
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
78
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
79
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
80
import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
81
import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;
82
import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
83
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailSection;
84
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
85
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
86
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
87
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
88
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
89
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
90
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
91
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
92
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
93
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
94
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
95
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
96
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
97
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
98
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
99
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
100
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
101
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
102
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
103
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
104
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
105
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSamplePreparationPreservationSection;
106
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
107
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
108
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
109
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
110
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadGeneralDetailSection;
111
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadPherogramCollectionDetailSection;
112
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
113
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
114
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
115
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
116
import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
117
import eu.etaxonomy.taxeditor.ui.section.supplemental.identifier.DerivedUnitFacadeIdentifierSection;
118
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
119
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
120
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
121
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
122
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
123
import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
124
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
125
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
126
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
127

    
128
/**
129
 *
130
 * The DetailsViewer handles the content of the details view (
131
 * {@link DetailsViewPart}).<br>
132
 * Depending on the type of the selected element the section of the details view
133
 * are created.
134
 *
135
 * @author pplitzner
136
 * @date 18.07.2017
137
 *
138
 */
139
public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
140

    
141
    private ISelection selection;
142
    private boolean detailsEnabled = true;
143

    
144
    public boolean isDetailsEnabled() {
145
		return detailsEnabled;
146
	}
147

    
148
	public void setDetailsEnabled(boolean detailsEnabled) {
149
		this.detailsEnabled = detailsEnabled;
150
	}
151

    
152
	public void setInput(Object input, Object activePart) {
153
        if (activePart instanceof IDistributionEditor){
154
            detailsEnabled = false;
155
        }else{
156
            detailsEnabled = true;
157
        }
158
        setInput(input);
159

    
160
    }
161
    // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
162
    // since we are getting implementations of DerivedUnitBase from the bulk
163
    // editor
164
    // and not derived unit facade objects,
165

    
166
    @Override
167
    public void setInput(Object input) {
168

    
169
        if(input instanceof TreeNode){
170
            input = ((TreeNode) input).getValue();
171
        }
172
        if(input instanceof GbifResponse){
173
            input = ((GbifResponse) input).getDerivedUnitFacade();
174
        }
175
        if(input instanceof FeatureNode
176
                && HibernateProxyHelper.isInstanceOf(((FeatureNode) input).getFeature(), Character.class)){
177
            input = HibernateProxyHelper.deproxy(((FeatureNode) input).getFeature(), Character.class);
178
        }
179
        if (input !=null && input.getClass().equals(DerivedUnit.class)) {
180
            DerivedUnit derivedUnit = (DerivedUnit)input;
181
            try {
182
                input = DerivedUnitFacade.NewInstance(derivedUnit,
183
                        PreferencesUtil.getDerivedUnitConfigurator());
184
            } catch (DerivedUnitFacadeNotSupportedException e) {
185
                //                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
186
            }
187
        }
188
        else if(input instanceof FieldUnit){
189
            input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input);
190
        }
191
        super.setInput(input);
192
    }
193

    
194
    @Override
195
    protected void markViewPartDirty() {
196
        if (getInput() instanceof DerivedUnitFacade) {
197
            DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
198
            if(facade.innerDerivedUnit()!=null){
199
                part.changed(facade.innerDerivedUnit());
200
            }
201
            else if(facade.innerFieldUnit()!=null){
202
                part.changed(facade.innerFieldUnit());
203
            }
204
        }
205
        else{
206
            super.markViewPartDirty();
207
        }
208
    }
209

    
210
    /** {@inheritDoc} */
211
    @Override
212
    protected void showParts() {
213
        // FIXME (CM) : Need to clean out this code.
214
        // Too much type checking to decide which detail view to display.
215
        // Need to build in a mechanism where navigators / editors are 'aware'
216
        // of the corresponding detail viewer.
217

    
218
        Object input = getInput();
219

    
220
        destroySections();
221
        if (input instanceof TaxonBase) {
222
            if(((TaxonBase) input).getName()==null){
223
                createEmptySection(rootElement);
224
            }
225
            else{
226
                createTaxonSections(rootElement);
227
            }
228

    
229
        } else if (input instanceof TaxonName) {
230
            createNameSections(rootElement);
231

    
232
        } else if (input instanceof Reference) {
233
            createReferenceSections(rootElement);
234

    
235
        } else if (input instanceof Team) {
236
            createTeamDetailSection(rootElement);
237

    
238
        } else if (input instanceof Person) {
239
            createPersonDetailSection(rootElement);
240

    
241
        } else if (input instanceof TeamOrPersonBase) {
242
            createTeamOrPersonBaseDetailSection(rootElement);
243

    
244
        } else if (input instanceof DescriptionBase) {
245
            if(input instanceof SpecimenDescription){
246
                //TODO: add more sections to DetailsView for SpecimenDescription
247
                createSpecimenDescriptionSection(rootElement);
248
            }
249
            else{
250
                Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
251

    
252
                Boolean isUseDescription = false;
253
                for (Marker marker : descriptionMarkers) {
254
                    if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
255
                        isUseDescription = true;
256
                    }
257
                }
258
                if (((DescriptionBase<?>) input).isImageGallery()) {
259
                    createImageGallerySection(rootElement);
260

    
261
                } else if (isUseDescription) {
262
                    createUseDescriptionSection(rootElement);
263
                } else {
264
                    createDescriptionSection(rootElement);
265

    
266
                }
267
            }
268
        } else if (input instanceof DescriptionElementBase){
269
            Set<Marker> descriptionMarkers = new HashSet<>();
270
            if(((DescriptionElementBase) input).getInDescription()!=null) {
271
                descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
272
            }
273

    
274
            Boolean isUseDescription = false;
275
            for (Marker marker : descriptionMarkers) {
276
                if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
277
                    isUseDescription = true;
278
                }
279
            }
280

    
281
            if (isUseDescription == true && input instanceof CategoricalData) {
282
                createUseRecordSection(rootElement);
283
            } else {
284
                createDescriptionElementSection(rootElement);
285
            }
286

    
287
        } else if (input instanceof Media) {
288
            createMediaElementSection(rootElement);
289

    
290
        } else if (input instanceof DerivedUnitFacade) {
291
            if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){
292
                if(((DerivedUnitFacade) input).innerFieldUnit()==null){
293
                    MessagingUtils.error(DetailsViewerE4.class, "FieldUnit of facade is null", null);
294
                }
295
                else{
296
                    createFieldUnitSection(rootElement);
297
                }
298
            }
299
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.PreservedSpecimen){
300
                if(((DerivedUnitFacade) input).innerDerivedUnit()==null){
301
                    MessagingUtils.error(DetailsViewerE4.class, "DerivedUnit of facade is null", null);
302
                }
303
                else{
304
                    createDerivedUnitBaseElementSection(rootElement);
305
                }
306
            }
307
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
308
                //TissueSample should only be created by using it's own class
309
                //in future using only one class with different SpecimenOrObservationTypes is desired
310
                createTissueSampleSection(rootElement);
311
            }
312
            else{
313
                createDerivedUnitBaseElementSection(rootElement);
314
            }
315
        } else if (input instanceof DnaSample){
316
            DnaSample dnaSample = (DnaSample)input;
317
            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
318
                createTissueSampleSection(rootElement);
319
            }
320
            else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
321
                createDnaSampleSection(rootElement);
322
            }
323
        } else if (input instanceof MediaSpecimen){
324
            createMediaSpecimenSection(rootElement);
325
        }
326
        else if(input instanceof Sequence){
327
            createSequenceSection(rootElement);
328
        }
329
        else if(input instanceof SingleRead){
330
            createSingleReadSection(rootElement);
331
        }
332
        else if (input instanceof FeatureNodeContainer) {
333
            createFeatureDistributionSection(rootElement);
334

    
335
        }else if (input instanceof Character) {
336
            createCharacterSection(rootElement);
337

    
338
        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
339
            createPolytomousKeyNodeSection(rootElement);
340
        } else if (input instanceof User) {
341
            createUserSection(rootElement);
342
        } else if (input instanceof Group) {
343
            createGroupSection(rootElement);
344
        } else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType()!=null
345
                && ((TaxonRelationship)input).getType().isAnyMisappliedName()) {
346
            createMisappliedNameSection(rootElement);
347
        }else if (input instanceof TaxonRelationship ) {
348
            createTaxonRelationshipSection(rootElement);
349
        } else if (input instanceof TermVocabulary) {
350
            createTermVocabularySection(rootElement);
351
        } else if (input instanceof DefinedTermBase) {
352
            createDefinedTermSection(rootElement);
353

    
354
        } else if (input instanceof SelectionChangedEvent ) {
355
            IStructuredSelection sel =(IStructuredSelection) ((SelectionChangedEvent)input).getSelection();
356
            if (sel.getFirstElement()instanceof Distribution){
357
                createDescriptionElementSection(rootElement);
358
            }
359

    
360
//            createDescriptionElementSection(rootElement);
361

    
362
        }else {
363
            createEmptySection(rootElement);
364
        }
365
        layout();
366

    
367
    }
368

    
369
    private void createGroupSection(RootElement parent) {
370
        destroySections();
371

    
372
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
373
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
374
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
375

    
376
        addPart(groupDetailSection);
377
        addPart(memberDetailSection);
378
        addPart(grantedAuthorityDetailSection);
379
    }
380

    
381
    /** {@inheritDoc} */
382
    @Override
383
    public ISelection getSelection() {
384
        return selection;
385
    }
386

    
387
    /** {@inheritDoc} */
388
    @Override
389
    public void setSelection(ISelection selection, boolean reveal) {
390

    
391
        this.selection = selection;
392

    
393
        if(this.selection!=null){
394
            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
395
            fireSelectionChanged(selectionChangedEvent);
396
        }
397

    
398
    }
399

    
400
    private void createTaxonSections(RootElement parent) {
401
        destroySections();
402

    
403
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
404
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
405
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
406
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
407
                    ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
408
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
409
            addPart(taxonBaseDetailSection);
410
        }else{
411
            if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
412
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
413
                        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
414
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
415

    
416
                addPart(taxonBaseDetailSection);
417
            }
418
        }
419
        NonViralNameDetailSection nonViralNameSection = formFactory
420
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
421
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
422
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
423
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
424
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
425
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
426
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
427
            addPart(referenceDetailSection);
428

    
429
        }
430
        if ( !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS))){
431
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
432
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
433
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
434
            addPart(nomenclaturalStatusSection);
435
        }
436

    
437
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE))){
438
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
439
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
440
            addPart(protologSection);
441
        }
442

    
443
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) &&  PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION))){
444
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
445
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
446
            addPart(typeDesignationSection);
447
        }
448

    
449
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP))){
450
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
451
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
452
            addPart(nameRelationshipSection);
453
        }
454

    
455

    
456
        addPart(parsingMessagesSection);
457

    
458
        addPart(nonViralNameSection);
459

    
460
    }
461

    
462
    private void createNameSections(RootElement parent) {
463
        destroySections();
464
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
465
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
466
                | ExpandableComposite.EXPANDED);
467

    
468
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
469

    
470
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
471
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
472
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
473

    
474
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
475
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
476
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
477

    
478
        addPart(nonViralNameSection);
479
        addPart(nomenclaturalStatusSection);
480
        addPart(referenceDetailSection);
481

    
482
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
483
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
484

    
485
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
486
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
487

    
488
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
489
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
490
        addPart(protologSection);
491
        addPart(typeDesignationSection);
492
        addPart(nameRelationshipSection);
493

    
494
    }
495

    
496
    private void createReferenceSections(RootElement parent) {
497
        destroySections();
498

    
499
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
500
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
501

    
502
        addPart(referenceDetailSection);
503
    }
504

    
505
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
506
        destroySections();
507
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
508

    
509
        addPart(teamOrPersonBaseDetailSection);
510
    }
511

    
512
    private void createTeamDetailSection(RootElement parent) {
513
        destroySections();
514
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
515

    
516
        addPart(teamDetailSection);
517
    }
518

    
519
    private void createPersonDetailSection(RootElement parent) {
520
        destroySections();
521
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
522
        addPart(personDetailSection);
523
    }
524

    
525
    private void createDescriptionElementSection(RootElement parent) {
526

    
527
        destroySections();
528
        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
529
        descriptionElementDetailSection.setEnabled(this.detailsEnabled);
530

    
531
        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
532

    
533
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
534

    
535
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
536

    
537
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
538

    
539
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
540

    
541
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
542

    
543
        addPart(descriptionElementDetailSection);
544
        addPart(descriptionElementSourceSection);
545
        addPart(descriptionElementMediaSection);
546
    }
547

    
548
    private void createDescriptionSection(RootElement parent) {
549
        destroySections();
550
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
551

    
552
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
553

    
554
        NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
555

    
556
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
557

    
558
        //        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
559
        //
560
        //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
561

    
562
        //		DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
563
        //				.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
564
        //						getConversationHolder(), parent, Section.TWISTIE);
565
        //
566
        //		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
567

    
568
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
569

    
570
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
571

    
572
        addPart(descriptionDetailSection);
573
        addPart(naturalLanguageSection);
574
        //        addPart(describedSpecimenSection);
575
        //		addPart(descriptionSourceSection);
576
        addPart(scopeSection);
577
    }
578

    
579
    private void createSpecimenDescriptionSection(RootElement parent) {
580
        destroySections();
581
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
582
        addPart(descriptionDetailSection);
583
    }
584

    
585
    private void createUseDescriptionSection(RootElement parent) {
586
        destroySections();
587
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
588

    
589
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
590

    
591
        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
592

    
593
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
594

    
595
        addPart(descriptionDetailSection);
596
        addPart(descriptionSourceSection);
597

    
598
    }
599

    
600
    private void createImageGallerySection(RootElement parent) {
601
        destroySections();
602
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
603

    
604
        addPart(descriptionDetailSection);
605
    }
606

    
607
    private void createMediaElementSection(RootElement parent) {
608
        destroySections();
609

    
610
        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
611

    
612
        addPart(mediaDetailSection);
613
    }
614

    
615
    private void createDerivedUnitBaseElementSection(RootElement parent) {
616
        destroySections();
617

    
618
        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
619
        //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
620
        if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
621
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
622
        }
623
        addPart(derivedUnitGeneralDetailSection);
624

    
625
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
626

    
627
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
628
        addPart(derivedUnitBaseDetailSection);
629

    
630
        //for editors working with facades
631
        if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
632
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
633
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
634
            addPart(gatheringEventDetailSection);
635

    
636
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
637
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
638
            addPart(fieldUnitDetailSection);
639
        }
640
        else{
641

    
642
            if(PreferencesUtil.isShowTaxonAssociations()){
643
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
644
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
645
                addPart(taxonAssociationDetailSection);
646
            }
647
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
648
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
649
            addPart(identifierDetailSection);
650
        }
651
        if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
652
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
653
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
654
            addPart(determinationDetailSection);
655
        }
656

    
657
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
658
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
659
        addPart(derivedUnitTypeDesignationSection);
660

    
661
    }
662

    
663
    private void createFieldUnitSection(RootElement parent) {
664
        destroySections();
665

    
666
        FieldUnitGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
667

    
668
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
669

    
670
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
671

    
672
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
673

    
674
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
675

    
676
        addPart(fielUnitGeneralDetailSection);
677
        addPart(gatheringEventDetailSection);
678
        addPart(fieldUnitDetailSection);
679

    
680
        if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
681
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
682
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
683
            addPart(determinationDetailSection);
684
        }
685
    }
686

    
687
    private void createTissueSampleSection(RootElement parent) {
688
        destroySections();
689

    
690
        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
691

    
692
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
693

    
694
        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
695

    
696
        addPart(section);
697
        addPart(sampleDesignationDetailSection);
698
    }
699

    
700
    private void createDnaSampleSection(RootElement parent) {
701
        destroySections();
702

    
703
        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
704

    
705
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
706

    
707
        DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
708

    
709
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
710

    
711
        DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
712

    
713
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
714

    
715
        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
716

    
717
        addPart(section);
718
        addPart(preparationPreservationSection);
719
        addPart(qualitySection);
720
        addPart(sampleDesignationDetailSection);
721
    }
722

    
723
    private void createSequenceSection(RootElement parent) {
724
        destroySections();
725

    
726
        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
727

    
728
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
729

    
730
        SequenceReferenceCollectionDetailSection referenceSection = formFactory.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
731

    
732
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
733

    
734
        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
735

    
736

    
737
        addPart(section);
738
        addPart(referenceSection);
739
        addPart(contigFileSection);
740
    }
741

    
742
    private void createSingleReadSection(RootElement parent) {
743
        destroySections();
744

    
745
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
746
        addPart(section);
747

    
748
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
749

    
750
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
751
        addPart(pherogramSection);
752

    
753
    }
754

    
755
    private void createMediaSpecimenSection(RootElement parent) {
756
        destroySections();
757

    
758
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
759
        addPart(generalSection);
760

    
761
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
762

    
763
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
764
        addPart(rightsSection);
765

    
766
    }
767

    
768
    private void createFeatureDistributionSection(RootElement parent) {
769
        destroySections();
770

    
771
        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
772

    
773
        addPart(featureDistributionSection);
774
    }
775

    
776
    private void createCharacterSection(RootElement parent) {
777
        destroySections();
778

    
779
        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
780

    
781
        addPart(featureDistributionSection);
782
    }
783

    
784
    private void createPolytomousKeyNodeSection(RootElement parent) {
785
        destroySections();
786

    
787
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
788

    
789
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
790

    
791
        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
792

    
793
        addPart(polytomousKeyDetailSection);
794
        addPart(polytomousKeyNodeDetailSection);
795

    
796
    }
797

    
798
    private void createUseRecordSection(RootElement parent) {
799
        destroySections();
800

    
801
        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
802

    
803
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
804

    
805
        addPart(descriptionUseRecordSection);
806

    
807

    
808
    }
809

    
810
    private void createUserSection(RootElement parent) {
811
        destroySections();
812

    
813
        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
814

    
815
        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
816

    
817
        addPart(userDetailSection);
818
        addPart(groupByUserDetailSection);
819
    }
820

    
821
    private void createMisappliedNameSection(RootElement parent) {
822
        destroySections();
823

    
824
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this,
825
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
826
        addPart(taxonRelationshipDetailSection);
827

    
828
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
829

    
830

    
831
        NonViralNameDetailSection nonViralNameSection = formFactory
832
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
833
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
834
        addPart(nonViralNameSection);
835

    
836
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
837

    
838
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
839
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
840
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
841
        addPart(referenceDetailSection);
842

    
843

    
844
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
845
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
846
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
847
        addPart(nomenclaturalStatusSection);
848

    
849
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
850
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
851
		addPart(protologSection);
852

    
853
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
854
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
855
		addPart(typeDesignationSection);
856

    
857
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
858
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
859
		addPart(nameRelationshipSection);
860

    
861
    }
862

    
863
    private void createTaxonRelationshipSection(RootElement parent) {
864
        destroySections();
865

    
866
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
867

    
868
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
869
        addPart(taxonRelationshipDetailSection);
870
        addPart(referencedEntityBaseDetailSection);
871
    }
872
    private void createTermVocabularySection(RootElement parent) {
873
        destroySections();
874

    
875
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
876
        addPart(termVocabularyDetailSection);
877
    }
878

    
879
    private void createDefinedTermSection(RootElement parent) {
880
        destroySections();
881

    
882
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
883
        addPart(definedTermDetailSection);
884
    }
885

    
886
    @Override
887
    public void update(CdmDataChangeMap arg0) {
888

    
889
    }
890
    @Inject
891
    @Optional
892
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_TAXON_DETAILS)boolean refresh){
893
        if(refresh){
894
            refresh();
895

    
896
//            setSelection(getSelection(), true);
897
        }
898
    }
899
}
(2-2/2)