You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/03/22 12:40:23 UTC

[GitHub] [netbeans] sdedic opened a new pull request #2823: Change invokeLaters to Mutex.EVENT.

sdedic opened a new pull request #2823:
URL: https://github.com/apache/netbeans/pull/2823


   During prototyping I wanted to pass dynamic context through Lookup.executeWith() to some code deeply burried in EditorSupport; and I discovered a few places where replanning to EDT broke the Lookup-passing logic. Since I've targeted real UI with the prototype, I've caught a few places in WindowManager as well.
   
   The added test in UiUtils was probably omitted from the contribution, but the test source content does not matter, just the class name is tested, so I've provided a dummy test data (the original test data was copied from Swing, I believe).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2823: Change invokeLaters to Mutex.EVENT.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2823:
URL: https://github.com/apache/netbeans/pull/2823#discussion_r598728741



##########
File path: java/java.source/src/org/netbeans/api/java/source/UiUtils.java
##########
@@ -377,27 +377,13 @@ private static boolean doOpen(FileObject fo, int offset) {
     }
     
     private static void doShow(final Line l, final int column) {
-        if (SwingUtilities.isEventDispatchThread()) {
-            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
-        } else {
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
-                }
-            });
-        }
+        Mutex.EVENT.readAccess(() ->
+            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column)
+        );
     }
 
     private static void doOpen(final OpenCookie oc) {
-        if (SwingUtilities.isEventDispatchThread()) {
-            oc.open();
-        } else {
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    oc.open();
-                }
-            });
-        }
+        Mutex.EVENT.readAccess(oc::open);

Review comment:
       Simplification as well.

##########
File path: java/java.source/src/org/netbeans/api/java/source/UiUtils.java
##########
@@ -377,27 +377,13 @@ private static boolean doOpen(FileObject fo, int offset) {
     }
     
     private static void doShow(final Line l, final int column) {
-        if (SwingUtilities.isEventDispatchThread()) {
-            l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
-        } else {
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    l.show(ShowOpenType.OPEN, ShowVisibilityType.FOCUS, column);
-                }
-            });
-        }
+        Mutex.EVENT.readAccess(() ->

Review comment:
       Simplification.

##########
File path: platform/core.windows/src/org/netbeans/core/windows/WindowManagerImpl.java
##########
@@ -1534,8 +1520,8 @@ public void run() {
                     FloatingWindowTransparencyManager.getDefault().start();
                 }
             });
-
-            SwingUtilities.invokeLater(getExclusive());
+            
+            Mutex.EVENT.postReadRequest(getExclusive());

Review comment:
       Yes, `postXYZRequest` is replacement for `invokeLater`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic merged pull request #2823: Change invokeLaters to Mutex.EVENT.

Posted by GitBox <gi...@apache.org>.
sdedic merged pull request #2823:
URL: https://github.com/apache/netbeans/pull/2823


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2823: Change invokeLaters to Mutex.EVENT.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2823:
URL: https://github.com/apache/netbeans/pull/2823#issuecomment-804100400


   Wow, that was quick.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists