Project

General

Profile

Download (44.3 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
    /** {@inheritDoc} */
167
    @Override
168
    protected void showParts() {
169
        // FIXME (CM) : Need to clean out this code.
170
        // Too much type checking to decide which detail view to display.
171
        // Need to build in a mechanism where navigators / editors are 'aware'
172
        // of the corresponding detail viewer.
173

    
174
        Object input = getInput();
175

    
176
        destroySections();
177
        if (input instanceof TaxonBase) {
178
            if(((TaxonBase) input).getName()==null){
179
                createEmptySection(rootElement);
180
            }
181
            else{
182
                createTaxonSections(rootElement);
183
            }
184

    
185
        } else if (input instanceof TaxonName) {
186
            createNameSections(rootElement);
187

    
188
        } else if (input instanceof Reference) {
189
            createReferenceSections(rootElement);
190

    
191
        } else if (input instanceof Team) {
192
            createTeamDetailSection(rootElement);
193

    
194
        } else if (input instanceof Person) {
195
            createPersonDetailSection(rootElement);
196

    
197
        } else if (input instanceof TeamOrPersonBase) {
198
            createTeamOrPersonBaseDetailSection(rootElement);
199

    
200
        } else if (input instanceof DescriptionBase) {
201
            if(input instanceof SpecimenDescription){
202
                //TODO: add more sections to DetailsView for SpecimenDescription
203
                createSpecimenDescriptionSection(rootElement);
204
            }
205
            else{
206
                Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
207

    
208
                Boolean isUseDescription = false;
209
                for (Marker marker : descriptionMarkers) {
210
                    if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
211
                        isUseDescription = true;
212
                    }
213
                }
214
                if (((DescriptionBase<?>) input).isImageGallery()) {
215
                    createImageGallerySection(rootElement);
216

    
217
                } else if (isUseDescription) {
218
                    createUseDescriptionSection(rootElement);
219
                } else {
220
                    createDescriptionSection(rootElement);
221

    
222
                }
223
            }
224
        } else if (input instanceof DescriptionElementBase) {
225
            Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
226

    
227
            Boolean isUseDescription = false;
228
            for (Marker marker : descriptionMarkers) {
229
                if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
230
                    isUseDescription = true;
231
                }
232
            }
233

    
234
            if (isUseDescription == true && input instanceof CategoricalData) {
235
                createUseRecordSection(rootElement);
236
            } else {
237
                createDescriptionElementSection(rootElement);
238
            }
239

    
240
        } else if (input instanceof Media) {
241
            createMediaElementSection(rootElement);
242

    
243
        } else if (input instanceof DerivedUnitFacade) {
244
            if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){
245
                if(((DerivedUnitFacade) input).innerFieldUnit()==null){
246
                    MessagingUtils.error(DetailsViewerE4.class, "FieldUnit of facade is null", null);
247
                }
248
                else{
249
                    createFieldUnitSection(rootElement);
250
                }
251
            }
252
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.PreservedSpecimen){
253
                if(((DerivedUnitFacade) input).innerDerivedUnit()==null){
254
                    MessagingUtils.error(DetailsViewerE4.class, "DerivedUnit of facade is null", null);
255
                }
256
                else{
257
                    createDerivedUnitBaseElementSection(rootElement);
258
                }
259
            }
260
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
261
                //TissueSample should only be created by using it's own class
262
                //in future using only one class with different SpecimenOrObservationTypes is desired
263
                createTissueSampleSection(rootElement);
264
            }
265
            else{
266
                createDerivedUnitBaseElementSection(rootElement);
267
            }
268
        } else if (input instanceof DnaSample){
269
            DnaSample dnaSample = (DnaSample)input;
270
            if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
271
                createTissueSampleSection(rootElement);
272
            }
273
            else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
274
                createDnaSampleSection(rootElement);
275
            }
276
        } else if (input instanceof MediaSpecimen){
277
            createMediaSpecimenSection(rootElement);
278
        }
279
        else if(input instanceof Sequence){
280
            createSequenceSection(rootElement);
281
        }
282
        else if(input instanceof SingleRead){
283
            createSingleReadSection(rootElement);
284
        }
285
        else if (input instanceof FeatureNodeContainer) {
286
            createFeatureDistributionSection(rootElement);
287

    
288
        }else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
289
            createPolytomousKeyNodeSection(rootElement);
290
        } else if (input instanceof User) {
291
            createUserSection(rootElement);
292
        } else if (input instanceof Group) {
293
            createGroupSection(rootElement);
294
        } else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
295
            createMisappliedNameSection(rootElement);
296
        }else if (input instanceof TaxonRelationship ) {
297
            createTaxonRelationshipSection(rootElement);
298
        } else if (input instanceof TermVocabulary) {
299
            createTermVocabularySection(rootElement);
300
        } else if (input instanceof DefinedTermBase) {
301
            createDefinedTermSection(rootElement);
302
        }
303
        else {
304
            createEmptySection(rootElement);
305
        }
306
        layout();
307

    
308
    }
