Project

General

Profile

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

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

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

    
15
import javax.inject.Inject;
16

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

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

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

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

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

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

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

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

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

    
172
        if(input instanceof TreeNode){
173
            input = ((TreeNode) input).getValue();
174
        }
175
        if(input instanceof GbifResponse){
176
            input = ((GbifResponse) input).getDerivedUnitFacade();
177
        }
178
        if(input instanceof FeatureNode
179
                && HibernateProxyHelper.isInstanceOf(((FeatureNode) input).getFeature(), Character.class)){
180
            input = HibernateProxyHelper.deproxy(((FeatureNode) input).getFeature(), Character.class);
181
        }
182
        if (input !=null && input.getClass().equals(DerivedUnit.class)) {
183
            DerivedUnit derivedUnit = (DerivedUnit)input;
184
            try {
185
                input = DerivedUnitFacade.NewInstance(derivedUnit,
186
                        PreferencesUtil.getDerivedUnitConfigurator());
187
            } catch (DerivedUnitFacadeNotSupportedException e) {
188
                //                MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
189
            }
190
        }
191
        else if(input instanceof FieldUnit){
192
            input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input);
193
        }
194
        super.setInput(input);
195
    }
196

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

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

    
226
        Object input = getInput();
227

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
386
//            createDescriptionElementSection(rootElement);
387

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

    
393
    }
394

    
395
    private void createGroupSection(RootElement parent) {
396
        destroySections();
397

    
398
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
399
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
400
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
401

    
402
        addPart(groupDetailSection);
403
        addPart(memberDetailSection);
404
        addPart(grantedAuthorityDetailSection);
405
    }
406

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

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

    
417
        this.selection = selection;
418

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

    
424
    }
425

    
426
    private void createTaxonSections(RootElement parent) {
427
        destroySections();
428

    
429
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
430
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
431
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
432
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
433
                    ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
434
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
435
            addPart(taxonBaseDetailSection);
436
        }else{
437
            if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
438
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
439
                        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
440
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
441

    
442
                addPart(taxonBaseDetailSection);
443
            }
444
        }
445
        NonViralNameDetailSection nonViralNameSection = formFactory
446
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
447
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
448
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
449
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
450
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
451
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
452
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
453
            addPart(referenceDetailSection);
454

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

    
463
        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))){
464
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
465
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
466
            addPart(protologSection);
467
        }
468

    
469
        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))){
470
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
471
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
472
            addPart(typeDesignationSection);
473
        }
474

    
475
        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))){
476
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
477
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
478
            addPart(nameRelationshipSection);
479
        }
480

    
481

    
482
        addPart(parsingMessagesSection);
483

    
484
        addPart(nonViralNameSection);
485

    
486
    }
487

    
488
    private void createNameSections(RootElement parent) {
489
        destroySections();
490
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
491
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
492
                | ExpandableComposite.EXPANDED);
493

    
494
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
495

    
496
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
497
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
498
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
499

    
500
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
501
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
502
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
503

    
504
        addPart(nonViralNameSection);
505
        addPart(nomenclaturalStatusSection);
506
        addPart(referenceDetailSection);
507

    
508
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
509
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
510

    
511
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
512
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
513

    
514
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
515
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
516
        addPart(protologSection);
517
        addPart(typeDesignationSection);
518
        addPart(nameRelationshipSection);
519

    
520
    }
521

    
522
    private void createReferenceSections(RootElement parent) {
523
        destroySections();
524

    
525
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
526
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
527

    
528
        addPart(referenceDetailSection);
529
    }
530

    
531
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
532
        destroySections();
533
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
534

    
535
        addPart(teamOrPersonBaseDetailSection);
536
    }
537

    
538
    private void createTeamDetailSection(RootElement parent) {
539
        destroySections();
540
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
541

    
542
        addPart(teamDetailSection);
543
    }
544

    
545
    private void createPersonDetailSection(RootElement parent) {
546
        destroySections();
547
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
548
        addPart(personDetailSection);
549
    }
550

    
551
    private void createDescriptionElementSection(RootElement parent) {
552

    
553
        destroySections();
554
        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
555
        descriptionElementDetailSection.setEnabled(this.detailsEnabled);
556

    
557
        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
558

    
559
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
560

    
561
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
562

    
563
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
564

    
565
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
566

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

    
569
        addPart(descriptionElementDetailSection);
570
        addPart(descriptionElementSourceSection);
571
        addPart(descriptionElementMediaSection);
572
    }
573

    
574
    private void createDescriptionSection(RootElement parent) {
575
        destroySections();
576
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
577

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

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

    
582
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
583

    
584
        //        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
585
        //
586
        //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
587

    
588
        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(
589
                getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
590

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

    
593
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
594

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

    
597
        addPart(descriptionDetailSection);
598
        addPart(naturalLanguageSection);
599
        //        addPart(describedSpecimenSection);
600
        addPart(descriptionSourceSection);
601
        addPart(scopeSection);
602
    }
603

    
604
    private void createSpecimenDescriptionSection(RootElement parent) {
605
        destroySections();
606
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
607
        addPart(descriptionDetailSection);
608
    }
609

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

    
614
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
615

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

    
618
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
619

    
620
        addPart(descriptionDetailSection);
621
        addPart(descriptionSourceSection);
622

    
623
    }
624

    
625
    private void createImageGallerySection(RootElement parent) {
626
        destroySections();
627
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
628

    
629
        addPart(descriptionDetailSection);
630
    }
