Project

General

Profile

« Previous | Next » 

Revision 9a1539bb

Added by Katja Luther over 4 years ago

ref #6159: details of selected distr are shown for distr. editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
23 23

  
24 24
import org.apache.log4j.Logger;
25 25
import org.eclipse.core.runtime.IProgressMonitor;
26

  
27 26
import org.eclipse.e4.ui.di.Focus;
28 27
import org.eclipse.e4.ui.di.Persist;
29 28
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
30 29
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
31 30
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
31
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
32
import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
32 33
import org.eclipse.jface.viewers.ISelectionChangedListener;
33

  
34 34
import org.eclipse.jface.viewers.StructuredViewer;
35 35
import org.eclipse.jface.viewers.TableViewer;
36 36
import org.eclipse.jface.viewers.TableViewerColumn;
37
import org.eclipse.jface.viewers.TableViewerEditor;
38
import org.eclipse.jface.viewers.TableViewerFocusCellManager;
37 39
import org.eclipse.swt.SWT;
38 40
import org.eclipse.swt.events.ModifyListener;
39 41
import org.eclipse.swt.events.SelectionAdapter;
......
41 43
import org.eclipse.swt.layout.GridData;
42 44
import org.eclipse.swt.layout.GridLayout;
43 45
import org.eclipse.swt.widgets.Composite;
44

  
45 46
import org.eclipse.swt.widgets.Label;
46 47
import org.eclipse.swt.widgets.Menu;
47 48
import org.eclipse.swt.widgets.MenuItem;
......
57 58
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
58 59
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
59 60
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
60

  
61 61
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
62 62
import eu.etaxonomy.cdm.model.taxon.Classification;
63

  
64 63
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
65 64
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
66 65
import eu.etaxonomy.taxeditor.editor.EditorUtil;
67
import eu.etaxonomy.taxeditor.editor.SimpleSelectionProvider;
68 66
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
69 67
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
70 68
import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistContentProvider;
......
82 80
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
83 81
import eu.etaxonomy.taxeditor.preference.Resources;
84 82
import eu.etaxonomy.taxeditor.store.CdmStore;
83
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
85 84

  
86 85
/**
87 86
 *
......
89 88
 *
90 89
 */
91 90
public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversationEnabled,
92
        IContextListener, IDirtyMarkable, IPartContentHasDetails{
91
        IContextListener, IDirtyMarkable, IPartContentHasDetails, IE4SavablePart{
93 92

  
94 93
    private static final String DISTRIBUTION_EDITOR = "Distribution Editor";
95 94
	private static final String LOADING_TAXA = Messages.ChecklistEditor_LOAD_TAXA;
......
230 229
        taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
231 230
        viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
232 231

  
232
        //the focuzsCellManager should return the distribution!!!
233
        TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(viewer, new FocusCellOwnerDrawHighlighter (viewer));
234
        TableViewerEditor.create(viewer, focusCellManager, new ColumnViewerEditorActivationStrategy(viewer), TableViewerEditor.KEYBOARD_ACTIVATION);
235

  
236

  
233 237
//        viewer.addSelectionChangedListener(new ISelectionChangedListener() {
234 238
//        	  @Override
235 239
//        	  public void selectionChanged(SelectionChangedEvent event) {
......
398 402
                    column.getColumn().setWidth(50);
399 403
                }
400 404
                column.setEditingSupport(new DistributionEditingSupportE4(viewer, this, columnIndex));
405

  
401 406
            }
402 407
        }
403 408
	}
......
650 655
        return selectionAdapter;
651 656
    }
652 657

  
653
    @Persist
654 658
    public void doSave(IProgressMonitor monitor) {
655 659
        try {
656 660
            monitor.beginTask(Messages.ChecklistEditor_SAVE_EDITOR, 1);
......
676 680
            conversation.registerForDataStoreChanges(this);
677 681
        }
678 682
        //propagate selection
679
        selectionChangedListener = (event -> selService.setSelection(event));
683
        selectionChangedListener = (event -> selService.setSelection(
684
               DistributionEditorHelper.getDistributionForColumn(event)));
685

  
680 686
        viewer.addSelectionChangedListener(selectionChangedListener);
681 687

  
682 688

  
......
845 851
        return conversation;
846 852
    }
847 853

  
854
    /* (non-Javadoc)
855
     * @see eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart#save(org.eclipse.core.runtime.IProgressMonitor)
856
     */