309

    
310
    private void createGroupSection(RootElement parent) {
311
        destroySections();
312

    
313
        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
314
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
315
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
316

    
317
        addPart(groupDetailSection);
318
        addPart(memberDetailSection);
319
        addPart(grantedAuthorityDetailSection);
320
    }
321

    
322
    /** {@inheritDoc} */
323
    @Override
324
    public ISelection getSelection() {
325
        return selection;
326
    }
327

    
328
    /** {@inheritDoc} */
329
    @Override
330
    public void setSelection(ISelection selection, boolean reveal) {
331

    
332
    		this.selection = selection;
333

    
334
	        if(this.selection!=null){
335
	            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
336
	            fireSelectionChanged(selectionChangedEvent);
337
	        }
338

    
339
    }
340

    
341
    private void createTaxonSections(RootElement parent) {
342
        destroySections();
343

    
344
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
345
                ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
346
        if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
347
        	TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
348
	        ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
349
	        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
350
	        addPart(taxonBaseDetailSection);
351
        }else{
352
        	if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
353
	            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
354
	            		ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
355
	            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
356

    
357
	            addPart(taxonBaseDetailSection);
358
        	}
359
        }
360
        NonViralNameDetailSection nonViralNameSection = formFactory
361
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
362
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
363
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
364
        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))){
365
	            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
366
	            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
367
	            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
368
	            addPart(referenceDetailSection);
369

    
370
        }
371
        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))){
372
	            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
373
	            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
374
	            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
375
	            addPart(nomenclaturalStatusSection);
376
        }
377

    
378
    	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))){
379
    		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
380
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
381
    		addPart(protologSection);
382
    	}
383

    
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_TYPE_DESIGNATION))){
385
    		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
386
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
387
    		addPart(typeDesignationSection);
388
    	}
389

    
390
    	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))){
391
    		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
392
    		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
393
    		addPart(nameRelationshipSection);
394
    	}
395

    
396

    
397
        addPart(parsingMessagesSection);
398

    
399
        addPart(nonViralNameSection);
400

    
401
    }
402

    
403
    private void createNameSections(RootElement parent) {
404
        destroySections();
405
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
406
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
407
                        | ExpandableComposite.EXPANDED);
408
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
409

    
410
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
411
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
412
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
413

    
414
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
415
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
416
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
417

    
418
        addPart(nonViralNameSection);
419
        addPart(nomenclaturalStatusSection);
420
        addPart(referenceDetailSection);
421

    
422
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
423
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
424

    
425
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
426
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
427

    
428
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
429
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
430
        addPart(protologSection);
431
        addPart(typeDesignationSection);
432
        addPart(nameRelationshipSection);
433

    
434
    }
435

    
436
    private void createReferenceSections(RootElement parent) {
437
        destroySections();
438

    
439
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
440
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
441

    
442
        addPart(referenceDetailSection);
443
    }
444

    
445
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
446
        destroySections();
447
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
448

    
449
        addPart(teamOrPersonBaseDetailSection);
450
    }
451

    
452
    private void createTeamDetailSection(RootElement parent) {
453
        destroySections();
454
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
455

    
456
        addPart(teamDetailSection);
457
    }
458

    
459
    private void createPersonDetailSection(RootElement parent) {
460
        destroySections();
461
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
462
        addPart(personDetailSection);
463
    }
464

    
465
    private void createDescriptionElementSection(RootElement parent) {
466
        destroySections();
467

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

    
470
      //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  ExpandableComposite.TWISTIE);
471

    
472
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
473

    
474
        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
475

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

    
478
        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
479

    
480
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
481

    
482
        addPart(descriptionElementDetailSection);
483
        addPart(descriptionElementSourceSection);
484
        addPart(descriptionElementMediaSection);
485
    }
486

    
487
    private void createDescriptionSection(RootElement parent) {
488
        destroySections();
489
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
490

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

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

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

    
497
//        DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
498
//
499
//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
500

    
501
        //		DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
502
        //				.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
503
        //						getConversationHolder(), parent, Section.TWISTIE);
504
        //
505
        //		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
506

    
507
        ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
508

    
509
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
510

    
511
        addPart(descriptionDetailSection);
512
        addPart(naturalLanguageSection);
513
//        addPart(describedSpecimenSection);
514
        //		addPart(descriptionSourceSection);
515
        addPart(scopeSection);
516
    }
517

    
518
    private void createSpecimenDescriptionSection(RootElement parent) {
519
        destroySections();
520
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
521
        addPart(descriptionDetailSection);
522
    }
523

    
524
    private void createUseDescriptionSection(RootElement parent) {
525
        destroySections();
526
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
527

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

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

    
532
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
533

    
534
        addPart(descriptionDetailSection);
535
        addPart(descriptionSourceSection);
536

    
537
    }
538

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

    
543
        addPart(descriptionDetailSection);
544
    }
545

    
546
    private void createMediaElementSection(RootElement parent) {
547
        destroySections();
548

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

    
551
        addPart(mediaDetailSection);
552
    }
