ref #6595 Fix selection propagation for name editor when entering text
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 9 Nov 2017 14:38:51 +0000 (15:38 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 9 Nov 2017 15:03:11 +0000 (16:03 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainerE4.java

index 11bea3694782165f9325e25e8861e7f9f44a0ea7..de28b99ab51a62ea6e454f8c56fb4810d20c59e9 100644 (file)
@@ -175,7 +175,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
                        public boolean setInput(Object input) {
                                if (input instanceof AbstractGroupedContainerE4) {
                                    TaxonBase newSelection = ((AbstractGroupedContainerE4) input).getData();
-                                   if(selection!=newSelection){
+                                   if(selection!=newSelection || TaxonNameEditorE4.this.isDirty()){
                                        selection = newSelection;
                                        selService.setSelection(new StructuredSelection(selection));
                                    }
index f1ca208c3085b2444cbdec5f4e241e0501cbc79a..097e1d08f784529c445ca48940db58ab97251aee 100755 (executable)
@@ -554,6 +554,8 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                }
        }
 
+       private boolean isExecuting = false;
+
        protected void setDelayedSelection() {
                // TODO this might be done better
                // this is the quickest solution i could come up with and it improves
@@ -568,9 +570,13 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                        @Override
             public void run() {
                                getEditor().getManagedForm().setInput(selection);
+                               isExecuting = false;
                        }
                };
-               display.timerExec(1000, runnable);
+               if(!isExecuting){
+                   isExecuting = true;
+                   display.timerExec(1000, runnable);
+               }
 
        }