Project

General

Profile

Download (46.1 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.FeatureTree;
45
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
46
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
47
import eu.etaxonomy.cdm.model.media.Media;
48
import eu.etaxonomy.cdm.model.molecular.DnaSample;
49
import eu.etaxonomy.cdm.model.molecular.Sequence;
50
import eu.etaxonomy.cdm.model.molecular.SingleRead;
51
import eu.etaxonomy.cdm.model.name.TaxonName;
52
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
53
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
54
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
55
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
56
import eu.etaxonomy.cdm.model.reference.Reference;
57
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
58
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
59
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
60
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
61
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
62
import eu.etaxonomy.taxeditor.l10n.Messages;
63
import eu.etaxonomy.taxeditor.model.AbstractUtility;
64
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
65
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
66
import eu.etaxonomy.taxeditor.model.MessagingUtils;
67
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
68
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
69
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
70
import eu.etaxonomy.taxeditor.store.UsageTermCollection;
71
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
72
import eu.etaxonomy.taxeditor.ui.element.RootElement;
73
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
74
import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
75
import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
76
import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
77
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
78
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
79
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
80
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
81
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
82
import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
83
import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;
84
import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
85
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailSection;
86
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
87
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureNodeDetailSection;
88
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSection;
89
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
90
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
91
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
92
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
93
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
94
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
95
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
96
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
97
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
98
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
99
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
100
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
101
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
102
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
103
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
104
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
105
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
106
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
107
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
108
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
109
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSamplePreparationPreservationSection;
110
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
111
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
112
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
113
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
114
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadGeneralDetailSection;
115
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadPherogramCollectionDetailSection;
116
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
117
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
118
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
119
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
120
import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
121
import eu.etaxonomy.taxeditor.ui.section.supplemental.identifier.DerivedUnitFacadeIdentifierSection;
122
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
123
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
124
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
125
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
126
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
127
import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
128
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
129
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
130

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

    
144
    private ISelection selection;
145
    private boolean detailsEnabled = true;
146

    
147
    public boolean isDetailsEnabled() {
148
		return detailsEnabled;
149
	}
150

    
151
	public void setDetailsEnabled(boolean detailsEnabled) {
152
		this.detailsEnabled = detailsEnabled;
153
	}
154

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

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

    
169
    @Override
170
    public void setInput(Object input) {
171

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

    
197
    @Override
198
    protected void markViewPartDirty() {
199
        if (getInput() instanceof DerivedUnitFacade) {
200
            if(part instanceof IDerivedUnitFacadePart){
201
                part.changed(getInput());
202
            }
203
            else{
204
                DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
205
                if(facade.innerDerivedUnit()!=null){
206
                    part.changed(facade.innerDerivedUnit());
207
                }
208
                else if(facade.innerFieldUnit()!=null){
209
                    part.changed(facade.innerFieldUnit());
210
                }
211
            }
212
        }
213
        else{
214
            super.markViewPartDirty();
215
        }
216
    }
217

    
218
    /** {@inheritDoc} */
219
    @Override
220
    protected void showParts() {
221
        // FIXME (CM) : Need to clean out this code.
222
        // Too much type checking to decide which detail view to display.
223
        // Need to build in a mechanism where navigators / editors are 'aware'
224
        // of the corresponding detail viewer.
225

    
226
        Object input = getInput();
227

    
228
        destroySections();
229
        if (input instanceof TaxonBase) {
230
            if(((TaxonBase) input).getName()==null){
231
                createEmptySection(Messages.DetailsViewerE4_TAXON_HAS_NO_NAME, rootElement);
232
            }
233
            else{
234
                createTaxonSections(rootElement);
235
            }
236

    
237
        } else if (input instanceof TaxonName) {
238
            createNameSections(rootElement);
239

    
240
        } else if (input instanceof Reference) {
241
            createReferenceSections(rootElement);
242

    
243
        } else if (input instanceof Team) {
244
            createTeamDetailSection(rootElement);
245

    
246
        } else if (input instanceof Person) {
247
            createPersonDetailSection(rootElement);
248

    
249
        } else if (input instanceof TeamOrPersonBase) {
250
            createTeamOrPersonBaseDetailSection(rootElement);
251

    
252
        } else if (input instanceof DescriptionBase) {
253
            if(input instanceof SpecimenDescription){
254
                //TODO: add more sections to DetailsView for SpecimenDescription
255
                createSpecimenDescriptionSection(rootElement);
256
            }
257
            else{
258
                Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
259

    
260
                Boolean isUseDescription = false;
261
                for (Marker marker : descriptionMarkers) {
262
                    if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
263
                        isUseDescription = true;
264
                    }
265
                }
266
                if (((DescriptionBase<?>) input).isImageGallery()) {
267
                    createImageGallerySection(rootElement);
268

    
269
                } else if (isUseDescription) {
270
                    createUseDescriptionSection(rootElement);
271
                } else {
272
                    createTaxonDescriptionSection(rootElement);
273

    
274
                }
275
            }
276
        } else if (input instanceof DescriptionElementBase){
277
            Set<Marker> descriptionMarkers = new HashSet<>();
278
            if(((DescriptionElementBase) input).getInDescription()!=null) {
279
                descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
280
            }
281

    
282
            Boolean isUseDescription = false;
283
            for (Marker marker : descriptionMarkers) {
284
                if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
285
                    isUseDescription = true;
286
                }
287
            }
288

    
289
            if (isUseDescription == true && input instanceof CategoricalData) {
290
                createUseRecordSection(rootElement);
291
            } else {
292
                createDescriptionElementSection(rootElement);
293
            }
294

    
295
        } else if (input instanceof Media) {
296
            createMediaElementSection(rootElement);
297

    
298
        }
299
        //FIXME hack to show more informative message to the user when
300
        //DerivedUnit has more than one FieldUnit #4363
301
        else if (input.getClass().equals(DerivedUnit.class)) {
302
            DerivedUnit derivedUnit = (DerivedUnit)input;
303
            try {
304
                input = DerivedUnitFacade.NewInstance(derivedUnit,
305
                        PreferencesUtil.getDerivedUnitConfigurator());
306
            } catch (DerivedUnitFacadeNotSupportedException e) {
307
                createEmptySection(e.getMessage(), rootElement);
308
            }
309
        }
310
        else if (input instanceof DerivedUnitFacade) {
311
            if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){
312
                if(((DerivedUnitFacade) input).innerFieldUnit()==null){
313
                    MessagingUtils.error(DetailsViewerE4.class, "FieldUnit of facade is null", null); //$NON-NLS-1$
314
                }
315
                else{
316
                    createFieldUnitSection(rootElement);
317
                }
318
            }
319
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.PreservedSpecimen){
320
                if(((DerivedUnitFacade) input).innerDerivedUnit()==null){
321
                    MessagingUtils.error(DetailsViewerE4.class, "DerivedUnit of facade is null", null); //$NON-NLS-1$
322
                }
323
                else{
324
                    createDerivedUnitBaseElementSection(rootElement);
325
                }
326
            }