857
    @Override
858
    @Persist
859
    public void save(IProgressMonitor monitor) {
860
        doSave(monitor);
861

  
862
    }
863

  
848 864

  
849 865
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditingSupportE4.java
7 7

  
8 8
import javax.inject.Inject;
9 9

  
10

  
11 10
import org.apache.commons.lang.StringUtils;
12 11
import org.apache.log4j.Logger;
13 12
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
......
15 14
import org.eclipse.jface.viewers.CellEditor;
16 15
import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
17 16
import org.eclipse.jface.viewers.EditingSupport;
18
import org.eclipse.jface.viewers.ICellEditorListener;
19 17
import org.eclipse.jface.viewers.ISelection;
20 18
import org.eclipse.jface.viewers.ISelectionChangedListener;
21 19
import org.eclipse.jface.viewers.LabelProvider;
22
import org.eclipse.jface.viewers.SelectionChangedEvent;
23 20
import org.eclipse.jface.viewers.StructuredSelection;
24 21
import org.eclipse.jface.viewers.TableViewer;
25 22
import org.eclipse.swt.SWT;
26 23
import org.eclipse.swt.widgets.Composite;
27 24
import org.eclipse.swt.widgets.TableColumn;
28 25

  
29
import eu.etaxonomy.cdm.api.service.IDescriptionService;
30 26
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
31 27
import eu.etaxonomy.cdm.model.common.TermType;
32 28
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
......
35 31
import eu.etaxonomy.cdm.model.description.TaxonDescription;
36 32
import eu.etaxonomy.cdm.model.location.NamedArea;
37 33
import eu.etaxonomy.cdm.model.taxon.Taxon;
38
import eu.etaxonomy.taxeditor.editor.SimpleSelectionProvider;
39
import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
40
import eu.etaxonomy.taxeditor.editor.view.checklist.edit.CdmComboBoxViewerCellEditor;
41 34
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
42 35
import eu.etaxonomy.taxeditor.store.CdmStore;
43 36

  
......
48 41
    private final ChecklistEditorE4 editor;
49 42
//    private final IDescriptionService descriptionService;
50 43
    private final int columnIndex;
51
     
44

  
52 45
    @Inject
53 46
    private ESelectionService selService;
54 47
    private ISelectionChangedListener selectionChangedListener;
55
    
48

  
56 49
    private static final Logger logger = Logger.getLogger(DistributionEditingSupportE4.class);
57 50

  
58 51
    public DistributionEditingSupportE4(TableViewer viewer, ChecklistEditorE4 checklistEditor, int columnIndex) {
59 52
        super(viewer);
60 53
        this.viewer = viewer;
61 54
        this.columnIndex = columnIndex;
62
       
55

  
63 56
//        descriptionService = CdmStore.getService(IDescriptionService.class);
64 57
        editor = checklistEditor;
65 58
        cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY);
......
85 78
        // TODO set input
86 79
//        List<PresenceAbsenceTermBase> input = CdmStore.getTermManager()
87 80
//                .getPreferredTerms(PresenceAbsenceTermBase.class);
88
        selectionChangedListener = (event -> selService.setSelection(event));
89
        viewer.addSelectionChangedListener(selectionChangedListener);
81
//        selectionChangedListener = (event -> selService.setSelection(event));
82
//        viewer.addSelectionChangedListener(selectionChangedListener);
90 83
        List<DefinedTermBase<?>> input = CdmStore.getTermManager().getPreferredTerms(TermType.PresenceAbsenceTerm);
91 84
        cellEditor.setInput(input);
92 85
    }
......
107 100
            Taxon taxon = (Taxon) element;
108 101
            String result = null;
109 102
            Distribution distributionForColumn = getDistributionForColumn(taxon);
110
           
103

  
111 104
            if (distributionForColumn != null) {
112 105
                PresenceAbsenceTerm status = distributionForColumn.getStatus();
113 106
                if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
......
123 116
                	result.concat(" ("+ status.getSymbol() + ")");
124 117
                }
125 118
            }
126
            
119

  
127 120
           fireStateChanged(distributionForColumn);
128 121
            return result;
129 122
        }
......
133 126
    protected void fireStateChanged(Distribution dist) {
134 127
    	if (dist!= null){
135 128
	    	ISelection selection = new StructuredSelection(dist);
136
	    	selService.setSelection(selection);
129
//	    	selService.setSelection(selection);
137 130
    	}
138 131
    }
