Project

General

Profile

Download (44.8 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.Set;
13

    
14
import org.eclipse.jface.viewers.ISelection;
15
import org.eclipse.jface.viewers.SelectionChangedEvent;
16
import org.eclipse.jface.viewers.TreeNode;
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.ui.forms.widgets.ExpandableComposite;
20

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

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

    
131
    private ISelection selection;
132

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

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

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

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

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

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

    
190
        Object input = getInput();
191

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

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

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

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

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

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

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

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

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

    
238
                }
239
            }
240
        } else if (input instanceof DescriptionElementBase) {
241
            Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
242

    
243
            Boolean isUseDescription = false;
244
            for (Marker marker : descriptionMarkers) {
245
                if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
246
                    isUseDescription = true;
247
                }
248
            }
249

    
250
            if (isUseDescription == true && input instanceof CategoricalData) {
251
                createUseRecordSection(rootElement);
252
            } else {
253
                createDescriptionElementSection(rootElement);
254
            }
255

    
256
        } else if (input instanceof Media) {
257
            createMediaElementSection(rootElement);
258

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

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

    
324
    }
325

    
326
    private void createGroupSection(RootElement parent) {
327
        destroySections();
328

    
329
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
330
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
331
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
332

    
333
        addPart(groupDetailSection);
334
        addPart(memberDetailSection);
335
        addPart(grantedAuthorityDetailSection);
336
    }
337

    
338
    /** {@inheritDoc} */
339
    @Override
340
    public ISelection getSelection() {
341
        return selection;
342
    }
343

    
344
    /** {@inheritDoc} */
345
    @Override
346
    public void setSelection(ISelection selection, boolean reveal) {
347

    
348
    		this.selection = selection;
349

    
350
	        if(this.selection!=null){
351
	            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
352
	            fireSelectionChanged(selectionChangedEvent);
353
	        }
354

    
355
    }
356

    
357
    private void createTaxonSections(RootElement parent) {
358
        destroySections();
359

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

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

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

    
394
    	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))){
395
    		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
396
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
397
    		addPart(protologSection);
398
    	}
399

    
400
    	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))){
401
    		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
402
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
403
    		addPart(typeDesignationSection);
404
    	}
405

    
406
    	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))){
407
    		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
408
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
409
    		addPart(nameRelationshipSection);
410
    	}
411

    
412

    
413
        addPart(parsingMessagesSection);
414

    
415
        addPart(nonViralNameSection);
416

    
417
    }
418

    
419
    private void createNameSections(RootElement parent) {
420
        destroySections();
421
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
422
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
423
                        | ExpandableComposite.EXPANDED);
424
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
425

    
426
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
427
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
428
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
429

    
430
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
431
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
432
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
433

    
434
        addPart(nonViralNameSection);
435
        addPart(nomenclaturalStatusSection);
436
        addPart(referenceDetailSection);
437

    
438
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
439
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
440

    
441
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
442
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
443

    
444
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
445
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
446
        addPart(protologSection);
447
        addPart(typeDesignationSection);
448
        addPart(nameRelationshipSection);
449

    
450
    }
451

    
452
    private void createReferenceSections(RootElement parent) {
453
        destroySections();
454

    
455
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
456
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
457

    
458
        addPart(referenceDetailSection);
459
    }
460

    
461
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
462
        destroySections();
463
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
464

    
465
        addPart(teamOrPersonBaseDetailSection);
466
    }
467

    
468
    private void createTeamDetailSection(RootElement parent) {
469
        destroySections();
470
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
471

    
472
        addPart(teamDetailSection);
473
    }
474

    
475
    private void createPersonDetailSection(RootElement parent) {
476
        destroySections();
477
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
478
        addPart(personDetailSection);
479
    }
480

    
481
    private void createDescriptionElementSection(RootElement parent) {
482
        destroySections();
483

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

    
486
      //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
487

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

    
490
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
491

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

    
494
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
495

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

    
498
        addPart(descriptionElementDetailSection);
499
        addPart(descriptionElementSourceSection);
500
        addPart(descriptionElementMediaSection);
501
    }
502

    
503
    private void createDescriptionSection(RootElement parent) {
504
        destroySections();
505
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
506

    
507
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
508

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

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

    
513
//        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
514
//
515
//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
516

    
517
        //		DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
518
        //				.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
519
        //						getConversationHolder(), parent, Section.TWISTIE);
520
        //
521
        //		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
522

    
523
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
524

    
525
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
526

    
527
        addPart(descriptionDetailSection);
528
        addPart(naturalLanguageSection);
529
//        addPart(describedSpecimenSection);
530
        //		addPart(descriptionSourceSection);
531
        addPart(scopeSection);
532
    }