631

    
632
    private void createMediaElementSection(RootElement parent) {
633
        destroySections();
634

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

    
637
        addPart(mediaDetailSection);
638
    }
639

    
640
    private void createDerivedUnitBaseElementSection(RootElement parent) {
641
        destroySections();
642

    
643
        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
644
        //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
645
        if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
646
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
647
        }
648
        addPart(derivedUnitGeneralDetailSection);
649

    
650
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
651

    
652
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
653
        addPart(derivedUnitBaseDetailSection);
654

    
655
        //for editors working with facades
656
        if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
657
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
658
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
659
            addPart(gatheringEventDetailSection);
660

    
661
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
662
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
663
            addPart(fieldUnitDetailSection);
664
        }
665
        else{
666

    
667
            if(PreferencesUtil.isShowTaxonAssociations()){
668
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
669
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
670
                addPart(taxonAssociationDetailSection);
671
            }
672
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
673
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
674
            addPart(identifierDetailSection);
675
        }
676
        if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
677
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
678
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
679
            addPart(determinationDetailSection);
680
        }
681

    
682
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
683
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
684
        addPart(derivedUnitTypeDesignationSection);
685

    
686
    }
687

    
688
    private void createFieldUnitSection(RootElement parent) {
689
        destroySections();
690

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

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

    
695
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
696

    
697
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
698

    
699
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
700

    
701
        addPart(fielUnitGeneralDetailSection);
702
        addPart(gatheringEventDetailSection);
703
        addPart(fieldUnitDetailSection);
704

    
705
        if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
706
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
707
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
708
            addPart(determinationDetailSection);
709
        }
710
    }
711

    
712
    private void createTissueSampleSection(RootElement parent) {
713
        destroySections();
714

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

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

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

    
721
        addPart(section);
722
        addPart(sampleDesignationDetailSection);
723
    }
724

    
725
    private void createDnaSampleSection(RootElement parent) {
726
        destroySections();
727

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

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

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

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

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

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

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

    
742
        addPart(section);
743
        addPart(preparationPreservationSection);
744
        addPart(qualitySection);
745
        addPart(sampleDesignationDetailSection);
746
    }
747

    
748
    private void createSequenceSection(RootElement parent) {
749
        destroySections();
750

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

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

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

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

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

    
761

    
762
        addPart(section);
763
        addPart(referenceSection);
764
        addPart(contigFileSection);
765
    }
766

    
767
    private void createSingleReadSection(RootElement parent) {
768
        destroySections();
769

    
770
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
771
        addPart(section);
772

    
773
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
774

    
775
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
776
        addPart(pherogramSection);
777

    
778
    }
779

    
780
    private void createMediaSpecimenSection(RootElement parent) {
781
        destroySections();
782

    
783
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
784
        addPart(generalSection);
785

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

    
788
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
789
        addPart(rightsSection);
790

    
791
    }
792

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

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

    
798
        addPart(section);
799
    }
800

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

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

    
806
        addPart(featureDistributionSection);
807
    }
808

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

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

    
814
        addPart(featureDistributionSection);
815
    }
816

    
817
    private void createCharacterSection(RootElement parent) {
818
        destroySections();
819

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

    
822
        addPart(featureDistributionSection);
823
    }
824

    
825
    private void createPolytomousKeyNodeSection(RootElement parent) {
826
        destroySections();
827

    
828
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
829

    
830
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
831

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

    
834
        addPart(polytomousKeyDetailSection);
835
        addPart(polytomousKeyNodeDetailSection);
836

    
837
    }
838

    
839
    private void createUseRecordSection(RootElement parent) {
840
        destroySections();
841

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

    
844
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
845

    
846
        addPart(descriptionUseRecordSection);
847

    
848

    
849
    }
850

    
851
    private void createUserSection(RootElement parent) {
852
        destroySections();
853

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

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

    
858
        addPart(userDetailSection);
859
        addPart(groupByUserDetailSection);
860
    }
861

    
862
    private void createMisappliedNameSection(RootElement parent) {
863
        destroySections();
864

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

    
869
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
870

    
871

    
872
        NonViralNameDetailSection nonViralNameSection = formFactory
873
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
874
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
875
        addPart(nonViralNameSection);
876

    
877
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
878

    
879
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
880
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
881
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
882
        addPart(referenceDetailSection);
883

    
884

    
885
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
886
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
887
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
888
        addPart(nomenclaturalStatusSection);
889

    
890
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
891
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
892
		addPart(protologSection);
893

    
894
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
895
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
896
		addPart(typeDesignationSection);
897

    
898
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
899
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
900
		addPart(nameRelationshipSection);
901

    
902
    }
903

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

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

    
909
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
910
        addPart(taxonRelationshipDetailSection);
911
        addPart(referencedEntityBaseDetailSection);
912
    }
913
    private void createTermVocabularySection(RootElement parent) {
914
        destroySections();
915

    
916
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
917
        addPart(termVocabularyDetailSection);
918
    }
919

    
920
    private void createDefinedTermSection(RootElement parent) {
921
        destroySections();
922

    
923
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
924
        addPart(definedTermDetailSection);
925
    }
926

    
927
    @Override
928
    public void update(CdmDataChangeMap arg0) {
929

    
930
    }
931
    @Inject
932
    @Optional
933
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_TAXON_DETAILS)boolean refresh){
934
        if(refresh){
935
            refresh();
936

    
937
//            setSelection(getSelection(), true);
938
        }
939
    }
940
}
(2-2/2)