Project

General

Profile

Download (46.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.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.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.feature.FeatureNodeDetailSection;
87
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureTreeDetailSection;
88
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
89
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
90
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
91
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
92
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
93
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
94
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
95
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
96
import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
97
import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
98
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
99
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
100
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
101
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
102
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
103
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
104
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
105
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
106
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
107
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
108
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSamplePreparationPreservationSection;
109
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
110
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
111
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
112
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
113
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadGeneralDetailSection;
114
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SingleReadPherogramCollectionDetailSection;
115
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
116
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
117
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
118
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
119
import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
120
import eu.etaxonomy.taxeditor.ui.section.supplemental.identifier.DerivedUnitFacadeIdentifierSection;
121
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
122
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
123
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
124
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
125
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
126
import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
127
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
128
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
129
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
130

    
131
/**
132
 *
133
 * The DetailsViewer handles the content of the details view (
134
 * {@link DetailsViewPart}).<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
            DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
201
            if(facade.innerDerivedUnit()!=null){
202
                part.changed(facade.innerDerivedUnit());
203
            }
204
            else if(facade.innerFieldUnit()!=null){
205
                part.changed(facade.innerFieldUnit());
206
            }
207
        }
208
        else{
209
            super.markViewPartDirty();
210
        }
211
    }
212

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

    
221
        Object input = getInput();
222

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

    
232
        } else if (input instanceof TaxonName) {
233
            createNameSections(rootElement);
234

    
235
        } else if (input instanceof Reference) {
236
            createReferenceSections(rootElement);
237

    
238
        } else if (input instanceof Team) {
239
            createTeamDetailSection(rootElement);
240

    
241
        } else if (input instanceof Person) {
242
            createPersonDetailSection(rootElement);
243

    
244
        } else if (input instanceof TeamOrPersonBase) {
245
            createTeamOrPersonBaseDetailSection(rootElement);
246

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

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

    
264
                } else if (isUseDescription) {
265
                    createUseDescriptionSection(rootElement);
266
                } else {
267
                    createDescriptionSection(rootElement);
268

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

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

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

    
290
        } else if (input instanceof Media) {
291
            createMediaElementSection(rootElement);
292

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

    
338
        } else if (input instanceof FeatureNode) {
339
            createFeatureNodeSection(rootElement);
340

    
341
        } else if (input instanceof FeatureTree) {
342
            createFeatureTreeSection(rootElement);
343

    
344
        } else if (input instanceof Character) {
345
            createCharacterSection(rootElement);
346

    
347
        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
348
            createPolytomousKeyNodeSection(rootElement);
349
        } else if (input instanceof User) {
350
            createUserSection(rootElement);
351
        } else if (input instanceof Group) {
352
            createGroupSection(rootElement);
353
        } else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType()!=null
354
                && ((TaxonRelationship)input).getType().isAnyMisappliedName()) {
355
            createMisappliedNameSection(rootElement);
356
        }else if (input instanceof TaxonRelationship ) {
357
            createTaxonRelationshipSection(rootElement);
358
        } else if (input instanceof TermVocabulary) {
359
            createTermVocabularySection(rootElement);
360
        } else if (input instanceof DefinedTermBase) {
361
            createDefinedTermSection(rootElement);
362

    
363
        } else if (input instanceof SelectionChangedEvent ) {
364
            IStructuredSelection sel =(IStructuredSelection) ((SelectionChangedEvent)input).getSelection();
365
            if (sel.getFirstElement()instanceof Distribution){
366
                createDescriptionElementSection(rootElement);
367
            }
368

    
369
//            createDescriptionElementSection(rootElement);
370

    
371
        }else {
372
            createEmptySection(rootElement);
373
        }
374
        layout();
375

    
376
    }
377

    
378
    private void createGroupSection(RootElement parent) {
379
        destroySections();
380

    
381
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
382
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
383
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
384

    
385
        addPart(groupDetailSection);
386
        addPart(memberDetailSection);
387
        addPart(grantedAuthorityDetailSection);
388
    }
389

    
390
    /** {@inheritDoc} */
391
    @Override
392
    public ISelection getSelection() {
393
        return selection;
394
    }
395

    
396
    /** {@inheritDoc} */
397
    @Override
398
    public void setSelection(ISelection selection, boolean reveal) {
399

    
400
        this.selection = selection;
401

    
402
        if(this.selection!=null){
403
            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
404
            fireSelectionChanged(selectionChangedEvent);
405
        }
406

    
407
    }
408

    
409
    private void createTaxonSections(RootElement parent) {
410
        destroySections();
411

    
412
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
413
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
414
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
415
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
416
                    ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
417
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
418
            addPart(taxonBaseDetailSection);
419
        }else{
420
            if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
421
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
422
                        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
423
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
424

    
425
                addPart(taxonBaseDetailSection);
426
            }
427
        }