553

    
554
    private void createDerivedUnitBaseElementSection(RootElement parent) {
555
        destroySections();
556

    
557
        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
558
        //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
559
        if(!(AbstractUtility.getActiveE4Part() instanceof IDerivedUnitFacadePart)){
560
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
561
        }
562
        addPart(derivedUnitGeneralDetailSection);
563

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

    
566
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
567
        addPart(derivedUnitBaseDetailSection);
568

    
569
        //for editors working with facades
570
        if(AbstractUtility.getActiveE4Part() instanceof IDerivedUnitFacadePart){
571
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
572
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
573
            addPart(gatheringEventDetailSection);
574

    
575
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
576
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
577
            addPart(fieldUnitDetailSection);
578
        }
579
        else{
580

    
581
            if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
582
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
583
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
584
                addPart(taxonAssociationDetailSection);
585
            }
586
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
587
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
588
            addPart(identifierDetailSection);
589
        }
590
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
591
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
592
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
593
            addPart(determinationDetailSection);
594
        }
595

    
596
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
597
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
598
        addPart(derivedUnitTypeDesignationSection);
599

    
600
    }
601

    
602
    private void createFieldUnitSection(RootElement parent) {
603
        destroySections();
604

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

    
607
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
608

    
609
        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
610

    
611
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
612

    
613
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
614

    
615
        addPart(fielUnitGeneralDetailSection);
616
        addPart(gatheringEventDetailSection);
617
        addPart(fieldUnitDetailSection);
618

    
619
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
620
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
621
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
622
            addPart(determinationDetailSection);
623
        }
624
    }
625

    
626
    private void createTissueSampleSection(RootElement parent) {
627
        destroySections();
628

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

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

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

    
635
        addPart(section);
636
        addPart(sampleDesignationDetailSection);
637
    }
638

    
639
    private void createDnaSampleSection(RootElement parent) {
640
        destroySections();
641

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

    
644
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
645

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

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

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

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

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

    
656
        addPart(section);
657
        addPart(preparationPreservationSection);
658
        addPart(qualitySection);
659
        addPart(sampleDesignationDetailSection);
660
    }
661

    
662
    private void createSequenceSection(RootElement parent) {
663
        destroySections();
664

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

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

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

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

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

    
675

    
676
        addPart(section);
677
        addPart(referenceSection);
678
        addPart(contigFileSection);
679
    }
680

    
681
    private void createSingleReadSection(RootElement parent) {
682
        destroySections();
683

    
684
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
685
        addPart(section);
686

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

    
689
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
690
        addPart(pherogramSection);
691

    
692
    }
693

    
694
    private void createMediaSpecimenSection(RootElement parent) {
695
        destroySections();
696

    
697
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
698
        addPart(generalSection);
699

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

    
702
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
703
        addPart(rightsSection);
704

    
705
    }
706

    
707
    private void createFeatureDistributionSection(RootElement parent) {
708
        destroySections();
709

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

    
712
        addPart(featureDistributionSection);
713
    }
714

    
715
    private void createPolytomousKeyNodeSection(RootElement parent) {
716
        destroySections();
717

    
718
        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
719

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

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

    
724
        addPart(polytomousKeyDetailSection);
725
        addPart(polytomousKeyNodeDetailSection);
726

    
727
    }
728

    
729
    private void createUseRecordSection(RootElement parent) {
730
        destroySections();
731

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

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

    
736
        addPart(descriptionUseRecordSection);
737

    
738

    
739
    }
740

    
741
    private void createUserSection(RootElement parent) {
742
        destroySections();
743

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

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

    
748
        addPart(userDetailSection);
749
        addPart(groupByUserDetailSection);
750
    }
751

    
752
    private void createMisappliedNameSection(RootElement parent) {
753
        destroySections();
754

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

    
757
       // ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
758
        addPart(taxonRelationshipDetailSection);
759
        //addPart(referencedEntityBaseDetailSection);
760

    
761
        NonViralNameDetailSection nonViralNameSection = formFactory
762
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
763
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
764
        addPart(nonViralNameSection);
765
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
766
        //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))){
767
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
768
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
769
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
770
        addPart(referenceDetailSection);
771

    
772
        //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))){
773
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
774
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
775
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
776
            addPart(nomenclaturalStatusSection);
777
    //}
778

    
779
	//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))){
780
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
781
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
782
		addPart(protologSection);
783
	//}
784

    
785
	//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))){
786
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
787
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
788
		addPart(typeDesignationSection);
789
	//}
790

    
791
	//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))){
792
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
793
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
794
		addPart(nameRelationshipSection);
795
	//}
796

    
797

    
798
        //}
799
    }
800

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

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

    
806
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
807
        addPart(taxonRelationshipDetailSection);
808
        addPart(referencedEntityBaseDetailSection);
809
    }
810
    private void createTermVocabularySection(RootElement parent) {
811
        destroySections();
812

    
813
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
814
        addPart(termVocabularyDetailSection);
815
    }
816

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

    
820
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
821
        addPart(definedTermDetailSection);
822
    }
823

    
824
	@Override
825
	public void update(CdmDataChangeMap arg0) {
826

    
827
	}
828

    
829
}
(2-2/2)