327
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
328
                //TissueSample should only be created by using it's own class
329
                //in future using only one class with different SpecimenOrObservationTypes is desired
330
                createTissueSampleSection(rootElement);
331
            }
332
            else{
333
                createDerivedUnitBaseElementSection(rootElement);
334
            }
335
        } else if (input instanceof DnaSample){
336
            DnaSample dnaSample = (DnaSample)input;
337
            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
338
                createTissueSampleSection(rootElement);
339
            }
340
            else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
341
                createDnaSampleSection(rootElement);
342
            }
343
        } else if (input instanceof MediaSpecimen){
344
            createMediaSpecimenSection(rootElement);
345
        }
346
        else if(input instanceof Sequence){
347
            createSequenceSection(rootElement);
348
        }
349
        else if(input instanceof SingleRead){
350
            createSingleReadSection(rootElement);
351
        }
352
        else if (input instanceof FeatureNodeContainer) {
353
            createFeatureDistributionSection(rootElement);
354

    
355
        } else if (input instanceof FeatureNode) {
356
            createFeatureNodeSection(rootElement);
357

    
358
        } else if (input instanceof FeatureTree) {
359
            createFeatureTreeSection(rootElement);
360

    
361
        } else if (input instanceof Character) {
362
            createCharacterSection(rootElement);
363

    
364
        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
365
            createPolytomousKeyNodeSection(rootElement);
366
        } else if (input instanceof User) {
367
            createUserSection(rootElement);
368
        } else if (input instanceof Group) {
369
            createGroupSection(rootElement);
370
        } else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType()!=null
371
                && (((TaxonRelationship)input).getType().isAnyMisappliedName() || ((TaxonRelationship)input).getType().isAnySynonym() || ((TaxonRelationship)input).getType().isMisappliedNameOrInvalidDesignation())){
372
            createMisappliedNameSection(rootElement);
373
        }else if (input instanceof TaxonRelationship ) {
374
            createTaxonRelationshipSection(rootElement);
375
        } else if (input instanceof TermVocabulary) {
376
            createTermVocabularySection(rootElement);
377
        } else if (input instanceof DefinedTermBase) {
378
            createDefinedTermSection(rootElement);
379

    
380
        } else if (input instanceof SelectionChangedEvent ) {
381
            IStructuredSelection sel =(IStructuredSelection) ((SelectionChangedEvent)input).getSelection();
382
            if (sel.getFirstElement()instanceof Distribution){
383
                createDescriptionElementSection(rootElement);
384
            }
385

    
386
//            createDescriptionElementSection(rootElement);
387

    
388
        }else {
389
            createEmptySection(null, rootElement);
390
        }
391
        layout();
392

    
393
    }
394

    
395
    private void createGroupSection(RootElement parent) {
396
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
397
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
398
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
399

    
400
        addPart(groupDetailSection);
401
        addPart(memberDetailSection);
402
        addPart(grantedAuthorityDetailSection);
403
    }
404

    
405
    /** {@inheritDoc} */
406
    @Override
407
    public ISelection getSelection() {
408
        return selection;
409
    }
410

    
411
    /** {@inheritDoc} */
412
    @Override
413
    public void setSelection(ISelection selection, boolean reveal) {
414

    
415
        this.selection = selection;
416

    
417
        if(this.selection!=null){
418
            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
419
            fireSelectionChanged(selectionChangedEvent);
420
        }
421

    
422
    }
423

    
424
    private void createTaxonSections(RootElement parent) {
425
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
426
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
427
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
428
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
429
                    ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
430
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
431
            addPart(taxonBaseDetailSection);
432
        }else{
433
            if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
434
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
435
                        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
436
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
437

    
438
                addPart(taxonBaseDetailSection);
439
            }
440
        }
441
        NonViralNameDetailSection nonViralNameSection = formFactory
442
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
443
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
444
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
445
        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))){
446
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
447
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
448
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
449
            addPart(referenceDetailSection);
450

    
451
        }
452
        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))){
453
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
454
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
455
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
456
            addPart(nomenclaturalStatusSection);
457
        }
458

    
459
        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))){
460
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
461
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
462
            addPart(protologSection);
463
        }
464

    
465
        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))){
466
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
467
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
468
            addPart(typeDesignationSection);
469
        }
470

    
471
        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))){
472
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
473
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
474
            addPart(nameRelationshipSection);
475
        }
476

    
477

    
478
        addPart(parsingMessagesSection);
479

    
480
        addPart(nonViralNameSection);
481

    
482
    }
483

    
484
    private void createNameSections(RootElement parent) {
485
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
486
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
487
                | ExpandableComposite.EXPANDED);
488

    
489
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
490

    
491
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
492
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
493
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
494

    
495
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
496
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
497
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
498

    
499
        addPart(nonViralNameSection);
500
        addPart(nomenclaturalStatusSection);
501
        addPart(referenceDetailSection);
502

    
503
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
504
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
505

    
506
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
507
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
508

    
509
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
510
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
511
        addPart(protologSection);
512
        addPart(typeDesignationSection);
513
        addPart(nameRelationshipSection);
514

    
515
    }
516

    
517
    private void createReferenceSections(RootElement parent) {
518
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
519
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
520

    
521
        addPart(referenceDetailSection);
522
    }
523

    
524
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
525
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
526

    
527
        addPart(teamOrPersonBaseDetailSection);
528
    }
529

    
530
    private void createTeamDetailSection(RootElement parent) {
531
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
532

    
533
        addPart(teamDetailSection);
534
    }
535

    
536
    private void createPersonDetailSection(RootElement parent) {
537
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
538
        addPart(personDetailSection);
539
    }
540

    
541
    private void createDescriptionElementSection(RootElement parent) {
542
        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
543
        descriptionElementDetailSection.setEnabled(this.detailsEnabled);
544

    
545
        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
546

    
547
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
548

    
549
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
550

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

    
553
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
554

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

    
557
        addPart(descriptionElementDetailSection);
558
        addPart(descriptionElementSourceSection);
559
        addPart(descriptionElementMediaSection);
560
    }
