widget is disposed exception ticket (#4657)
authorKatja Luther <k.luther@bgbm.org>
Tue, 28 Apr 2015 10:56:17 +0000 (10:56 +0000)
committerKatja Luther <k.luther@bgbm.org>
Tue, 28 Apr 2015 10:56:17 +0000 (10:56 +0000)
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/LineBreakListener.java

index f02297f4b69c6eddb79350405e44ec297ed3dcf0..cf565a622d91bb255e188cfed04337e2c97c11a3 100644 (file)
@@ -104,7 +104,7 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                        //        leading to a recursive infinite loop of :
                        //        initial exception thrown -> status handling -> dialog opening + logging of status ->
                        //        status handling -> dialog opening + logging of status ... and so on
-                       if(t != null && t instanceof RuntimeException && ! "Widget is disposed".equals(t.getMessage())){
+                       if(t != null && t instanceof RuntimeException{
                                MessagingUtils.errorDialog("Unexpected error",
                                                null,
                                                MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
index 603473942a74f86cd57698b8b39e5d8d2d40a16b..2806b80be20024832f40c6bbb8e363dcbde24a01 100644 (file)
@@ -28,6 +28,7 @@ import org.eclipse.swt.events.ControlListener;
 import org.eclipse.swt.events.FocusAdapter;
 import org.eclipse.swt.events.FocusEvent;
 import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.MouseAdapter;
@@ -1121,9 +1122,22 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                        public void handleSplitText(String text) {
                                AbstractGroupedContainer.this.handleSplitText(text);
                        }
+
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                };
 
                getNameViewer().getTextWidget().addVerifyListener(lineBreakListener);
+               getNameViewer().getTextWidget().addKeyListener(lineBreakListener);
        }
 
        abstract class LabelEllipsisListener extends ControlAdapter {
index cae8f6fce36694952c2688588239b9995b572038..8ef88c0b16bafc6beaec110eb18c08e253a7a6ad 100644 (file)
@@ -14,6 +14,7 @@ import java.util.Collection;
 import java.util.Scanner;
 
 import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.VerifyEvent;
 import org.eclipse.swt.events.VerifyListener;
 
@@ -43,7 +44,7 @@ import org.eclipse.swt.events.VerifyListener;
  * @created 19.05.2008
  * @version 1.0
  */
-public abstract class LineBreakListener implements VerifyListener{
+public abstract class LineBreakListener implements VerifyListener, KeyListener {
 
        private static String LINE_BREAK = System.getProperty("line.separator");