fix #6974: set vocUUid at the beginning to the uuid of the preselected vocabulary
authorKatja Luther <k.luther@bgbm.org>
Tue, 7 Nov 2017 13:59:42 +0000 (14:59 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 7 Nov 2017 13:59:42 +0000 (14:59 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileAndChooseVocIdWizardPageE4.java

index b8d4178d29a16d2fd7603113123117c7cb7d0cfa..c59ef260bb6b78b4ef7230e909999e37d946884d 100755 (executable)
@@ -66,25 +66,36 @@ public class ImportFromFileAndChooseVocIdWizardPageE4 extends ImportFromFileData
         }
         getLabelAndValues(vocs);
         vocabularyCombo.select(0);
+        setVocUuidFromVocCombo();
         vocabularyCombo.addSelectionListener(new SelectionAdapter(){
 
             @Override
             public void widgetSelected(SelectionEvent e) {
                 String name = vocabularyCombo.getText();
-
-                for (String[] labelAndValue: labelAndValues){
-                    if (labelAndValue[0].equals(name)){
-                        String uuidString = labelAndValue[1];
-                        vocUuid = UUID.fromString(uuidString);
-                        setPageComplete(isPageComplete());
-                    }
+                setVocUuidFromVocCombo();
+                if (vocUuid != null){
+                    setPageComplete(isPageComplete());
                 }
-
             }
 
         });
     }
 
+    /**
+     * @return
+     */
+    private void setVocUuidFromVocCombo() {
+        String name = vocabularyCombo.getText();
+
+        for (String[] labelAndValue: labelAndValues){
+            if (labelAndValue[0].equals(name)){
+                String uuidString = labelAndValue[1];
+                vocUuid = UUID.fromString(uuidString);
+            }
+        }
+
+    }
+
     public UUID getVocUuid() {
         return vocUuid;
     }