Project

General

Profile

« Previous | Next » 

Revision 695f0fab

Added by Patrick Plitzner over 3 years ago

Revert "Revert "ref #7849: move general db preferences to its own tab to avoid saving if not edited""

This reverts commit e78f3e6c944dd0630daef5ecfab96773a875c695.

View differences:

eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
188 188
page.name.40 = ABCD Import
189 189
page.name.41 = ABCD Import Provider
190 190
page.name.42 = Database Preferences
191
page.name.50 = General Database Preferences
191 192
page.name.43 = Nomenclatural Code
192 193
page.name.44 = Name Details View
193 194
extension-point.name = Cdm Viewer
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
188 188
page.name.40 = ABCD Import
189 189
page.name.41 = Biocase Provider
190 190
page.name.42 = Datenbank Pr?ferenzen
191
page.name.50 = Allgemeine Datenbank Pr?ferenzen
191 192
page.name.43 = Nomenklatorischer Code
192 193
page.name.44 = Detailsview f?r wissenschaftliche Namen
193 194
extension-point.name = Cdm Viewer
eu.etaxonomy.taxeditor.store/plugin.xml
591 591
         id="eu.etaxonomy.taxeditor.preferences.general"
592 592
         name="%page.name">
593 593
   </page>  -->
594
   <page
595
         category="eu.etaxonomy.taxeditor.preferences.general"
596
         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.GeneralAdminPreferencePage"
597
         id="eu.etaxonomy.taxeditor.preferences.generalPreferences"
598
         name="%page.name.50">
599
   </page>
594 600
   <page 
595 601
         category="eu.etaxonomy.taxeditor.preferences.general"
596 602
         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.DistributionAdminPreferences"
......
628 634
         name="%page.name.45">
629 635
   </page>
630 636
   <page
631
        
632
         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.GeneralAdminPreferencePage"
637
         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.EmptyAdminPreferencePage"
633 638
         id="eu.etaxonomy.taxeditor.preferences.general"
634 639
         name="%page.name.42">
635 640
   </page>
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java
9 9
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage;
10 10

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

  
15 19
import eu.etaxonomy.cdm.api.application.ICdmRepository;
16 20
import eu.etaxonomy.cdm.api.service.IPreferenceService;
17 21
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
22
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
18 23
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
24
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
25
import eu.etaxonomy.taxeditor.l10n.Messages;
19 26
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
20 27
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
28
import eu.etaxonomy.taxeditor.store.CdmStore;
21 29

  
22 30
/**
23 31
 * @author k.luther
......
41 49
        final Composite composite = new Composite(parent, SWT.NULL);
42 50

  
43 51

  
44
//        GridLayout gridLayout = new GridLayout();
45
//        composite.setLayout(gridLayout);
46
//        controller = CdmStore.getCurrentApplicationConfiguration();
47
//        if (controller != null){
48
//            IPreferenceService service = controller.getPreferenceService();
49
//            PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
50
//            CdmPreference isShowSpecimenPref = service.find(key);
51
//            if (isShowSpecimenPref != null){
52
//                this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
53
//            }
54
//
55
//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
56
//            CdmPreference isShowMediaViewPref = service.find(key);
57
//            if (isShowMediaViewPref != null){
58
//                this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
59
//            }
60
//
61
//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
62
//            CdmPreference isShowChecklistPref = service.find(key);
63
//            if (isShowChecklistPref != null){
64
//                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
65
//            }
66
//
67
//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
68
//            CdmPreference isShowTaxonNodeWizardPref = service.find(key);
69
//            if (isShowTaxonNodeWizardPref != null){
70
//                this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
71
//            }
72
//        }
73
//        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
74
//
75
//        showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
76
//
77
//        showIOMenuButton.setSelection(isShowIOMenu);
78
//        showIOMenuButton.addSelectionListener(new SelectionAdapter(){
79
//             @Override
80
//             public void widgetSelected(SelectionEvent e) {
81
//                 isShowIOMenu = showIOMenuButton.getSelection();
82
//
83
//              }
84
//         });
85
//
86
//        final Button showMediaViewButton = new Button(composite, SWT.CHECK);
87
//
88
//        showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
89
//
90
//        showMediaViewButton.setSelection(isShowMediaView);
91
//        showMediaViewButton.addSelectionListener(new SelectionAdapter(){
92
//             @Override
93
//             public void widgetSelected(SelectionEvent e) {
94
//                 isShowMediaView = showIOMenuButton.getSelection();
95
//
96
//              }
97
//         });
98
//        final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
99
//
100
//        showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
101
//
102
//        showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
103
//        showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
104
//             @Override
105
//             public void widgetSelected(SelectionEvent e) {
106
//                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
107
//
108
//              }
109
//         });
110
//
111
//        final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
112
//
113
//        showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
114
//
115
//        showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
116
//        showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
117
//             @Override
118
//             public void widgetSelected(SelectionEvent e) {
119
//                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
120
//
121
//              }
122
//         });
52
        GridLayout gridLayout = new GridLayout();
53
        composite.setLayout(gridLayout);
54
        controller = CdmStore.getCurrentApplicationConfiguration();
55
        if (controller != null){
56
            IPreferenceService service = controller.getPreferenceService();
57
            PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
58
            CdmPreference isShowSpecimenPref = service.find(key);
59
            if (isShowSpecimenPref != null){
60
                this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
61
            }
62

  
63
            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
64
            CdmPreference isShowMediaViewPref = service.find(key);
65
            if (isShowMediaViewPref != null){
66
                this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
67
            }
68

  
69
            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
70
            CdmPreference isShowChecklistPref = service.find(key);
71
            if (isShowChecklistPref != null){
72
                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
73
            }
74

  
75
            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
76
            CdmPreference isShowTaxonNodeWizardPref = service.find(key);
77
            if (isShowTaxonNodeWizardPref != null){
78
                this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
79
            }
80
        }
81
        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
82

  
83
        showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
84

  
85
        showIOMenuButton.setSelection(isShowIOMenu);
86
        showIOMenuButton.addSelectionListener(new SelectionAdapter(){
87
             @Override
88
             public void widgetSelected(SelectionEvent e) {
89
                 isShowIOMenu = showIOMenuButton.getSelection();
90

  
91
              }
92
         });
93

  
94
        final Button showMediaViewButton = new Button(composite, SWT.CHECK);
95

  
96
        showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
97

  
98
        showMediaViewButton.setSelection(isShowMediaView);
99
        showMediaViewButton.addSelectionListener(new SelectionAdapter(){
100
             @Override
101
             public void widgetSelected(SelectionEvent e) {
102
                 isShowMediaView = showIOMenuButton.getSelection();
103

  
104
              }
105
         });
106
        final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
107

  
108
        showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
109

  
110
        showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
111
        showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
112
             @Override
113
             public void widgetSelected(SelectionEvent e) {
114
                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
115

  
116
              }
117
         });
118

  
119
        final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
120

  
121
        showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
122

  
123
        showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
124
        showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
125
             @Override
126
             public void widgetSelected(SelectionEvent e) {
127
                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
128

  
129
              }
130
         });
123 131

  
124 132

  
125 133
        return composite;

Also available in: Unified diff