ref #7362 Show info when searching with <4 letters
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / webimport / termimport / GfBioTerminologyImportPresenter.java
index db85cb89322c83d9f03793159df2bc1886b00865..71d814a5d228ac2673e162a8cd180b39a4bd3163 100644 (file)
@@ -176,9 +176,9 @@ public class GfBioTerminologyImportPresenter {
     }
 
     private void clearDetails(){
-        composite.getLblLabel().setText("");
-        composite.getLblUri().setText("");
-        composite.getLblDescription().setText("");
+        composite.getLblLabel().setText(""); //$NON-NLS-1$
+        composite.getLblUri().setText(""); //$NON-NLS-1$
+        composite.getLblDescription().setText(""); //$NON-NLS-1$
         composite.getListSynonyms().getList().removeAll();
     }
 
@@ -192,9 +192,9 @@ public class GfBioTerminologyImportPresenter {
             String label = wrapper.getLabel();
             String uri = wrapper.getUri();
             String description = wrapper.getDescription();
-            composite.getLblLabel().setText(label!=null?label:"");
-            composite.getLblUri().setText(uri!=null?uri:"");
-            composite.getLblDescription().setText(description!=null?description:"");
+            composite.getLblLabel().setText(label!=null?label:""); //$NON-NLS-1$
+            composite.getLblUri().setText(uri!=null?uri:""); //$NON-NLS-1$
+            composite.getLblDescription().setText(description!=null?description:""); //$NON-NLS-1$
             if(wrapper.getSynonyms()!=null){
                 if(wrapper.getSynonyms().isEmpty()){
                     composite.getListSynonyms().getList().removeAll();
@@ -219,7 +219,11 @@ public class GfBioTerminologyImportPresenter {
         if(searchString.equals(TXT_SEARCH_DEFAULT)){
             return;
         }
-        String terminology = "";
+        if(searchString.length()<4 && composite.getComboTerminologies().getSelection().isEmpty()){
+            MessagingUtils.informationDialog(Messages.GfBioTerminologyImportPresenter_SEARCH_TOO_SHORT_TITLE, Messages.GfBioTerminologyImportPresenter_SEARCH_TOO_SHORT_MESSAGE);
+            return;
+        }
+        String terminology = ""; //$NON-NLS-1$
         ISelection selection = composite.getComboTerminologies().getSelection();
         Collection<OntologyTermWrapper> wrapperList = new ArrayList<>();
         if(selection instanceof IStructuredSelection && !selection.isEmpty()){