commit c03d27b908dc9c9da26a182fc7fb62b6f9588d99
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon Aug 12 10:46:46 2019 +0200

    ref #8447: move shared taxa and disable if not needed

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java
index 119e02eed..63491bc46 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java
@@ -24,6 +24,7 @@ import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 
 import eu.etaxonomy.cdm.api.service.config.PublishForSubtreeConfigurator;
@@ -95,109 +96,29 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
         }
         btnPublish.addSelectionListener(this);
 
-
-      //  Composite control = toolkit.createComposite(composite);
         btnIncludeAcceptedTaxa = new Button(control, SWT.CHECK);
         btnIncludeAcceptedTaxa.setText(Messages.SetPublishConfiguration_IncludeAcceptedTaxa);
-//        btnIncludeAcceptedTaxa.setSelection(configurator.isIncludeAcceptedTaxa());
-//        btnIncludeAcceptedTaxa.addListener(SWT.Selection, new Listener() {
-//            @Override
-//         public void handleEvent(Event e) {
-//                Button b = (Button) e.widget;
-//                GridData data = (GridData)  btnIncludeAcceptedTaxa.getLayoutData();
-//                data.exclude = b.getSelection();
-//
-//                btnIncludeSharedTaxa.setVisible(data.exclude);
-//                if (!btnIncludeSynonyms.getSelection() && !data.exclude && !btnIncludeHybrids.getSelection() && !btnIncludeMisappliedNames.getSelection() && !btnIncludeProParteSynonyms.getSelection()){
-//                   setPageComplete(false);
-//                }else{
-//                   setPageComplete(true);
-//                }
-//            }
-//        });
-
-
-        btnIncludeSharedTaxa = new Button(control, SWT.CHECK);
-        GridData gd_btnIncludeSharedTaxa = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
-        gd_btnIncludeSharedTaxa.horizontalIndent = 10;
-        btnIncludeSharedTaxa.setLayoutData(gd_btnIncludeSharedTaxa);
-        btnIncludeSharedTaxa.setText(Messages.SetPublishConfiguration_IncludeSharedtaxa);
-        btnIncludeSharedTaxa.setSelection(configurator.isIncludeSharedTaxa());
+        btnIncludeAcceptedTaxa.addSelectionListener(this);
 
         btnIncludeMisappliedNames = new Button(control, SWT.CHECK);
         btnIncludeMisappliedNames.setText(Messages.SetPublishConfiguration_IncludeMisappliedNames);
-//        btnIncludeMisappliedNames.setSelection(configurator.isIncludeMisapplications());
-//        btnIncludeMisappliedNames.addListener(SWT.Selection, new Listener() {
-//            @Override
-//         public void handleEvent(Event e) {
-//                Button b = (Button) e.widget;
-//                GridData data = (GridData)  btnIncludeMisappliedNames.getLayoutData();
-//                data.exclude = b.getSelection();
-//
-//                if (!btnIncludeSynonyms.getSelection() && !data.exclude && !btnIncludeAcceptedTaxa.getSelection() && !btnIncludeProParteSynonyms.getSelection() && !btnIncludeHybrids.getSelection()){
-//                   setPageComplete(false);
-//                }else{
-//                   setPageComplete(true);
-//                }
-//            }
-//        });
-
+        btnIncludeMisappliedNames.addSelectionListener(this);
 
         btnIncludeProParteSynonyms = new Button(control, SWT.CHECK);
         btnIncludeProParteSynonyms.setText(Messages.SetPublishConfiguration_IncludeProParteSynonyms);
-//        btnIncludeProParteSynonyms.setSelection(configurator.isIncludeProParteSynonyms());
-//        btnIncludeProParteSynonyms.addListener(SWT.Selection, new Listener() {
-//            @Override
-//         public void handleEvent(Event e) {
-//                Button b = (Button) e.widget;
-//                GridData data = (GridData)  btnIncludeProParteSynonyms.getLayoutData();
-//                data.exclude = b.getSelection();
-//
-//                if (!btnIncludeSynonyms.getSelection() && !data.exclude && !btnIncludeAcceptedTaxa.getSelection() && !btnIncludeMisappliedNames.getSelection() && !btnIncludeHybrids.getSelection()){
-//                   setPageComplete(false);
-//                }else{
-//                   setPageComplete(true);
-//                }
-//            }
-//        });
+        btnIncludeProParteSynonyms.addSelectionListener(this);
 
         btnIncludeHybrids = new Button(control, SWT.CHECK);
         btnIncludeHybrids.setText(Messages.SetPublishConfiguration_IncludeHybrids);
-//        btnIncludeHybrids.setSelection(configurator.isIncludeHybrids());
-//        btnIncludeHybrids.addListener(SWT.Selection, new Listener() {
-//            @Override
-//         public void handleEvent(Event e) {
-//                Button b = (Button) e.widget;
-//                GridData data = (GridData)  btnIncludeHybrids.getLayoutData();
-//                data.exclude = b.getSelection();
-//
-//                if (!btnIncludeSynonyms.getSelection() && !data.exclude && !btnIncludeAcceptedTaxa.getSelection() && !btnIncludeMisappliedNames.getSelection() && !btnIncludeProParteSynonyms.getSelection()){
-//                   setPageComplete(false);
-//                }else{
-//                   setPageComplete(true);
-//                }
-//            }
-//        });
+        btnIncludeHybrids.addSelectionListener(this);
 
         btnIncludeSynonyms = new Button(control, SWT.CHECK);
         btnIncludeSynonyms.setText(Messages.SetPublishConfiguration_IncludeSynonyms);
-//        btnIncludeSynonyms.setSelection(configurator.isIncludeSynonyms());
-//        btnIncludeSynonyms.addListener(SWT.Selection, new Listener() {
-//            @Override
-//         public void handleEvent(Event e) {
-//                Button b = (Button) e.widget;
-//                GridData data = (GridData)  btnIncludeSynonyms.getLayoutData();
-//                data.exclude = b.getSelection();
-//
-//                if (!btnIncludeAcceptedTaxa.getSelection() && !data.exclude && !btnIncludeHybrids.getSelection() && !btnIncludeMisappliedNames.getSelection() && !btnIncludeProParteSynonyms.getSelection()){
-//                   setPageComplete(false);
-//                }else{
-//                   setPageComplete(true);
-//                }
-//
-//            }
-//        });
 
+        Label space = new Label(control, SWT.NONE);
+
+        btnIncludeSharedTaxa = new Button(control, SWT.CHECK);
+        btnIncludeSharedTaxa.setText(Messages.SetPublishConfiguration_IncludeSharedtaxa);
 
         m_bindingContext = initDataBindings();
 
@@ -265,7 +186,12 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
         } else{
             configurator.setPublish(true);
         }
+        if (!btnIncludeMisappliedNames.getSelection() && !btnIncludeAcceptedTaxa.getSelection() && !btnIncludeProParteSynonyms.getSelection() ){
+            btnIncludeSharedTaxa.setEnabled(false);
+        }else{
+            btnIncludeSharedTaxa.setEnabled(true);
 
+        }
     }
 
 
