Project

General

Profile

Download (45.4 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.model.taxon.TaxonRelationshipType;
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.model.AbstractUtility;
63
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
64
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
65
import eu.etaxonomy.taxeditor.model.MessagingUtils;
66
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
67
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
68
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
69
import eu.etaxonomy.taxeditor.store.UsageTermCollection;
70
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
71
import eu.etaxonomy.taxeditor.ui.element.RootElement;
72
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
73
import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
74
import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
75
import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
76
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
77
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
78
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
79
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
80
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
81
import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
82
import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;
83
import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
84
import eu.etaxonomy.taxeditor.ui.section.feature.CharacterDetailSection;
85
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
86
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
87
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
88
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
89
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
90
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
91
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
92
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
93
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
94
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
95
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
96
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
97
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
98
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
99
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
100
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
101
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
102
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
103
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
104
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
105
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
106
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSamplePreparationPreservationSection;
107
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
108
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
109
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
110
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
111
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadGeneralDetailSection;
112
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadPherogramCollectionDetailSection;
113
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
114
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
115
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
116
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
117
import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
118
import eu.etaxonomy.taxeditor.ui.section.supplemental.identifier.DerivedUnitFacadeIdentifierSection;
119
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
120
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
121
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
122
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
123
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
124
import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
125
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
126
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
127
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
128

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

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

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

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

    
153
	public void setInput(Object input, Object activePart) {
154
        if (activePart instanceof IDistributionEditor){
155
            detailsEnabled = false;
156
        }else{
157
            detailsEnabled = true;
158
        }
159
        setInput(input);
160
        
161
    }
162
    // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
163
    // since we are getting implementations of DerivedUnitBase from the bulk
164
    // editor
165
    // and not derived unit facade objects,
166

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

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

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

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

    
219
        Object input = getInput();
220

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
361
//            createDescriptionElementSection(rootElement);
362

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

    
368
    }
369

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

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

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

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

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

    
392
        this.selection = selection;
393

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

    
399
    }
400

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

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

    
417
                addPart(taxonBaseDetailSection);
418
            }
419
        }
420
        NonViralNameDetailSection nonViralNameSection = formFactory
421
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
422
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
423
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
424
        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))){
425
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
426
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
427
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
428
            addPart(referenceDetailSection);
429

    
430
        }
431
        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))){
432
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
433
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
434
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
435
            addPart(nomenclaturalStatusSection);
436
        }
437

    
438
        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))){
439
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
440
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
441
            addPart(protologSection);
442
        }
443

    
444
        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))){
445
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
446
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
447
            addPart(typeDesignationSection);
448
        }
449

    
450
        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))){
451
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
452
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
453
            addPart(nameRelationshipSection);
454
        }
455

    
456

    
457
        addPart(parsingMessagesSection);
458

    
459
        addPart(nonViralNameSection);
460

    
461
    }
462

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

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

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

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

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

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

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

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

    
495
    }
496

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

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

    
503
        addPart(referenceDetailSection);
504
    }
505

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

    
510
        addPart(teamOrPersonBaseDetailSection);
511
    }
512

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

    
517
        addPart(teamDetailSection);
518
    }
519

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

    
526
    private void createDescriptionElementSection(RootElement parent) {
527

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
599
    }
600

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

    
605
        addPart(descriptionDetailSection);
606
    }
607

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

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

    
613
        addPart(mediaDetailSection);
614
    }
615

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

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

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

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

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

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

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

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

    
662
    }
663

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

    
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
        destroySections();
690

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
737

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

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

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

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

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

    
754
    }
755

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

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

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

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

    
767
    }
768

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

    
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
        destroySections();
779

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

    
782
        addPart(featureDistributionSection);
783
    }
784

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

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

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

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

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

    
797
    }
798

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

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

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

    
806
        addPart(descriptionUseRecordSection);
807

    
808

    
809
    }
810

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

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

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

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

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

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

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

    
829
        addPart(taxonRelationshipDetailSection);
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)