ref #8694: layout issues in specimen import view
authorKatja Luther <k.luther@bgbm.org>
Tue, 19 Nov 2019 13:12:54 +0000 (14:12 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 19 Nov 2019 13:13:53 +0000 (14:13 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SaveImportedSpecimenActionE4.java

index 52754b4e6ff1bd5b729f4754204b5f5750216088..66b260a7d726e3fff46cfc27ec380ea962589f20 100644 (file)
@@ -302,11 +302,11 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
             gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
             labelRef.setLayoutData(gridDataUnitId);
             labelRef.setText("Biocase provider for associated DNA");
-            GridDataFactory.fillDefaults().applyTo(labelRef);
+            GridDataFactory.fillDefaults();
 
             textDNAProviderString = new Combo(composite, SWT.BORDER);
             textDNAProviderString.setLayoutData(gridDataUnitId);
-            GridDataFactory.fillDefaults().applyTo(textDNAProviderString);
+            GridDataFactory.fillDefaults();
             textDNAProviderString.add("Do not search for DNA");
 
             String allProviderString = PreferencesUtil.getStringValue(PreferencePredicate.BioCaseProvider.getKey(), false);
@@ -337,7 +337,7 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
         gridData.horizontalAlignment=SWT.BEGINNING;
 
         labelCode.setLayoutData(gridData);
-        GridDataFactory.fillDefaults().applyTo(labelCode);
+        GridDataFactory.fillDefaults();
         nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
         gridData = new GridData();
         gridData.horizontalAlignment=SWT.BEGINNING;
index ecdeb79d34f48e1e01c88a156b0db1c413bd848b..704e1aea5862756ff1725c9cf5743e8fda96f07e 100644 (file)
@@ -81,7 +81,8 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
     private Text textReferenceString;
 
-    private Button toggleButton;
+    private Button selectAllButton;
+    //private Button selectNoneButton;
 
     private Button importButton;
 
@@ -194,6 +195,7 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
         table = checkboxTableViewer.getTable();
         table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        table.addListener(SWT.Selection, this);
         toolkit.paintBordersFor(table);
 
         composite_3 = new Composite(composite_2, SWT.NONE);
@@ -202,16 +204,17 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
         toolkit.paintBordersFor(composite_3);
         composite_3.setLayout(new GridLayout(1, false));
         //toggle button
-        toggleButton = new Button(composite_3, SWT.PUSH);
-        toggleButton.setText("Toggle");
+        selectAllButton = new Button(composite_3, SWT.PUSH);
+        selectAllButton.setText("Select all/none");
         new Label(composite_2, SWT.NONE);
 
-        Composite composite_4 = new Composite(composite_2, SWT.NONE);
-        composite_4.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
-        toolkit.adapt(composite_4);
-        toolkit.paintBordersFor(composite_4);
+//        Composite composite_4 = new Composite(composite_2, SWT.NONE);
+//        composite_4.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
+//        composite_4.setBackground(composite.getBackground());
+//        toolkit.adapt(composite_4);
+//        toolkit.paintBordersFor(composite_4);
 
-        importButton = new Button(composite_4, SWT.PUSH);
+        importButton = new Button(composite_2, SWT.PUSH);
         importButton.setSize(48, 25);
         importButton.setText("Import");
         importButton.addSelectionListener(new SelectionAdapter(){
@@ -220,13 +223,13 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
                 saveImportedSpecimenAction.run();
             }
         });
-        new Label(composite_2, SWT.NONE);
-        new Label(composite_2, SWT.NONE);
-        new Label(composite_2, SWT.NONE);
-        new Label(composite_2, SWT.NONE);
-        new Label(composite_2, SWT.NONE);
-        new Label(composite_2, SWT.NONE);
-        toggleButton.addSelectionListener(new SelectionAdapter(){
+//        new Label(composite_2, SWT.NONE);
+//        new Label(composite_2, SWT.NONE);
+//        new Label(composite_2, SWT.NONE);
+//        new Label(composite_2, SWT.NONE);
+//        new Label(composite_2, SWT.NONE);
+//        new Label(composite_2, SWT.NONE);
+        selectAllButton.addSelectionListener(new SelectionAdapter(){
             @Override
             public void widgetSelected(SelectionEvent e) {
                 state = state ? false : true;
@@ -364,6 +367,16 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
                classification = null;
                textClassification.setText("");
            }
+
+           else {
+               if(event.widget == table){
+                   TableItem[] item = table.getSelection();
+                   if (item.length == 1){
+                       Object o = item[0].getData();
+                       System.err.println(o.toString());
+                   }
+               }
+           }
        }
 
     public String getReferenceString() {
index d41a35f40de90abcdf679dfdc23df3515a85a3ce..2da05656bdda5bf68f1332db62caea22c139dbd8 100644 (file)
@@ -107,6 +107,9 @@ public class SaveImportedSpecimenActionE4 extends Action {
                 }else{
                     configuratorAbcd = Abcd206ImportConfigurator.NewInstance(null, null);
                     PreferencesUtil.extractAbcdConfiguratorFromPreferenceString(configuratorAbcd, configString);
+                    if (configuratorAbcd.getNomenclaturalCode() == null){
+                        configuratorAbcd.setNomenclaturalCode(PreferencesUtil.getPreferredNomenclaturalCode());
+                    }
                 }
                 configuratorAbcd.setSourceUri(dataSetUri);