428
        NonViralNameDetailSection nonViralNameSection = formFactory
429
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
430
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
431
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
432
        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))){
433
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
434
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
435
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
436
            addPart(referenceDetailSection);
437

    
438
        }
439
        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))){
440
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
441
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
442
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
443
            addPart(nomenclaturalStatusSection);
444
        }
445

    
446
        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))){
447
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
448
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
449
            addPart(protologSection);
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_TYPE_DESIGNATION))){
453
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
454
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
455
            addPart(typeDesignationSection);
456
        }
457

    
458
        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))){
459
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
460
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
461
            addPart(nameRelationshipSection);
462
        }
463

    
464

    
465
        addPart(parsingMessagesSection);
466

    
467
        addPart(nonViralNameSection);
468

    
469
    }
470

    
471
    private void createNameSections(RootElement parent) {
472
        destroySections();
473
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
474
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
475
                | ExpandableComposite.EXPANDED);
476

    
477
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
478

    
479
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
480
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
481
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
482

    
483
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
484
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
485
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
486

    
487
        addPart(nonViralNameSection);
488
        addPart(nomenclaturalStatusSection);
489
        addPart(referenceDetailSection);
490

    
491
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
492
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
493

    
494
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
495
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
496

    
497
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
498
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
499
        addPart(protologSection);
500
        addPart(typeDesignationSection);
501
        addPart(nameRelationshipSection);
502

    
503
    }
504

    
505
    private void createReferenceSections(RootElement parent) {
506
        destroySections();
507

    
508
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
509
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
510

    
511
        addPart(referenceDetailSection);
512
    }
513

    
514
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
515
        destroySections();
516
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
517

    
518
        addPart(teamOrPersonBaseDetailSection);
519
    }
520

    
521
    private void createTeamDetailSection(RootElement parent) {
522
        destroySections();
523
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
524

    
525
        addPart(teamDetailSection);
526
    }
527

    
528
    private void createPersonDetailSection(RootElement parent) {
529
        destroySections();
530
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
531
        addPart(personDetailSection);
532
    }
533

    
534
    private void createDescriptionElementSection(RootElement parent) {
535

    
536
        destroySections();
537
        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
538
        descriptionElementDetailSection.setEnabled(this.detailsEnabled);
539

    
540
        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
541

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

    
544
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
545

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

    
548
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
549

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

    
552
        addPart(descriptionElementDetailSection);
553
        addPart(descriptionElementSourceSection);
554
        addPart(descriptionElementMediaSection);
555
    }
556

    
557
    private void createDescriptionSection(RootElement parent) {
558
        destroySections();
559
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
560

    
561
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
562

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

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

    
567
        //        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
568
        //
569
        //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
570

    
571
        //		DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
572
        //				.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
573
        //						getConversationHolder(), parent, Section.TWISTIE);
574
        //
575
        //		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
576

    
577
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
578

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

    
581
        addPart(descriptionDetailSection);
582
        addPart(naturalLanguageSection);
583
        //        addPart(describedSpecimenSection);
584
        //		addPart(descriptionSourceSection);
585
        addPart(scopeSection);
586
    }
587

    
588
    private void createSpecimenDescriptionSection(RootElement parent) {
589
        destroySections();
590
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
591
        addPart(descriptionDetailSection);
592
    }
593

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

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

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

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

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

    
607
    }
608

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

    
613
        addPart(descriptionDetailSection);
614
    }
615

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

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

    
621
        addPart(mediaDetailSection);
622
    }
623

    
624
    private void createDerivedUnitBaseElementSection(RootElement parent) {
625
        destroySections();
626

    
627
        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
628
        //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
629
        if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
630
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
631
        }
632
        addPart(derivedUnitGeneralDetailSection);
633

    
634
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
635

    
636
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
637
        addPart(derivedUnitBaseDetailSection);
638

    
639
        //for editors working with facades
640
        if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
641
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
642
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
643
            addPart(gatheringEventDetailSection);
644

    
645
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
646
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
647
            addPart(fieldUnitDetailSection);
648
        }
649
        else{
650

    
651
            if(PreferencesUtil.isShowTaxonAssociations()){
652
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
653
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
654
                addPart(taxonAssociationDetailSection);
655
            }
656
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
657
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
658
            addPart(identifierDetailSection);
659
        }
660
        if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
661
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
662
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
663
            addPart(determinationDetailSection);
664
        }
665

    
666
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
667
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
668
        addPart(derivedUnitTypeDesignationSection);
669

    
670
    }