139
    
132

  
140 133
    @Override
141 134
    protected void setValue(Object element, Object value) {
142 135
    	if (element instanceof Taxon && value instanceof PresenceAbsenceTerm) {
......
232 225
        return;
233 226
    }
234 227

  
235
	
228

  
236 229
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorHelper.java
1
// $Id$
2
/**
3
* Copyright (C) 2017 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.editor.view.checklist.e4;
11

  
12
import java.util.Set;
13

  
14
import org.eclipse.jface.viewers.SelectionChangedEvent;
15
import org.eclipse.jface.viewers.StructuredSelection;
16
import org.eclipse.jface.viewers.TableViewer;
17
import org.eclipse.jface.viewers.TableViewerEditor;
18
import org.eclipse.jface.viewers.ViewerCell;
19
import org.eclipse.swt.widgets.TableColumn;
20

  
21
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
22
import eu.etaxonomy.cdm.model.description.Distribution;
23
import eu.etaxonomy.cdm.model.description.TaxonDescription;
24
import eu.etaxonomy.cdm.model.taxon.Taxon;
25
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
26

  
27
/**
28
 * @author k.luther
29
 * @date 28.09.2017
30
 *
31
 */
32
public class DistributionEditorHelper {
33

  
34
    public static SelectionChangedEvent getDistributionForColumn(SelectionChangedEvent event) {
35
        //      List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null,
36
        //      null, null, null, DESC_INIT_STRATEGY);
37
        TableViewer viewer = null;
38
        TableViewerEditor editor = null;
39
        Taxon taxon = null;
40
        int columnIndex;
41
        if (event.getSource() instanceof TableViewer){
42
            viewer = (TableViewer)event.getSource();
43
        } else {
44
            return null;
45
        }
46
        if (viewer.getColumnViewerEditor() instanceof TableViewerEditor){
47
            editor = (TableViewerEditor) viewer.getColumnViewerEditor();
48
        } else {
49
            return null;
50
        }
51
        ViewerCell cell = editor.getFocusCell();
52
        if (cell.getElement() instanceof Taxon){
53
            taxon =(Taxon)cell.getElement();
54
        } else {
55
            return null;
56
        }
57
        columnIndex = cell.getColumnIndex();
58
        Set<TaxonDescription> listTaxonDescriptions = taxon.getDescriptions();
59
        TableColumn column = viewer.getTable().getColumn(columnIndex);
60
        for (TaxonDescription td : listTaxonDescriptions) {
61
          for (DescriptionElementBase deb : td.getElements()) {
62
              if (deb instanceof Distribution) {
63
                  Distribution distribution = (Distribution) deb;
64
                  if (distribution.getArea() != null){
65
                      if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
66
                          if (column.getText().equalsIgnoreCase(distribution.getArea().getIdInVocabulary())) {
67
                              StructuredSelection selection = new StructuredSelection(distribution);
68
                              SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
69
                              return newEvent;
70
                          }
71
                      }else{
72
                          if (column.getText().equalsIgnoreCase(distribution.getArea().getTitleCache())) {
73
                              StructuredSelection selection = new StructuredSelection(distribution);
74
                              SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
75
                              return newEvent;
76
                          }
77
                      }
78
                  }
79
              }
80
          }
81
        }
82
        return null;
83
    }
84

  
85
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
96 96
                            TaxonRelationship rel = getEntity();
97 97
                            rel.setFromTaxon(taxon);
98 98
                            setEntity(rel);
99
                            //				        taxonBase.getTitleCache();
100
                            
99
                            setTaxonBase(taxon);
100
                           
101 101
                            firePropertyChangeEvent(TaxonRelationshipDetailSection.this);
102 102
	                    }
103 103
	                }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