561

    
562
    private void createDescriptionSection(RootElement parent, boolean isTaxonDescription) {
563
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
564
        addPart(descriptionDetailSection);
565

    
566
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
567

    
568
        if(isTaxonDescription) {
569
            NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(
570
                    getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
571
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
572
            addPart(naturalLanguageSection);
573
        }
574
        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(
575
                getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
576
        addPart(descriptionSourceSection);
577

    
578
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
579

    
580
        if(isTaxonDescription) {
581
            ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
582
            addPart(scopeSection);
583
        }
584
    }
585

    
586
    private void createTaxonDescriptionSection(RootElement parent) {
587
        createDescriptionSection(parent, true);
588
    }
589

    
590
    private void createSpecimenDescriptionSection(RootElement parent) {
591
        createDescriptionSection(parent, false);
592
    }
593

    
594
    private void createUseDescriptionSection(RootElement parent) {
595
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
596

    
597
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
598

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

    
601
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
602

    
603
        addPart(descriptionDetailSection);
604
        addPart(descriptionSourceSection);
605

    
606
    }
607

    
608
    private void createImageGallerySection(RootElement parent) {
609
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
610

    
611
        addPart(descriptionDetailSection);
612
    }
613

    
614
    private void createMediaElementSection(RootElement parent) {
615
        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
616

    
617
        addPart(mediaDetailSection);
618
    }
619

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

    
628
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
629

    
630
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
631
        addPart(derivedUnitBaseDetailSection);
632

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

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

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

    
660
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
661
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
662
        addPart(derivedUnitTypeDesignationSection);
663

    
664
    }
665

    
666
    private void createFieldUnitSection(RootElement parent) {
667
        FieldUnitGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
668

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

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

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

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

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

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

    
688
    private void createTissueSampleSection(RootElement parent) {
689
        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
690

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

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

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

    
699
    private void createDnaSampleSection(RootElement parent) {
700
        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
701

    
702
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
703

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

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

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

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

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

    
714
        addPart(section);
715
        addPart(preparationPreservationSection);
716
        addPart(qualitySection);
717
        addPart(sampleDesignationDetailSection);
718
    }
719

    
720
    private void createSequenceSection(RootElement parent) {
721
        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
722

    
723
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
724

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

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

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

    
731

    
732
        addPart(section);
733
        addPart(referenceSection);
734
        addPart(contigFileSection);
735
    }
736

    
737
    private void createSingleReadSection(RootElement parent) {
738
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
739
        addPart(section);
740

    
741
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
742

    
743
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
744
        addPart(pherogramSection);
745

    
746
    }
747

    
748
    private void createMediaSpecimenSection(RootElement parent) {
749
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
750
        addPart(generalSection);
751

    
752
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
753

    
754
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
755
        addPart(rightsSection);
756

    
757
    }
758

    
759
    private void createFeatureTreeSection(RootElement parent) {
760
        FeatureTreeDetailSection section = formFactory.createFeatureTreeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
761

    
762
        addPart(section);
763
    }
764

    
765
    private void createFeatureNodeSection(RootElement parent) {
766
        FeatureNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
767

    
768
        addPart(featureDistributionSection);
769
    }
770

    
771
    private void createFeatureDistributionSection(RootElement parent) {
772
        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
773

    
774
        addPart(featureDistributionSection);
775
    }
776

    
777
    private void createCharacterSection(RootElement parent) {
778
        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
779

    
780
        addPart(featureDistributionSection);
781
    }
782

    
783
    private void createPolytomousKeyNodeSection(RootElement parent) {
784
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
785

    
786
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
787

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

    
790
        addPart(polytomousKeyDetailSection);
791
        addPart(polytomousKeyNodeDetailSection);
792

    
793
    }
794

    
795
    private void createUseRecordSection(RootElement parent) {
796
        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
797

    
798
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
799

    
800
        addPart(descriptionUseRecordSection);
801

    
802

    
803
    }
804

    
805
    private void createUserSection(RootElement parent) {
806
        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
807

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

    
810
        addPart(userDetailSection);
811
        addPart(groupByUserDetailSection);
812
    }
813

    
814
    private void createMisappliedNameSection(RootElement parent) {
815
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this,
816
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
817
        addPart(taxonRelationshipDetailSection);
818

    
819
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
820

    
821

    
822
        NonViralNameDetailSection nonViralNameSection = formFactory
823
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
824
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
825
        addPart(nonViralNameSection);
826

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

    
829
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
830
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
831
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
832
        addPart(referenceDetailSection);
833

    
834

    
835
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
836
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
837
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
838
        addPart(nomenclaturalStatusSection);
839

    
840
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
841
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
842
		addPart(protologSection);
843

    
844
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
845
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
846
		addPart(typeDesignationSection);
847

    
848
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
849
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
850
		addPart(nameRelationshipSection);
851

    
852
    }
853

    
854
    private void createTaxonRelationshipSection(RootElement parent) {
855
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
856

    
857
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
858
        addPart(taxonRelationshipDetailSection);
859
        addPart(referencedEntityBaseDetailSection);
860
    }
861
    private void createTermVocabularySection(RootElement parent) {
862
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
863
        addPart(termVocabularyDetailSection);
864
    }
865

    
866
    private void createDefinedTermSection(RootElement parent) {
867
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
868
        addPart(definedTermDetailSection);
869
    }
870

    
871
    @Override
872
    public void update(CdmDataChangeMap arg0) {
873

    
874
    }
875
    @Inject
876
    @Optional
877
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_TAXON_DETAILS)boolean refresh){
878
        if(refresh){
879
            refresh();
880

    
881
//            setSelection(getSelection(), true);
882
        }
883
    }
884
}
(2-2/2)