[hg] main-silver: #221710: Assure, that requestRepaint() is call...

  • From:
  • To:
  • Subject: [hg] main-silver: #221710: Assure, that requestRepaint() is call...
  • Date: Thu, 15 Nov 2012 02:38:09 -0800

changeset 85bbda62f240 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/85bbda62f240
description:
        #221710: Assure, that requestRepaint() is called in AWT.

diffstat:

 spi.debugger.ui/src/org/netbeans/spi/debugger/ui/MethodChooser.java |  25 
+++++++++-
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (50 lines):

diff --git 
a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/MethodChooser.java 
b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/MethodChooser.java
--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/MethodChooser.java
+++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/MethodChooser.java
@@ -244,7 +244,29 @@
             endLine = Utilities.getLineOffset((BaseDocument)doc, maxOffs) + 
1;
         } catch (BadLocationException e) {
         }
+        if (SwingUtilities.isEventDispatchThread()) {
+            showUIinEDT();
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
+                    public void run() {
+                        showUIinEDT();
+                    }
+                });
+            } catch (InterruptedException ex) {
+                Exceptions.printStackTrace(ex);
+            } catch (InvocationTargetException ex) {
+                Exceptions.printStackTrace(ex);
+            }
+        }
         // continue by showing method selection ui
+        isInSelectMode = true;
+        return true;
+    }
+    
+    private void showUIinEDT() {
+        assert SwingUtilities.isEventDispatchThread();
         mainListener = new CentralListener();
         editorPane.putClientProperty(MethodChooser.class, this);
         editorPane.addKeyListener(mainListener);
@@ -263,8 +285,6 @@
         if (hintText != null && hintText.trim().length() > 0) {
             Utilities.setStatusText(editorPane, " " + hintText);
         }
-        isInSelectMode = true;
-        return true;
     }
 
     /**
@@ -414,6 +434,7 @@
     }
 
     private void requestRepaint() {
+        assert SwingUtilities.isEventDispatchThread();
         if (attribsLeft == null) {
             Color foreground = editorPane.getForeground();
             Color foreground2 = Color.GRAY;

[hg] main-silver: #221710: Assure, that requestRepaint() is call...

mentlicher 11/15/2012

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close