Project

General

Profile

« Previous | Next » 

Revision 321b9521

Added by Katja Luther over 5 years ago

ref #7793: fix problem with details view after save in distribution editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
22 22
import org.eclipse.jface.preference.IPreferenceStore;
23 23
import org.eclipse.jface.viewers.ITableLabelProvider;
24 24
import org.eclipse.jface.viewers.LabelProvider;
25
import org.eclipse.jface.viewers.TableViewer;
26 25
import org.eclipse.swt.graphics.Image;
27
import org.eclipse.swt.widgets.TableColumn;
28 26

  
29 27
import eu.etaxonomy.cdm.api.service.IDescriptionService;
30 28
import eu.etaxonomy.cdm.api.service.IVocabularyService;
......
42 40
import eu.etaxonomy.cdm.model.description.TaxonDescription;
43 41
import eu.etaxonomy.cdm.model.name.TaxonName;
44 42
import eu.etaxonomy.cdm.model.taxon.Taxon;
43
import eu.etaxonomy.taxeditor.editor.view.checklist.e4.ChecklistEditorE4;
45 44
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
46 45
import eu.etaxonomy.taxeditor.store.CdmStore;
47 46

  
......
55 54
    public static final String DEFAULT_ENTRY = ""; //$NON-NLS-1$
56 55
    private IDescriptionService descriptionService;
57 56
    private SortedSet<DefinedTermBase> namedAreas;
58
    TableViewer viewer = null;
57
    private ChecklistEditorE4 editor= null;
59 58

  
60 59
    /**
61 60
     *
......
64 63
        namedAreas = loadNamedAreas();
65 64
    }
66 65

  
67
    public ChecklistLabelProvider(TableViewer viewer) {
66
    public ChecklistLabelProvider(ChecklistEditorE4 editor) {
68 67
        namedAreas = loadNamedAreas();
69
        this.viewer = viewer;
68
        this.editor = editor;
70 69
    }
71 70

  
72 71
    /*
......
128 127
            for (TaxonDescription td : listTaxonDescriptions) {
129 128
                for (DescriptionElementBase deb : td.getElements()) {
130 129
                    if (deb instanceof Distribution) {
131
                        Distribution distribution = HibernateProxyHelper.deproxy(deb, Distribution.class);
132
                        String area = null;
133
                        if (distribution.getArea() != null ){
134
                            if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
135
                                if (distribution.getArea().getIdInVocabulary() != null){
136
                                    area = distribution.getArea().getIdInVocabulary();
137
                                } else{
138
                                    area = distribution.getArea().getTitleCache();
139
                                }
140
                            }else{
141
                                area = distribution.getArea().getTitleCache();
142
                            }
143 130

  
144
                        }else{
145
                            continue;
146
                        }
147 131

  
148
                        if(viewer != null){
149
                        	TableColumn column = viewer.getTable().getColumn(columnIndex);
150
                        	if (area.equalsIgnoreCase(column.getText())) {
151
                        	    if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
152
                        	        return (distribution.getStatus().getIdInVocabulary() != null)?distribution.getStatus().getIdInVocabulary():CdmUtils.Nz(distribution.getStatus().getTitleCache());
153
                        	    }else{
154
                        	        return (distribution.getStatus().getTitleCache() != null)?distribution.getStatus().getTitleCache():DEFAULT_ENTRY;
155
                        	    }
132
                        Distribution distribution = HibernateProxyHelper.deproxy(deb, Distribution.class);
133
                        if (distribution.getArea() != null){
134
                            if ( editor.getAreaPosition().get(distribution.getArea().getUuid()) != null && columnIndex == editor.getAreaPosition().get(distribution.getArea().getUuid())){
135
                                if (PreferencesUtil.isShowSymbolInChecklistEditor()){
136
                                    return (distribution.getStatus().getSymbol() != null)?distribution.getStatus().getSymbol():CdmUtils.Nz(distribution.getStatus().getTitleCache());
137
                                }else{
138
                                    return (distribution.getStatus().getTitleCache() != null)?distribution.getStatus().getTitleCache():DEFAULT_ENTRY;
139
                                }
156 140
                            }
157

  
158 141
                        }
142
//                        String area = null;
143
//                        if (distribution.getArea() != null ){
144
//                            if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
145
//                                if (distribution.getArea().getIdInVocabulary() != null){
146
//                                    area = distribution.getArea().getIdInVocabulary();
147
//                                } else{
148
//                                    area = distribution.getArea().getTitleCache();
149
//                                }
150
//                            }else{
151
//                                area = distribution.getArea().getTitleCache();
152
//                            }
153
//
154
//                        }else{
155
//                            continue;
156
//                        }
157
//
158
//                        if(editor.getViewer() != null){
159
//                        	TableColumn column = viewer.getTable().getColumn(columnIndex);
160
//                        	if (area.equalsIgnoreCase(column.getText())) {
161
//
162
//                            }
163
//
164
//                        }
159 165
                    }
160 166
                }
161 167
            }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
136 136
    private Label statusLabel;
137 137

  
138 138
    private ChecklistLabelProvider labelProvider;
139
//TODO: maybe it is better to use a hashMap for better handling of adding and removing terms??
139

  
140 140
    private Map<UUID, Integer> areaPosition= new HashMap();
141 141

  
142 142
    private ToolItem toolItem;
......
194 194

  
195 195

  
196 196

  
197
        labelProvider = new ChecklistLabelProvider(this.viewer);
197
        labelProvider = new ChecklistLabelProvider(this);
198 198
       // SortedSet<DefinedTermBase> termSet = labelProvider.getNamedAreas(true);
199 199
//        terms = new HashMap();
200 200
//        for (DefinedTermBase term : termSet){
......
406 406
                        } else{
407 407
                            titles.add(term.getTitleCache());
408 408
                        }
409
                    }else{
409
                    }else if (PreferencesUtil.isShowSymbol1InChecklistEditor()){
410
                        if (term.getSymbol() != null){
411
                            titles.add(term.getSymbol());
412
                        } else{
413
                            titles.add(term.getTitleCache());
414
                        }
415
                    }else if (PreferencesUtil.isShowSymbol2InChecklistEditor()){
416
                        if (term.getSymbol2() != null){
417
                            titles.add(term.getSymbol2());
418
                        } else{
419
                            titles.add(term.getTitleCache());
420
                        }
421
                    }{
410 422
                        titles.add(term.getTitleCache());
411 423
                    }
412 424
                    bounds.add(200);
......
722 734

  
723 735
    public void doSave(IProgressMonitor monitor) {
724 736
        try {
725
            monitor.beginTask(Messages.ChecklistEditor_SAVE_EDITOR, 1);
726
            if (!conversation.isBound()) {
727
                conversation.bind();
728
            }
737
          //  monitor.beginTask(Messages.ChecklistEditor_SAVE_EDITOR, 1);
738
//            if (!conversation.isBound()) {
739
//                conversation.bind();
740
//            }
729 741

  
730 742
            this.checklistEditorInput.merge();
731 743

  
732
            conversation.commit(true);
744
            //conversation.commit(true);
733 745
            setDirty(false);
734
            monitor.worked(1);
746
  //          monitor.worked(1);
735 747
        } finally {
736
            monitor.done();
748
   //         monitor.done();
737 749
        }
738 750

  
739 751
    }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorHelper.java
73 73
          for (DescriptionElementBase deb : td.getElements()) {
74 74
              if (deb instanceof Distribution) {
75 75
                  Distribution distribution = (Distribution) deb;
76
                  if (distribution.getArea().getUuid() == areaUuid){
76
                  if (distribution.getArea().getUuid().equals(areaUuid)){
77 77
                      return distribution;
78 78
                  }
79 79
              }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralPreference.java
9 9
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage;
10 10

  
11 11
import org.eclipse.swt.SWT;
12
import org.eclipse.swt.custom.CLabel;
12 13
import org.eclipse.swt.events.SelectionAdapter;
13 14
import org.eclipse.swt.events.SelectionEvent;
14 15
import org.eclipse.swt.layout.GridLayout;
15 16
import org.eclipse.swt.widgets.Button;
16 17
import org.eclipse.swt.widgets.Composite;
17 18
import org.eclipse.swt.widgets.Control;
19
import org.eclipse.swt.widgets.Label;
18 20

  
19 21
import eu.etaxonomy.cdm.api.application.ICdmRepository;
20 22
import eu.etaxonomy.cdm.api.service.IPreferenceService;
......
39 41
    boolean isSortByVocabularyOrder;
40 42
    boolean isShowSymbol;
41 43
    boolean isShowIdInVocabulary;
44
    boolean isShowSymbol1;
45
    boolean isShowSymbol2;
46
    boolean isShowTitle;
47
    String displayString;
42 48
    Composite child ;
43 49

  
44 50
    @Override
......
99 105
//        button_openWizard.setText(Messages.ChecklistEditorGeneralPreference_open_distribution_selection);
100 106

  
101 107
//        Table table = new Table
108
        final CLabel description = new CLabel(child, SWT.NULL);
109
        description.setText(Messages.ChecklistEditorGeneralPreference_Configure_display_of_Areas);
102 110

  
103
        final Button showIdInVocabulary = new Button(child, SWT.CHECK);
111
        final Button showIdInVocabulary = new Button(child, SWT.RADIO);
104 112
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowIdInVocabulary);
105 113
        if (pref != null){
106 114
            isShowIdInVocabulary = Boolean.valueOf(pref.getValue());
......
116 124

  
117 125
             }
118 126
        });
127
        final Button showSymbol1 = new Button(child, SWT.RADIO);
128
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSymbol1);
129
        if (pref != null){
130
            isShowSymbol1 = Boolean.valueOf(pref.getValue());
131
        }else{
132
            isShowSymbol1 = false;
133
        }
134
        showSymbol1.setText(Messages.ChecklistEditorGeneralPreference_show_symbol1);
135
        showSymbol1.setSelection(isShowSymbol1);
136
        showSymbol1.addSelectionListener(new SelectionAdapter(){
137
            @Override
138
            public void widgetSelected(SelectionEvent e) {
139
                isShowSymbol1 = showSymbol1.getSelection();
140

  
141
             }
142
        });
143
        final Button showSymbol2 = new Button(child, SWT.RADIO);
144
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSymbol2);
145
        if (pref != null){
146
            isShowSymbol2 = Boolean.valueOf(pref.getValue());
147
        }else{
148
            isShowSymbol2 = false;
149
        }
150
        showSymbol2.setText(Messages.ChecklistEditorGeneralPreference_show_symbol2);
151
        showSymbol2.setSelection(isShowSymbol2);
152
        showSymbol2.addSelectionListener(new SelectionAdapter(){
153
            @Override
154
            public void widgetSelected(SelectionEvent e) {
155
                isShowSymbol2 = showSymbol2.getSelection();
156

  
157
             }
158
        });
159
        final Button showTitle = new Button(child, SWT.RADIO);
160
        isShowTitle = !(isShowIdInVocabulary || isShowSymbol1 || isShowSymbol2);
161

  
162
        showTitle.setText(Messages.ChecklistEditorGeneralPreference_show_title);
163
        showTitle.setSelection(isShowTitle);
164
        showTitle.addSelectionListener(new SelectionAdapter(){
165
            @Override
166
            public void widgetSelected(SelectionEvent e) {
167
                isShowTitle = showTitle.getSelection();
168

  
169
             }
170
        });
119 171

  
172
        final Label seperator1 = new Label(child, SWT.HORIZONTAL | SWT.SEPARATOR);
173
        final Button sortNamedAreaByVocabularyOrder = new Button(child, SWT.CHECK);
174

  
175
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AreasSortedByIdInVocabulary);
176
        if (pref != null){
177
            isSortByVocabularyOrder = Boolean.valueOf(pref.getValue());
178
        }else{
179
            isSortByVocabularyOrder = false;
180
        }
181

  
182
        sortNamedAreaByVocabularyOrder.setText(Messages.ChecklistEditorGeneralPreference_sort_areas);
183
        sortNamedAreaByVocabularyOrder.setSelection(isSortByVocabularyOrder);
184
        sortNamedAreaByVocabularyOrder.addSelectionListener(new SelectionAdapter(){
185
            @Override
186
            public void widgetSelected(SelectionEvent e) {
187
                isSortByVocabularyOrder = sortNamedAreaByVocabularyOrder.getSelection();
188
             }
189
        });
190
        final Label seperator2 = new Label(child, SWT.HORIZONTAL | SWT.SEPARATOR);
191
        final CLabel descriptionStatus = new CLabel(child, SWT.NULL);
192
        descriptionStatus.setText("Configure how the status should be displayed");
120 193
        final Button showSymbol = new Button(child, SWT.CHECK);
121
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSymbol);
194
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSymbolForStatus);
122 195
        if (pref != null){
123 196
            isShowSymbol = Boolean.valueOf(pref.getValue());
124 197
        }else{
......
150 223
                isShowRank = activateRankButton.getSelection();
151 224
            }
152 225
        });
153
        final Button sortNamedAreaByVocabularyOrder = new Button(child, SWT.CHECK);
154 226

  
155
        pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AreasSortedByIdInVocabulary);
156
        if (pref != null){
157
            isSortByVocabularyOrder = Boolean.valueOf(pref.getValue());
158
        }else{
159
            isSortByVocabularyOrder = false;
160
        }
161

  
162
        sortNamedAreaByVocabularyOrder.setText(Messages.ChecklistEditorGeneralPreference_sort_areas);
163
        sortNamedAreaByVocabularyOrder.setSelection(isSortByVocabularyOrder);
164
        sortNamedAreaByVocabularyOrder.addSelectionListener(new SelectionAdapter(){
165
            @Override
166
            public void widgetSelected(SelectionEvent e) {
167
                isSortByVocabularyOrder = sortNamedAreaByVocabularyOrder.getSelection();
168
             }
169
        });
170 227

  
171 228
        if(isEditorActivated){
172 229
            child.setEnabled(true);
......
195 252
        pref.setAllowOverride(true);
196 253
        service.set(pref);
197 254

  
198
        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.ShowSymbol, Boolean.toString(isShowSymbol));
255
        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.ShowSymbol1, Boolean.toString(isShowSymbol1));
256
        //ToDo
257
        pref.setAllowOverride(true);
258
        service.set(pref);
259
        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.ShowSymbol2, Boolean.toString(isShowSymbol2));
260
        //ToDo
261
        pref.setAllowOverride(true);
262
        service.set(pref);
263

  
264

  
265
        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.ShowSymbolForStatus, Boolean.toString(isShowSymbol));
199 266
        //ToDo
200 267
        pref.setAllowOverride(true);
201 268
        service.set(pref);
......
213 280
        PreferencesUtil.setSortNamedAreasByOrderInVocabulary(isSortByVocabularyOrder);
214 281
        PreferencesUtil.setShowRankInChecklistEditor(isShowRank);
215 282
        PreferencesUtil.setShowSymbolInChecklistEditor(isShowSymbol);
216
        PreferencesUtil.setShowIdInVocabularyInChecklistEditor(isShowIdInVocabulary);
283

  
284
        if (isShowIdInVocabulary){
285
            displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_TITLE;
286
        }else if (isShowSymbol1){
287
            displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_SYMBOL1;
288
        }else if (isShowSymbol2){
289
            displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_SYMBOL2;
290
        }else{
291
            displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_TITLE;
292
        }
293
        PreferencesUtil.setShowIdInVocabularyInChecklistEditor(displayString);
294

  
217 295
        return true;
218 296
    }
219 297

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
451 451
    public static String DatabasePreferncesPage_Show_ChecklistPerspective;
452 452
    public static String DatabasePreferncesPage_Show_TaxonNodeWizard;
453 453

  
454

  
455
    public static String ChecklistEditorGeneralPreference_show_symbol1;
456
    public static String ChecklistEditorGeneralPreference_show_symbol2;
457
    public static String ChecklistEditorGeneralPreference_show_title;
458
    public static String ChecklistEditorGeneralPreference_Configure_display_of_Areas;
454 459
    static {
455 460
        // initialize resource bundle
456 461
        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
306 306
ChecklistEditorGeneralPreference_allowOverride=Allow override
307 307
ChecklistEditorGeneralPreference_open_distribution_selection=Open Distribution Selection Wizard
308 308
ChecklistEditorGeneralPreference_open_wizard=Please open the wizard below, in order to \nchoose the areas for the Distribution Editor
309
ChecklistEditorGeneralPreference_show_id_in_voc=Show Id in Vocabulary instead of full title of the areas
309
ChecklistEditorGeneralPreference_Configure_display_of_Areas=Configure how the areas should be displayed in the column header
310
ChecklistEditorGeneralPreference_show_id_in_voc=Id in Vocabulary
311
ChecklistEditorGeneralPreference_show_symbol1=Symbol
312
ChecklistEditorGeneralPreference_show_symbol2=Second Symbol
313
ChecklistEditorGeneralPreference_show_title=Complete Title
310 314
ChecklistEditorGeneralPreference_show_rank=Show Rank in Distribution Editor
311 315
ChecklistEditorGeneralPreference_show_symbol=Show Symbol of the Status, if existing
312 316
ChecklistEditorGeneralPreference_sort_areas=Sort Areas by Order in Vocabulary
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
305 305
ChecklistEditorGeneralPreference_allowOverride=Erlaube ?berschreiben
306 306
ChecklistEditorGeneralPreference_open_distribution_selection=Area Auswahl-Dialog
307 307
ChecklistEditorGeneralPreference_open_wizard=Bitte ?ffnen Sie den Auswahl-Dialog, um die \nAreas f?r den Verbreitungs-Editor auszuw?hlen
308
ChecklistEditorGeneralPreference_show_id_in_voc=F?r die Areas nur die Id im Vokabular anzeigen, anstatt des vollen Titels
309
ChecklistEditorGeneralPreference_show_rank=Rank anzeigen
308
ChecklistEditorGeneralPreference_Configure_display_of_Areas=Konfiguration, wie die Areas im Header der Tabelle dargestellt werden
309
ChecklistEditorGeneralPreference_show_id_in_voc=Id im Vokabular
310
ChecklistEditorGeneralPreference_show_symbol1=Symbol
311
ChecklistEditorGeneralPreference_show_symbol2=Zweites Symbol
312
ChecklistEditorGeneralPreference_show_title=Vollst?ndiger Titel
313
ChecklistEditorGeneralPreference_show_rank=Rang anzeigen
310 314
ChecklistEditorGeneralPreference_show_symbol=Symbol des Status anzeigen, wenn es existiert
311 315
ChecklistEditorGeneralPreference_sort_areas=Areas nach der Sortierung im Vokabular anzeigen
312 316
GfBioTerminologyImportPresenter_NO_CONNECTION_MESSAGE=Konnte keine Verbindung zum Webservice herstellen.
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
20 20

  
21 21
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
22 22
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
23
import eu.etaxonomy.taxeditor.l10n.Messages;
23 24
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
24 25
import eu.etaxonomy.taxeditor.store.CdmStore;
25 26
import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
......
37 38
    boolean isSortByVocabularyOrder;
38 39
    boolean isShowSymbol;
39 40
    boolean isShowIdInVocabulary;
41
    boolean isShowSymbol1;
42
    boolean isShowSymbol2;
43
    boolean isShowTitle;
40 44
    Composite child ;
41 45
    boolean isAllowOverride;
42 46

  
......
83 87
                    "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler");
84 88

  
85 89
            button_openFeatureTree.setText("Open Distribution Selection Wizard");
86
            final Button showIdInVocabulary = new Button(child, SWT.CHECK);
90

  
91
            final CLabel description = new CLabel(child, SWT.NULL);
92
            description.setText(Messages.ChecklistEditorGeneralPreference_Configure_display_of_Areas);
93

  
94
            final Button showIdInVocabulary = new Button(child, SWT.RADIO);
87 95
            isShowIdInVocabulary = PreferencesUtil.isShowIdInVocabularyInChecklistEditor();
88 96
            showIdInVocabulary.setText("Show Id in Vocabulary instead of full title of the areas");
89 97
            showIdInVocabulary.setSelection(isShowIdInVocabulary);
......
95 103
                 }
96 104
            });
97 105

  
106

  
107
            final Button showSymbol1 = new Button(child, SWT.RADIO);
108
            isShowSymbol1 = PreferencesUtil.isShowSymbol1InChecklistEditor();
109

  
110
            showSymbol1.setText(Messages.ChecklistEditorGeneralPreference_show_symbol1);
111
            showSymbol1.setSelection(isShowSymbol1);
112
            showSymbol1.addSelectionListener(new SelectionAdapter(){
113
                @Override
114
                public void widgetSelected(SelectionEvent e) {
115
                    isShowSymbol1 = showSymbol1.getSelection();
116

  
117
                 }
118
            });
119
            final Button showSymbol2 = new Button(child, SWT.RADIO);
120
            isShowSymbol2 = PreferencesUtil.isShowSymbol2InChecklistEditor();
121

  
122
            showSymbol2.setText(Messages.ChecklistEditorGeneralPreference_show_symbol2);
123
            showSymbol2.setSelection(isShowSymbol2);
124
            showSymbol2.addSelectionListener(new SelectionAdapter(){
125
                @Override
126
                public void widgetSelected(SelectionEvent e) {
127
                    isShowSymbol2 = showSymbol2.getSelection();
128

  
129
                 }
130
            });
131

  
132
            final Button showTitle = new Button(child, SWT.RADIO);
133
            isShowTitle = !(isShowIdInVocabulary || isShowSymbol1 || isShowSymbol2);
134

  
135
            showTitle.setText(Messages.ChecklistEditorGeneralPreference_show_title);
136
            showTitle.setSelection(isShowTitle);
137
            showTitle.addSelectionListener(new SelectionAdapter(){
138
                @Override
139
                public void widgetSelected(SelectionEvent e) {
140
                    isShowTitle = showTitle.getSelection();
141

  
142
                 }
143
            });
144

  
145

  
98 146
            final Button showSymbol = new Button(child, SWT.CHECK);
99 147
            isShowSymbol = PreferencesUtil.isShowSymbolInChecklistEditor();
100 148
            showSymbol.setText("Show Symbol of the Status, if existing");
......
148 196
            PreferencesUtil.setSortNamedAreasByOrderInVocabulary(isSortByVocabularyOrder);
149 197
            PreferencesUtil.setShowRankInChecklistEditor(isShowRank);
150 198
            PreferencesUtil.setShowSymbolInChecklistEditor(isShowSymbol);
151
            PreferencesUtil.setShowIdInVocabularyInChecklistEditor(isShowIdInVocabulary);
199
            String displayString;
200
            if (isShowIdInVocabulary){
201
                displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_TITLE;
202
            }else if (isShowSymbol1){
203
                displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_SYMBOL1;
204
            }else if (isShowSymbol2){
205
                displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_SYMBOL2;
206
            }else{
207
                displayString = IPreferenceKeys.CHECKLIST_AREA_DISPLAY_TITLE;
208
            }
209
            PreferencesUtil.setShowIdInVocabularyInChecklistEditor(displayString);
152 210
        }
153 211
        return true;
154 212
    }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
145 145
    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatus";
146 146
    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatusGrayed";
147 147
    public static final String DISTRIBUTION_VOCABULARIES = "eu.etaxonomy.taxeditor.checklist.distributionVocabularies";
148
    public static final String CHECKLIST_ID_IN_VOCABULARY = "eu.etaxonomy.taxeditor.checklist.checklistIdInVocabulary";
148
    public static final String CHECKLIST_AREA_DISPLAY = "eu.etaxonomy.taxeditor.checklist.checklistAreaDisplay";
149
    public static final String CHECKLIST_AREA_DISPLAY_ID_IN_VOCABULARY = "IdInVocabulary";
150
    public static final String CHECKLIST_AREA_DISPLAY_TITLE = "Title";
151
    public static final String CHECKLIST_AREA_DISPLAY_SYMBOL1 = "Symbol1";
152
    public static final String CHECKLIST_AREA_DISPLAY_SYMBOL2 = "Symbol2";
149 153
    public static final String CHECKLIST_SYMBOL = "eu.etaxonomy.taxeditor.checklist.checklistSymbol";
150 154
    public static final String CHECKLIST_SHOW_RANK = "eu.etaxonomy.taxeditor.checklist.checklistShowRank";
151 155

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
576 576
		getPreferenceStore().setDefault(OPENURL_IMAGE_MAX_HEIGHT, "1000");
577 577
		//Distribution Editor:
578 578
		getPreferenceStore().setDefault(DISTRIBUTION_AREA_PREFRENCES_ACTIVE, false);
579
		getPreferenceStore().setDefault(CHECKLIST_ID_IN_VOCABULARY, true);
579
		getPreferenceStore().setDefault(CHECKLIST_AREA_DISPLAY, CHECKLIST_AREA_DISPLAY_TITLE);
580 580
		getPreferenceStore().setDefault(CHECKLIST_SYMBOL, false);
581 581

  
582 582

  
......
1053 1053
     * @return
1054 1054
     */
