Project

General

Profile

Download (45.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 org.eclipse.jface.viewers.ISelection;
16
import org.eclipse.jface.viewers.SelectionChangedEvent;
17
import org.eclipse.jface.viewers.TreeNode;
18
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.widgets.Composite;
20
import org.eclipse.ui.forms.widgets.ExpandableComposite;
21

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

    
119
/**
120
 *
121
 * The DetailsViewer handles the content of the details view (
122
 * {@link DetailsViewPart}).<br>
123
 * Depending on the type of the selected element the section of the details view
124
 * are created.
125
 *
126
 * @author pplitzner
127
 * @date 18.07.2017
128
 *
129
 */
130
public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
131

    
132
    private ISelection selection;
133

    
134
    public DetailsViewerE4(Composite parent, IDirtyMarkable part) {
135
        super(parent, part);
136
    }
137

    
138
    // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
139
    // since we are getting implementations of DerivedUnitBase from the bulk
140
    // editor
141
    // and not derived unit facade objects,
142

    
143
    @Override
144
    public void setInput(Object input) {
145

    
146
        if(input instanceof TreeNode){
147
            input = ((TreeNode) input).getValue();
148
        }
149
        if(input instanceof GbifResponse){
150
            input = ((GbifResponse) input).getDerivedUnitFacade();
151
        }
152
        if (input !=null && input.getClass().equals(DerivedUnit.class)) {
153
            DerivedUnit derivedUnit = (DerivedUnit)input;
154
            try {
155
                input = DerivedUnitFacade.NewInstance(derivedUnit,
156
                        PreferencesUtil.getDerivedUnitConfigurator());
157
            } catch (DerivedUnitFacadeNotSupportedException e) {
158
                //                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
159
            }
160
        }
161
        else if(input instanceof FieldUnit){
162
            input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input);
163
        }
164
        super.setInput(input);
165
    }
166

    
167
    @Override
168
    protected void markViewPartDirty() {
169
        if (getInput() instanceof DerivedUnitFacade) {
170
            DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
171
            if(facade.innerDerivedUnit()!=null){
172
                part.changed(facade.innerDerivedUnit());
173
            }
174
            else if(facade.innerFieldUnit()!=null){
175
                part.changed(facade.innerFieldUnit());
176
            }
177
        }
178
        else{
179
            super.markViewPartDirty();
180
        }
181
    }
182

    
183
    /** {@inheritDoc} */
184
    @Override
185
    protected void showParts() {
186
        // FIXME (CM) : Need to clean out this code.
187
        // Too much type checking to decide which detail view to display.
188
        // Need to build in a mechanism where navigators / editors are 'aware'
189
        // of the corresponding detail viewer.
190

    
191
        Object input = getInput();
192

    
193
        destroySections();
194
        if (input instanceof TaxonBase) {
195
            if(((TaxonBase) input).getName()==null){
196
                createEmptySection(rootElement);
197
            }
198
            else{
199
                createTaxonSections(rootElement);
200
            }
201

    
202
        } else if (input instanceof TaxonName) {
203
            createNameSections(rootElement);
204

    
205
        } else if (input instanceof Reference) {
206
            createReferenceSections(rootElement);
207

    
208
        } else if (input instanceof Team) {
209
            createTeamDetailSection(rootElement);
210

    
211
        } else if (input instanceof Person) {
212
            createPersonDetailSection(rootElement);
213

    
214
        } else if (input instanceof TeamOrPersonBase) {
215
            createTeamOrPersonBaseDetailSection(rootElement);
216

    
217
        } else if (input instanceof DescriptionBase) {
218
            if(input instanceof SpecimenDescription){
219
                //TODO: add more sections to DetailsView for SpecimenDescription
220
                createSpecimenDescriptionSection(rootElement);
221
            }
222
            else{
223
                Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
224

    
225
                Boolean isUseDescription = false;
226
                for (Marker marker : descriptionMarkers) {
227
                    if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
228
                        isUseDescription = true;
229
                    }
230
                }
231
                if (((DescriptionBase<?>) input).isImageGallery()) {
232
                    createImageGallerySection(rootElement);
233

    
234
                } else if (isUseDescription) {
235
                    createUseDescriptionSection(rootElement);
236
                } else {
237
                    createDescriptionSection(rootElement);
238

    
239
                }
240
            }
241
        } else if (input instanceof DescriptionElementBase){
242
            Set<Marker> descriptionMarkers = new HashSet<>();
243
            if(((DescriptionElementBase) input).getInDescription()!=null) {
244
                descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
245
            }
246

    
247
            Boolean isUseDescription = false;
248
            for (Marker marker : descriptionMarkers) {
249
                if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
250
                    isUseDescription = true;
251
                }
252
            }
253

    
254
            if (isUseDescription == true && input instanceof CategoricalData) {
255
                createUseRecordSection(rootElement);
256
            } else {
257
                createDescriptionElementSection(rootElement);
258
            }
259

    
260
        } else if (input instanceof Media) {
261
            createMediaElementSection(rootElement);
262

    
263
        } else if (input instanceof DerivedUnitFacade) {
264
            if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){
265
                if(((DerivedUnitFacade) input).innerFieldUnit()==null){
266
                    MessagingUtils.error(DetailsViewerE4.class, "FieldUnit of facade is null", null);
267
                }
268
                else{
269
                    createFieldUnitSection(rootElement);
270
                }
271
            }
272
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.PreservedSpecimen){
273
                if(((DerivedUnitFacade) input).innerDerivedUnit()==null){
274
                    MessagingUtils.error(DetailsViewerE4.class, "DerivedUnit of facade is null", null);
275
                }
276
                else{
277
                    createDerivedUnitBaseElementSection(rootElement);
278
                }
279
            }
280
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
281
                //TissueSample should only be created by using it's own class
282
                //in future using only one class with different SpecimenOrObservationTypes is desired
283
                createTissueSampleSection(rootElement);
284
            }
285
            else{
286
                createDerivedUnitBaseElementSection(rootElement);
287
            }
288
        } else if (input instanceof DnaSample){
289
            DnaSample dnaSample = (DnaSample)input;
290
            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
291
                createTissueSampleSection(rootElement);
292
            }
293
            else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
294
                createDnaSampleSection(rootElement);
295
            }
296
        } else if (input instanceof MediaSpecimen){
297
            createMediaSpecimenSection(rootElement);
298
        }
299
        else if(input instanceof Sequence){
300
            createSequenceSection(rootElement);
301
        }
302
        else if(input instanceof SingleRead){
303
            createSingleReadSection(rootElement);
304
        }
305
        else if (input instanceof FeatureNodeContainer) {
306
            createFeatureDistributionSection(rootElement);
307

    
308
        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
309
            createPolytomousKeyNodeSection(rootElement);
310
        } else if (input instanceof User) {
311
            createUserSection(rootElement);
312
        } else if (input instanceof Group) {
313
            createGroupSection(rootElement);
314
        } else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
315
            createMisappliedNameSection(rootElement);
316
        }else if (input instanceof TaxonRelationship ) {
317
            createTaxonRelationshipSection(rootElement);
318
        } else if (input instanceof TermVocabulary) {
319
            createTermVocabularySection(rootElement);
320
        } else if (input instanceof DefinedTermBase) {
321
            createDefinedTermSection(rootElement);
322
        }
323
        else {
324
            createEmptySection(rootElement);
325
        }
326
        layout();
327

    
328
    }
329

    
330
    private void createGroupSection(RootElement parent) {
331
        destroySections();
332

    
333
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
334
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
335
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
336

    
337
        addPart(groupDetailSection);
338
        addPart(memberDetailSection);
339
        addPart(grantedAuthorityDetailSection);
340
    }
341

    
342
    /** {@inheritDoc} */
343
    @Override
344
    public ISelection getSelection() {
345
        return selection;
346
    }
347

    
348
    /** {@inheritDoc} */
349
    @Override
350
    public void setSelection(ISelection selection, boolean reveal) {
351

    
352
        this.selection = selection;
353

    
354
        if(this.selection!=null){
355
            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
356
            fireSelectionChanged(selectionChangedEvent);
357
        }
358

    
359
    }
360

    
361
    private void createTaxonSections(RootElement parent) {
362
        destroySections();
363

    
364
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
365
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
366
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
367
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
368
                    ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
369
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
370
            addPart(taxonBaseDetailSection);
371
        }else{
372
            if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
373
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
374
                        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
375
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
376

    
377
                addPart(taxonBaseDetailSection);
378
            }
379
        }
380
        NonViralNameDetailSection nonViralNameSection = formFactory
381
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
382
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
383
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
384
        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))){
385
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
386
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
387
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
388
            addPart(referenceDetailSection);
389

    
390
        }
391
        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))){
392
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
393
                    ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
394
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
395
            addPart(nomenclaturalStatusSection);
396
        }
397

    
398
        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))){
399
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
400
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
401
            addPart(protologSection);
402
        }
403

    
404
        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))){
405
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
406
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
407
            addPart(typeDesignationSection);
408
        }
409

    
410
        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))){
411
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
412
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
413
            addPart(nameRelationshipSection);
414
        }
415

    
416

    
417
        addPart(parsingMessagesSection);
418

    
419
        addPart(nonViralNameSection);
420

    
421
    }
422

    
423
    private void createNameSections(RootElement parent) {
424
        destroySections();
425
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
426
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
427
                | ExpandableComposite.EXPANDED);
428
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
429

    
430
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
431
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
432
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
433

    
434
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
435
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
436
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
437

    
438
        addPart(nonViralNameSection);
439
        addPart(nomenclaturalStatusSection);
440
        addPart(referenceDetailSection);
441

    
442
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
443
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
444

    
445
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
446
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
447

    
448
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
449
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
450
        addPart(protologSection);
451
        addPart(typeDesignationSection);
452
        addPart(nameRelationshipSection);
453

    
454
    }
455

    
456
    private void createReferenceSections(RootElement parent) {
457
        destroySections();
458

    
459
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
460
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
461

    
462
        addPart(referenceDetailSection);
463
    }
464

    
465
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
466
        destroySections();
467
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
468

    
469
        addPart(teamOrPersonBaseDetailSection);
470
    }
471

    
472
    private void createTeamDetailSection(RootElement parent) {
473
        destroySections();
474
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
475

    
476
        addPart(teamDetailSection);
477
    }
478

    
479
    private void createPersonDetailSection(RootElement parent) {
480
        destroySections();
481
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
482
        addPart(personDetailSection);
483
    }
484

    
485
    private void createDescriptionElementSection(RootElement parent) {
486
        destroySections();
487

    
488
        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
489

    
490
        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
491

    
492
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
493

    
494
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
495

    
496
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
497

    
498
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
499

    
500
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
501

    
502
        addPart(descriptionElementDetailSection);
503
        addPart(descriptionElementSourceSection);
504
        addPart(descriptionElementMediaSection);
505
    }
506

    
507
    private void createDescriptionSection(RootElement parent) {
508
        destroySections();
509
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
510

    
511
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
512

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

    
515
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
516

    
517
        //        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
518
        //
519
        //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
520

    
521
        //		DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
522
        //				.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
523
        //						getConversationHolder(), parent, Section.TWISTIE);
524
        //
525
        //		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
526

    
527
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
528

    
529
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
530

    
531
        addPart(descriptionDetailSection);
532
        addPart(naturalLanguageSection);
533
        //        addPart(describedSpecimenSection);
534
        //		addPart(descriptionSourceSection);
535
        addPart(scopeSection);
536
    }
537

    
538
    private void createSpecimenDescriptionSection(RootElement parent) {
539
        destroySections();
540
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
541
        addPart(descriptionDetailSection);
542
    }
543

    
544
    private void createUseDescriptionSection(RootElement parent) {
545
        destroySections();
546
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
547

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

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

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

    
554
        addPart(descriptionDetailSection);
555
        addPart(descriptionSourceSection);
556

    
557
    }
558

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

    
563
        addPart(descriptionDetailSection);
564
    }
565

    
566
    private void createMediaElementSection(RootElement parent) {
567
        destroySections();
568

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

    
571
        addPart(mediaDetailSection);
572
    }
573

    
574
    private void createDerivedUnitBaseElementSection(RootElement parent) {
575
        destroySections();
576

    
577
        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
578
        //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
579
        if(!(AbstractUtility.getActiveE4Part() instanceof IDerivedUnitFacadePart)){
580
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
581
        }
582
        addPart(derivedUnitGeneralDetailSection);
583

    
584
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
585

    
586
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
587
        addPart(derivedUnitBaseDetailSection);
588

    
589
        //for editors working with facades
590
        if(AbstractUtility.getActiveE4Part() instanceof IDerivedUnitFacadePart){
591
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
592
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
593
            addPart(gatheringEventDetailSection);
594

    
595
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
596
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
597
            addPart(fieldUnitDetailSection);
598
        }
599
        else{
600

    
601
            if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
602
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
603
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
604
                addPart(taxonAssociationDetailSection);
605
            }
606
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
607
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
608
            addPart(identifierDetailSection);
609
        }