671

    
672
    private void createFieldUnitSection(RootElement parent) {
673
        destroySections();
674

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

    
677
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
678

    
679
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
680

    
681
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
682

    
683
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
684

    
685
        addPart(fielUnitGeneralDetailSection);
686
        addPart(gatheringEventDetailSection);
687
        addPart(fieldUnitDetailSection);
688

    
689
        if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
690
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
691
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
692
            addPart(determinationDetailSection);
693
        }
694
    }
695

    
696
    private void createTissueSampleSection(RootElement parent) {
697
        destroySections();
698

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

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

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

    
705
        addPart(section);
706
        addPart(sampleDesignationDetailSection);
707
    }
708

    
709
    private void createDnaSampleSection(RootElement parent) {
710
        destroySections();
711

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

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

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

    
718
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
719

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

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

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

    
726
        addPart(section);
727
        addPart(preparationPreservationSection);
728
        addPart(qualitySection);
729
        addPart(sampleDesignationDetailSection);
730
    }
731

    
732
    private void createSequenceSection(RootElement parent) {
733
        destroySections();
734

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

    
737
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
738

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

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

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

    
745

    
746
        addPart(section);
747
        addPart(referenceSection);
748
        addPart(contigFileSection);
749
    }
750

    
751
    private void createSingleReadSection(RootElement parent) {
752
        destroySections();
753

    
754
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
755
        addPart(section);
756

    
757
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
758

    
759
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
760
        addPart(pherogramSection);
761

    
762
    }
763

    
764
    private void createMediaSpecimenSection(RootElement parent) {
765
        destroySections();
766

    
767
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
768
        addPart(generalSection);
769

    
770
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
771

    
772
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
773
        addPart(rightsSection);
774

    
775
    }
776

    
777
    private void createFeatureTreeSection(RootElement parent) {
778
        destroySections();
779

    
780
        FeatureTreeDetailSection section = formFactory.createFeatureTreeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
781

    
782
        addPart(section);
783
    }
784

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

    
788
        FeatureNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
789

    
790
        addPart(featureDistributionSection);
791
    }
792

    
793
    private void createFeatureDistributionSection(RootElement parent) {
794
        destroySections();
795

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

    
798
        addPart(featureDistributionSection);
799
    }
800

    
801
    private void createCharacterSection(RootElement parent) {
802
        destroySections();
803

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

    
806
        addPart(featureDistributionSection);
807
    }
808

    
809
    private void createPolytomousKeyNodeSection(RootElement parent) {
810
        destroySections();
811

    
812
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
813

    
814
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
815

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

    
818
        addPart(polytomousKeyDetailSection);
819
        addPart(polytomousKeyNodeDetailSection);
820

    
821
    }
822

    
823
    private void createUseRecordSection(RootElement parent) {
824
        destroySections();
825

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

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

    
830
        addPart(descriptionUseRecordSection);
831

    
832

    
833
    }
834

    
835
    private void createUserSection(RootElement parent) {
836
        destroySections();
837

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

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

    
842
        addPart(userDetailSection);
843
        addPart(groupByUserDetailSection);
844
    }
845

    
846
    private void createMisappliedNameSection(RootElement parent) {
847
        destroySections();
848

    
849
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this,
850
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
851
        addPart(taxonRelationshipDetailSection);
852

    
853
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
854

    
855

    
856
        NonViralNameDetailSection nonViralNameSection = formFactory
857
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
858
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
859
        addPart(nonViralNameSection);
860

    
861
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
862

    
863
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
864
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
865
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
866
        addPart(referenceDetailSection);
867

    
868

    
869
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
870
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
871
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
872
        addPart(nomenclaturalStatusSection);
873

    
874
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
875
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
876
		addPart(protologSection);
877

    
878
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
879
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
880
		addPart(typeDesignationSection);
881

    
882
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
883
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
884
		addPart(nameRelationshipSection);
885

    
886
    }
887

    
888
    private void createTaxonRelationshipSection(RootElement parent) {
889
        destroySections();
890

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

    
893
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
894
        addPart(taxonRelationshipDetailSection);
895
        addPart(referencedEntityBaseDetailSection);
896
    }
897
    private void createTermVocabularySection(RootElement parent) {
898
        destroySections();
899

    
900
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
901
        addPart(termVocabularyDetailSection);
902
    }
903

    
904
    private void createDefinedTermSection(RootElement parent) {
905
        destroySections();
906

    
907
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
908
        addPart(definedTermDetailSection);
909
    }
910

    
911
    @Override
912
    public void update(CdmDataChangeMap arg0) {
913

    
914
    }
915
    @Inject
916
    @Optional
917
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_TAXON_DETAILS)boolean refresh){
918
        if(refresh){
919
            refresh();
920

    
921
//            setSelection(getSelection(), true);
922
        }
923
    }
924
}
(2-2/2)