Revert "Revert "ref #7849: move general db preferences to its own tab to avoid saving...
authorPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 16 Nov 2018 11:47:50 +0000 (12:47 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 16 Nov 2018 11:47:50 +0000 (12:47 +0100)
This reverts commit e78f3e6c944dd0630daef5ecfab96773a875c695.

eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java

index fe1c5dee2b4e20cf76e5d3146163d5b978490a9f..ab9d0a71767f203037eb3804df34b09c907e9f8f 100644 (file)
@@ -188,6 +188,7 @@ page.name.21 = Distribution Editor
 page.name.40 = ABCD Import\r
 page.name.41 = ABCD Import Provider\r
 page.name.42 = Database Preferences\r
+page.name.50 = General Database Preferences\r
 page.name.43 = Nomenclatural Code\r
 page.name.44 = Name Details View\r
 extension-point.name = Cdm Viewer\r
index b6deb15625ed63e424aa1526d1829e02be3646e0..de229283cc7324da08ae61c922516074c50f76f3 100644 (file)
@@ -188,6 +188,7 @@ page.name.21 = Verbreitungs-Editor
 page.name.40 = ABCD Import
 page.name.41 = Biocase Provider
 page.name.42 = Datenbank Präferenzen
+page.name.50 = Allgemeine Datenbank Präferenzen
 page.name.43 = Nomenklatorischer Code
 page.name.44 = Detailsview für wissenschaftliche Namen
 extension-point.name = Cdm Viewer
index 6d831eb2f94092291b4726f807ff48801009a580..f5cd3fe511bf0b13da51b3011c64067a14cb9f76 100755 (executable)
          id="eu.etaxonomy.taxeditor.preferences.general"
          name="%page.name">
    </page>  -->
+   <page
+         category="eu.etaxonomy.taxeditor.preferences.general"
+         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.GeneralAdminPreferencePage"
+         id="eu.etaxonomy.taxeditor.preferences.generalPreferences"
+         name="%page.name.50">
+   </page>
    <page 
          category="eu.etaxonomy.taxeditor.preferences.general"
          class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.DistributionAdminPreferences"
          name="%page.name.45">
    </page>
    <page
-        
-         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.GeneralAdminPreferencePage"
+         class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.EmptyAdminPreferencePage"
          id="eu.etaxonomy.taxeditor.preferences.general"
          name="%page.name.42">
    </page>
index 239a37cbb17510747870afe0cb8ddd943271a8cf..c08fcdc3753bfef7124a835e6553d8ea8f0aaf84 100755 (executable)
@@ -9,15 +9,23 @@
 package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.IPreferenceService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
+import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author k.luther
@@ -41,85 +49,85 @@ public class GeneralAdminPreferencePage extends CdmPreferencePage implements IE4
         final Composite composite = new Composite(parent, SWT.NULL);
 
 
-//        GridLayout gridLayout = new GridLayout();
-//        composite.setLayout(gridLayout);
-//        controller = CdmStore.getCurrentApplicationConfiguration();
-//        if (controller != null){
-//            IPreferenceService service = controller.getPreferenceService();
-//            PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
-//            CdmPreference isShowSpecimenPref = service.find(key);
-//            if (isShowSpecimenPref != null){
-//                this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
-//            }
-//
-//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
-//            CdmPreference isShowMediaViewPref = service.find(key);
-//            if (isShowMediaViewPref != null){
-//                this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
-//            }
-//
-//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
-//            CdmPreference isShowChecklistPref = service.find(key);
-//            if (isShowChecklistPref != null){
-//                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
-//            }
-//
-//            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
-//            CdmPreference isShowTaxonNodeWizardPref = service.find(key);
-//            if (isShowTaxonNodeWizardPref != null){
-//                this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
-//            }
-//        }
-//        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
-//
-//        showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
-//
-//        showIOMenuButton.setSelection(isShowIOMenu);
-//        showIOMenuButton.addSelectionListener(new SelectionAdapter(){
-//             @Override
-//             public void widgetSelected(SelectionEvent e) {
-//                 isShowIOMenu = showIOMenuButton.getSelection();
-//
-//              }
-//         });
-//
-//        final Button showMediaViewButton = new Button(composite, SWT.CHECK);
-//
-//        showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
-//
-//        showMediaViewButton.setSelection(isShowMediaView);
-//        showMediaViewButton.addSelectionListener(new SelectionAdapter(){
-//             @Override
-//             public void widgetSelected(SelectionEvent e) {
-//                 isShowMediaView = showIOMenuButton.getSelection();
-//
-//              }
-//         });
-//        final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
-//
-//        showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
-//
-//        showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
-//        showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
-//             @Override
-//             public void widgetSelected(SelectionEvent e) {
-//                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
-//
-//              }
-//         });
-//
-//        final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
-//
-//        showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
-//
-//        showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
-//        showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
-//             @Override
-//             public void widgetSelected(SelectionEvent e) {
-//                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
-//
-//              }
-//         });
+        GridLayout gridLayout = new GridLayout();
+        composite.setLayout(gridLayout);
+        controller = CdmStore.getCurrentApplicationConfiguration();
+        if (controller != null){
+            IPreferenceService service = controller.getPreferenceService();
+            PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
+            CdmPreference isShowSpecimenPref = service.find(key);
+            if (isShowSpecimenPref != null){
+                this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
+            }
+
+            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
+            CdmPreference isShowMediaViewPref = service.find(key);
+            if (isShowMediaViewPref != null){
+                this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
+            }
+
+            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
+            CdmPreference isShowChecklistPref = service.find(key);
+            if (isShowChecklistPref != null){
+                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
+            }
+
+            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
+            CdmPreference isShowTaxonNodeWizardPref = service.find(key);
+            if (isShowTaxonNodeWizardPref != null){
+                this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
+            }
+        }
+        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
+
+        showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
+
+        showIOMenuButton.setSelection(isShowIOMenu);
+        showIOMenuButton.addSelectionListener(new SelectionAdapter(){
+             @Override
+             public void widgetSelected(SelectionEvent e) {
+                 isShowIOMenu = showIOMenuButton.getSelection();
+
+              }
+         });
+
+        final Button showMediaViewButton = new Button(composite, SWT.CHECK);
+
+        showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
+
+        showMediaViewButton.setSelection(isShowMediaView);
+        showMediaViewButton.addSelectionListener(new SelectionAdapter(){
+             @Override
+             public void widgetSelected(SelectionEvent e) {
+                 isShowMediaView = showIOMenuButton.getSelection();
+
+              }
+         });
+        final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
+
+        showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
+
+        showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
+        showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
+             @Override
+             public void widgetSelected(SelectionEvent e) {
+                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
+
+              }
+         });
+
+        final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
+
+        showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
+
+        showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
+        showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
+             @Override
+             public void widgetSelected(SelectionEvent e) {
+                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
+
+              }
+         });
 
 
         return composite;