610
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
611
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
612
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
613
            addPart(determinationDetailSection);
614
        }
615

    
616
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
617
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
618
        addPart(derivedUnitTypeDesignationSection);
619

    
620
    }
621

    
622
    private void createFieldUnitSection(RootElement parent) {
623
        destroySections();
624

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

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

    
629
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
630

    
631
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
632

    
633
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
634

    
635
        addPart(fielUnitGeneralDetailSection);
636
        addPart(gatheringEventDetailSection);
637
        addPart(fieldUnitDetailSection);
638

    
639
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
640
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
641
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
642
            addPart(determinationDetailSection);
643
        }
644
    }
645

    
646
    private void createTissueSampleSection(RootElement parent) {
647
        destroySections();
648

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

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

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

    
655
        addPart(section);
656
        addPart(sampleDesignationDetailSection);
657
    }
658

    
659
    private void createDnaSampleSection(RootElement parent) {
660
        destroySections();
661

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

    
664
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
665

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

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

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

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

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

    
676
        addPart(section);
677
        addPart(preparationPreservationSection);
678
        addPart(qualitySection);
679
        addPart(sampleDesignationDetailSection);
680
    }
681

    
682
    private void createSequenceSection(RootElement parent) {
683
        destroySections();
684

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

    
687
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
688

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

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

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

    
695

    
696
        addPart(section);
697
        addPart(referenceSection);
698
        addPart(contigFileSection);
699
    }
700

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

    
704
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
705
        addPart(section);
706

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

    
709
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
710
        addPart(pherogramSection);
711

    
712
    }
713

    
714
    private void createMediaSpecimenSection(RootElement parent) {
715
        destroySections();
716

    
717
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
718
        addPart(generalSection);
719

    
720
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
721

    
722
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
723
        addPart(rightsSection);
724

    
725
    }
726

    
727
    private void createFeatureDistributionSection(RootElement parent) {
728
        destroySections();
729

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

    
732
        addPart(featureDistributionSection);
733
    }
734

    
735
    private void createPolytomousKeyNodeSection(RootElement parent) {
736
        destroySections();
737

    
738
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
739

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

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

    
744
        addPart(polytomousKeyDetailSection);
745
        addPart(polytomousKeyNodeDetailSection);
746

    
747
    }
748

    
749
    private void createUseRecordSection(RootElement parent) {
750
        destroySections();
751

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

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

    
756
        addPart(descriptionUseRecordSection);
757

    
758

    
759
    }
760

    
761
    private void createUserSection(RootElement parent) {
762
        destroySections();
763

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

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

    
768
        addPart(userDetailSection);
769
        addPart(groupByUserDetailSection);
770
    }
771

    
772
    private void createMisappliedNameSection(RootElement parent) {
773
        destroySections();
774

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

    
777
        // ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
778
        addPart(taxonRelationshipDetailSection);
779
        //addPart(referencedEntityBaseDetailSection);
780

    
781
        NonViralNameDetailSection nonViralNameSection = formFactory
782
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
783
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
784
        addPart(nonViralNameSection);
785
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
786
        //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))){
787
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
788
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
789
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
790
        addPart(referenceDetailSection);
791

    
792
        //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))){
793
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
794
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
795
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
796
        addPart(nomenclaturalStatusSection);
797
        //}
798

    
799
        //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))){
800
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
801
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
802
        addPart(protologSection);
803
        //}
804

    
805
        //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))){
806
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
807
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
808
        addPart(typeDesignationSection);
809
        //}
810

    
811
        //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))){
812
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
813
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
814
        addPart(nameRelationshipSection);
815
        //}
816

    
817

    
818
        //}
819
    }
820

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

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

    
826
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
827
        addPart(taxonRelationshipDetailSection);
828
        addPart(referencedEntityBaseDetailSection);
829
    }
830
    private void createTermVocabularySection(RootElement parent) {
831
        destroySections();
832

    
833
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
834
        addPart(termVocabularyDetailSection);
835
    }
836

    
837
    private void createDefinedTermSection(RootElement parent) {
838
        destroySections();
839

    
840
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
841
        addPart(definedTermDetailSection);
842
    }
843

    
844
    @Override
845
    public void update(CdmDataChangeMap arg0) {
846

    
847
    }
848

    
849
}
(2-2/2)