533

    
534
    private void createSpecimenDescriptionSection(RootElement parent) {
535
        destroySections();
536
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
537
        addPart(descriptionDetailSection);
538
    }
539

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

    
544
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
545

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

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

    
550
        addPart(descriptionDetailSection);
551
        addPart(descriptionSourceSection);
552

    
553
    }
554

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

    
559
        addPart(descriptionDetailSection);
560
    }
561

    
562
    private void createMediaElementSection(RootElement parent) {
563
        destroySections();
564

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

    
567
        addPart(mediaDetailSection);
568
    }
569

    
570
    private void createDerivedUnitBaseElementSection(RootElement parent) {
571
        destroySections();
572

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

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

    
582
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
583
        addPart(derivedUnitBaseDetailSection);
584

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

    
591
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
592
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
593
            addPart(fieldUnitDetailSection);
594
        }
595
        else{
596

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

    
612
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
613
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
614
        addPart(derivedUnitTypeDesignationSection);
615

    
616
    }
617

    
618
    private void createFieldUnitSection(RootElement parent) {
619
        destroySections();
620

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

    
623
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
624

    
625
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
626

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

    
629
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
630

    
631
        addPart(fielUnitGeneralDetailSection);
632
        addPart(gatheringEventDetailSection);
633
        addPart(fieldUnitDetailSection);
634

    
635
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
636
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
637
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
638
            addPart(determinationDetailSection);
639
        }
640
    }
641

    
642
    private void createTissueSampleSection(RootElement parent) {
643
        destroySections();
644

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

    
647
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
648

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

    
651
        addPart(section);
652
        addPart(sampleDesignationDetailSection);
653
    }
654

    
655
    private void createDnaSampleSection(RootElement parent) {
656
        destroySections();
657

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

    
660
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
661

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

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

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

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

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

    
672
        addPart(section);
673
        addPart(preparationPreservationSection);
674
        addPart(qualitySection);
675
        addPart(sampleDesignationDetailSection);
676
    }
677

    
678
    private void createSequenceSection(RootElement parent) {
679
        destroySections();
680

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

    
683
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
684

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

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

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

    
691

    
692
        addPart(section);
693
        addPart(referenceSection);
694
        addPart(contigFileSection);
695
    }
696

    
697
    private void createSingleReadSection(RootElement parent) {
698
        destroySections();
699

    
700
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
701
        addPart(section);
702

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

    
705
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
706
        addPart(pherogramSection);
707

    
708
    }
709

    
710
    private void createMediaSpecimenSection(RootElement parent) {
711
        destroySections();
712

    
713
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
714
        addPart(generalSection);
715

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

    
718
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
719
        addPart(rightsSection);
720

    
721
    }
722

    
723
    private void createFeatureDistributionSection(RootElement parent) {
724
        destroySections();
725

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

    
728
        addPart(featureDistributionSection);
729
    }
730

    
731
    private void createPolytomousKeyNodeSection(RootElement parent) {
732
        destroySections();
733

    
734
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
735

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

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

    
740
        addPart(polytomousKeyDetailSection);
741
        addPart(polytomousKeyNodeDetailSection);
742

    
743
    }
744

    
745
    private void createUseRecordSection(RootElement parent) {
746
        destroySections();
747

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

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

    
752
        addPart(descriptionUseRecordSection);
753

    
754

    
755
    }
756

    
757
    private void createUserSection(RootElement parent) {
758
        destroySections();
759

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

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

    
764
        addPart(userDetailSection);
765
        addPart(groupByUserDetailSection);
766
    }
767

    
768
    private void createMisappliedNameSection(RootElement parent) {
769
        destroySections();
770

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

    
773
       // ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
774
        addPart(taxonRelationshipDetailSection);
775
        //addPart(referencedEntityBaseDetailSection);
776

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

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

    
795
	//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))){
796
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
797
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
798
		addPart(protologSection);
799
	//}
800

    
801
	//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))){
802
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
803
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
804
		addPart(typeDesignationSection);
805
	//}
806

    
807
	//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))){
808
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
809
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
810
		addPart(nameRelationshipSection);
811
	//}
812

    
813

    
814
        //}
815
    }
816

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

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

    
822
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
823
        addPart(taxonRelationshipDetailSection);
824
        addPart(referencedEntityBaseDetailSection);
825
    }
826
    private void createTermVocabularySection(RootElement parent) {
827
        destroySections();
828

    
829
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
830
        addPart(termVocabularyDetailSection);
831
    }
832

    
833
    private void createDefinedTermSection(RootElement parent) {
834
        destroySections();
835

    
836
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
837
        addPart(definedTermDetailSection);
838
    }
839

    
840
	@Override
841
	public void update(CdmDataChangeMap arg0) {
842

    
843
	}
844

    
845
}
(2-2/2)