ref #7849 Always show override checkbox in name details admin prefs
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 24 Oct 2018 13:20:31 +0000 (15:20 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 24 Oct 2018 13:20:31 +0000 (15:20 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewConfiguration.java

index bed43ad76dfb2263940dc713753fe4f82efe6876..0530efed7a8c1d2ba929d6bfc915140b57d04db0 100755 (executable)
@@ -28,7 +28,6 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements I
 
     boolean isSimpleDetailsViewActivated;
 
-    Composite dbSettings ;
     boolean isAllowOverride;
     boolean isShowTaxon;
     boolean isSecDetailsActivated;
@@ -48,7 +47,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements I
     boolean isShowNameRelationship;
     boolean isShowHybrid;
     boolean isShowNameApprobiation;
-    NameDetailsConfigurator nameDetailsConfig = null;
+    private NameDetailsConfigurator nameDetailsConfig = null;
 
     @Override
     protected Control createContents(Composite parent) {
@@ -58,7 +57,11 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements I
         if (nameDetailsConfig == null){
             nameDetailsConfig = new NameDetailsConfigurator(false);
         }
+
         final Button activateCheckButton = new Button(parent, SWT.CHECK);
+        final Button allowLocalPreference = new Button(parent, SWT.CHECK);
+        Composite dbSettings  = new Composite(parent, SWT.NONE);
+
         activateCheckButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
         activateCheckButton.setText(Messages.NameDetailsViewConfiguration_activateSimpleDetailsView);
         isSimpleDetailsViewActivated = nameDetailsConfig.isSimpleDetailsViewActivated();
@@ -79,8 +82,18 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements I
          });
 
 
+//      boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
+        allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
+        isAllowOverride = nameDetailsConfig.isAllowOverride();
+        allowLocalPreference.setSelection(isAllowOverride);
+        allowLocalPreference.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                isAllowOverride = allowLocalPreference.getSelection();
+
+            }
+        });
 
-        dbSettings  = new Composite(parent, SWT.NONE);
         dbSettings.setLayout(new GridLayout());
         dbSettings.setVisible(isSimpleDetailsViewActivated);
 //       Table table = new Table(dbSettings,SWT.BORDER | SWT.CHECK);
@@ -89,19 +102,6 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements I
 //       TableColumn tableColumnAllowOverride = new TableColumn(table, SWT.CENTER);
 
 
-
-        final Button allowLocalPreference = new Button(dbSettings, SWT.CHECK);
-//      boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
-        allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
-        isAllowOverride = nameDetailsConfig.isAllowOverride();
-        allowLocalPreference.setSelection(isAllowOverride);
-        allowLocalPreference.addSelectionListener(new SelectionAdapter(){
-           @Override
-           public void widgetSelected(SelectionEvent e) {
-               isAllowOverride = allowLocalPreference.getSelection();
-
-            }
-        });
         Label separator= new Label(dbSettings, SWT.HORIZONTAL | SWT.SEPARATOR);
         separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
         final Button showTaxon = new Button(dbSettings, SWT.CHECK);