1055 1055
    public static boolean isShowIdInVocabularyInChecklistEditor() {
1056
       return getPreferenceStore().getBoolean(IPreferenceKeys.CHECKLIST_ID_IN_VOCABULARY);
1056
        String area_display = getPreferenceStore().getString(IPreferenceKeys.CHECKLIST_AREA_DISPLAY);
1057
        if (area_display.equals(CHECKLIST_AREA_DISPLAY_ID_IN_VOCABULARY)) {
1058
            return true;
1059
        }else{
1060
            return false;
1061
        }
1057 1062
    }
1058
    public static void setShowIdInVocabularyInChecklistEditor(boolean selection) {
1059
        getPreferenceStore().setValue(CHECKLIST_ID_IN_VOCABULARY, selection);
1063
    public static boolean isShowSymbol1InChecklistEditor() {
1064
        String area_display = getPreferenceStore().getString(IPreferenceKeys.CHECKLIST_AREA_DISPLAY);
1065
        if (area_display.equals(CHECKLIST_AREA_DISPLAY_SYMBOL1)) {
1066
            return true;
1067
        }else{
1068
            return false;
1069
        }
1070
     }
1071
    public static boolean isShowSymbol2InChecklistEditor() {
1072
        String area_display = getPreferenceStore().getString(IPreferenceKeys.CHECKLIST_AREA_DISPLAY);
1073
        if (area_display.equals(CHECKLIST_AREA_DISPLAY_SYMBOL2)) {
1074
            return true;
1075
        }else{
1076
            return false;
1077
        }
1078
     }
1079
    public static void setShowIdInVocabularyInChecklistEditor(String selection) {
1080
        getPreferenceStore().setValue(CHECKLIST_AREA_DISPLAY, selection);
1060 1081
    }
1061 1082

  
1062 1083
    /**

Also available in: Unified diff