42 42
import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
43 43
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
44 44
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
45
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
46
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonDetailElement;
47
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonDetailSection;
45 48
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
46 49

  
47 50
/**
......
112 115
	                    formSection instanceof TaxonomicScopeSection)) {
113 116
	        input = ((PolytomousKeyNode)input).getKey();
114 117
	    } else if ((input instanceof TaxonRelationship)
118
				&& (formSection instanceof TaxonDetailSection)) {
119
			((TaxonDetailSection) formSection)
120
					.setTaxon( ((TaxonRelationship)input).getFromTaxon());
121
			return true;
122
		}else if ((input instanceof TaxonRelationship)
115 123
				&& (formSection instanceof NonViralNameDetailSection)) {
116 124
			((NonViralNameDetailSection) formSection)
117 125
					.setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
14 14

  
15 15
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
16 16
import org.eclipse.jface.viewers.IStructuredSelection;
17
import org.eclipse.jface.viewers.SelectionChangedEvent;
17 18
import org.eclipse.swt.widgets.Composite;
18 19

  
19 20
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
......
78 79
                    return;
79 80
                }
80 81
            }
82
            if (structuredSelection.getFirstElement() instanceof SelectionChangedEvent){
83
                SelectionChangedEvent event = (SelectionChangedEvent)structuredSelection.getFirstElement();
84
                IStructuredSelection sel = (IStructuredSelection) event.getSelection();
85
//                TableViewer tableViewer = ((TableViewer)event.getSource());
86
//                ISelection sel = tableViewer.getSelection();
87
//                TableViewerEditor editor = (TableViewerEditor)tableViewer.getColumnViewerEditor();
88
//
89
//                ViewerCell cell = tableViewer.getColumnViewerEditor().getFocusCell();
90
//                Distribution dist = (Distribution)cell.getElement();
91
//                int columnIndex = cell.getColumnIndex();
92
                showViewer(sel, activePart, viewer);
93
                return;
94

  
95
            }
81 96
            showViewer(structuredSelection, activePart, viewer);
82 97
            return;
83 98
        }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
13 13
import java.util.Set;
14 14

  
15 15
import org.eclipse.jface.viewers.ISelection;
16
import org.eclipse.jface.viewers.IStructuredSelection;
16 17
import org.eclipse.jface.viewers.SelectionChangedEvent;
17 18
import org.eclipse.jface.viewers.TreeNode;
18 19
import org.eclipse.swt.SWT;
......
33 34
import eu.etaxonomy.cdm.model.description.CategoricalData;
34 35
import eu.etaxonomy.cdm.model.description.DescriptionBase;
35 36
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
37
import eu.etaxonomy.cdm.model.description.Distribution;
36 38
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
37 39
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
38 40
import eu.etaxonomy.cdm.model.media.Media;
......
319 321
            createTermVocabularySection(rootElement);
320 322
        } else if (input instanceof DefinedTermBase) {
321 323
            createDefinedTermSection(rootElement);
322
        }
323
        else {
324

  
325
        } else if (input instanceof SelectionChangedEvent ) {
326
            IStructuredSelection sel =(IStructuredSelection) ((SelectionChangedEvent)input).getSelection();
327
            if (sel.getFirstElement()instanceof Distribution){
328
                createDescriptionElementSection(rootElement);
329
            }
330

  
331
//            createDescriptionElementSection(rootElement);
332

  
333
        }else {
324 334
            createEmptySection(rootElement);
325 335
        }
326 336
        layout();
......
425 435
        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
426 436
                getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
427 437
                | ExpandableComposite.EXPANDED);
438

  
428 439
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
429 440

  
430 441
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
......
774 785

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

  
777
        // ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
788

  
778 789
        addPart(taxonRelationshipDetailSection);
779
        //addPart(referencedEntityBaseDetailSection);
780 790

  
781 791
        NonViralNameDetailSection nonViralNameSection = formFactory
782
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
792
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, false,
783 793
                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
784 794
        addPart(nonViralNameSection);
795

  
785 796
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
786
        //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
797

  
787 798
        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
788 799
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
789 800
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
790 801
        addPart(referenceDetailSection);
791 802

  
792
        //if ( !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS))){
803

  
793 804
        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
794
                ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
805
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
795 806
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
796 807
        addPart(nomenclaturalStatusSection);
797
        //}
798 808

  
799
        //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE))){
800
        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
801
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
802
        addPart(protologSection);
803
        //}
809
		ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
810
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
811
		addPart(protologSection);
804 812

  
805
        //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) &&  PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION))){
806
        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
807
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
808
        addPart(typeDesignationSection);
809
        //}
810

  
811
        //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP))){
812
        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
813
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
814
        addPart(nameRelationshipSection);
815
        //}
813
		TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
814
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
815
		addPart(typeDesignationSection);
816 816

  
817
		NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
818
		formFactory.createHorizontalSeparator(parent, SWT.BORDER);
819
		addPart(nameRelationshipSection);
817 820

  
818
        //}
819 821
    }
820 822

  
821 823
    private void createTaxonRelationshipSection(RootElement parent) {

Also available in: Unified diff