ref #4155: adaptions in setPublishForSubTree config wizard
authorKatja Luther <k.luther@bgbm.org>
Thu, 19 Oct 2017 12:05:20 +0000 (14:05 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 19 Oct 2017 12:05:20 +0000 (14:05 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java

index 4e2a73a958232195180269f55d58ba4bb8f2ffab..187bcdc81fccb8d5ce98476f44c87ac2247a965d 100644 (file)
@@ -303,6 +303,9 @@ public class Messages extends NLS {
     public static String ExcelTaxonUpdateWizard_ConfiguratorWizard_label;
 
 
+    public static String SetPublishConfiguration_Title;
+
+
 
 
 
index 3d50e39d62c1d22c8c2fcda247cdee798b880c35..5744db730224fc3a133eaf864a0eb4482ebe6191 100644 (file)
@@ -238,4 +238,6 @@ SetPublishConfiguration_IncludeSharedtaxa=Shared taxa
 SetPublishConfiguration_IncludeSynonyms=Synonyms
 
 ExcelSpecimenUpdateWizard_ConfiguratorWizard_label=Configuration of excel specimen import
-ExcelTaxonUpdateWizard_ConfiguratorWizard_label=Configuration of excel taxon import
\ No newline at end of file
+ExcelTaxonUpdateWizard_ConfiguratorWizard_label=Configuration of excel taxon import
+
+SetPublishConfiguration_Title=Configuration for setting the publish flag
\ No newline at end of file
index a8024865ce273a7cdb945fd5271497c1be55bb79..220da083ccc59b3d4ea0554421fb690483f63c7f 100644 (file)
@@ -239,4 +239,6 @@ SetPublishConfiguration_IncludeSharedtaxa=Mehrfach verwendete Taxa mit einbezieh
 SetPublishConfiguration_IncludeSynonyms=Synonyme
 
 ExcelSpecimenUpdateWizard_ConfiguratorWizard_label=Konfiguration des Excel Specimen Imports
-ExcelTaxonUpdateWizard_ConfiguratorWizard_label=Konfiguration des Excel Taxon Imports
\ No newline at end of file
+ExcelTaxonUpdateWizard_ConfiguratorWizard_label=Konfiguration des Excel Taxon Imports
+
+SetPublishConfiguration_Title=Konfiguration zum Setzen des Publish Flags
\ No newline at end of file
index 74a0f68399062b6bef8e6859493c71dcb493abe5..db6744282e02b37450323f3bf2a22afe9283e8bb 100755 (executable)
@@ -15,9 +15,12 @@ import org.eclipse.core.databinding.observable.value.IObservableValue;
 import org.eclipse.jface.databinding.swt.WidgetProperties;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
@@ -32,7 +35,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  * @date 10.10.2017
  *
  */
-public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements Listener {
+public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements Listener, SelectionListener {
 
     private DataBindingContext m_bindingContext;
 
@@ -43,7 +46,7 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
     private Button btnIncludeSynonyms;
     private Button btnIncludeSharedTaxa;
 
-    private Button btnPublish;
+    private Combo btnPublish;
 
 
     /**
@@ -52,6 +55,7 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
     public PublishSubTreeConfiguratorWizardPage(PublishForSubtreeConfigurator configurator) {
         super("Set Publish Flag Configuration");
         this.configurator = configurator;
+        this.setTitle(Messages.SetPublishConfiguration_Title);
         this.setDescription(Messages.SetPublishConfiguration_Description_Configurator);
 
     }
@@ -76,10 +80,17 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
         control.setLayout(gridLayoutControl);
         control.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
 
-        btnPublish = new Button(control, SWT.CHECK);
+        btnPublish = new Combo(control, SWT.BORDER| SWT.READ_ONLY);
         btnPublish.setText(Messages.SetPublishConfiguration_Publish);
         btnPublish.setToolTipText(Messages.SetPublishConfiguration_Publish_tooltip);
-        btnPublish.setSelection(configurator.isPublish());
+        btnPublish.add("publish", 0);
+        btnPublish.add("don't publish",1);
+        if (configurator.isPublish()){
+            btnPublish.select(0);
+        }else{
+            btnPublish.select(1);
+        }
+        btnPublish.addSelectionListener(this);
 
 
       //  Composite control = toolkit.createComposite(composite);
@@ -159,10 +170,36 @@ public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements
         IObservableValue includeSharedTaxaConfiguratorObserveValue = PojoProperties.value("includeSharedTaxa").observe(configurator);
         bindingContext.bindValue(observeSelectionBtnIncludeSharedTaxal, includeSharedTaxaConfiguratorObserveValue, null, null);
 
-        IObservableValue observeSelectionBtnPublish = WidgetProperties.selection().observe(btnPublish);
-        IObservableValue publishConfiguratorObserveValue = PojoProperties.value("publish").observe(configurator);
-        bindingContext.bindValue(observeSelectionBtnPublish, publishConfiguratorObserveValue, null, null);
+//        IObservableValue observeSelectionBtnPublish = WidgetProperties.selection().observe(btnPublish);
+//        IObservableValue publishConfiguratorObserveValue = PojoProperties.value("publish").observe(configurator);
+//        bindingContext.bindValue(observeSelectionBtnPublish, publishConfiguratorObserveValue, null, null);
         return bindingContext;
 
     }
+
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+     */
+    @Override
+    public void widgetSelected(SelectionEvent e) {
+        if (btnPublish.getSelectionIndex() > 0){
+            configurator.setPublish(false);
+        } else{
+            configurator.setPublish(true);
+        }
+
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+     */
+    @Override
+    public void widgetDefaultSelected(SelectionEvent e) {
+        // TODO Auto-generated method stub
+
+    }
 }