mbien commented on code in PR #9812:
URL: https://github.com/apache/netbeans/pull/9812#discussion_r4729141272


##########
platform/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java:
##########
@@ -1025,4 +1037,237 @@ public void setSelectionVisible(boolean vis) {
             }
         }
     }
+    
+    
+    private static class HoverSupport {
+        private final JEditorPane pane;
+
+        private Object hightlightHandle;
+        private int[] highlightRange;
+        private Point lastMouse;            // so key presses can re-evaluate 
without mouse movement
+
+        public HoverSupport(JEditorPane pane) {
+            this.pane = pane;
+
+            MouseAdapter mouse = new MouseAdapter() {
+                @Override
+                public void mouseMoved(MouseEvent e) {
+                    lastMouse = e.getPoint();
+                    update(isCtrlDown(e));
+                }
+

Review Comment:
   pretty sure this will flip/flop between hand and txt cursor on every motion 
event over mvn/gradle `OutputProcessor` links, even if they are no paths atm.
   
   not tested but if the overall handler code stays, it would need at least two 
guards using `hightlightHandle` as state value.
   
   ```java
        public void mouseMoved(MouseEvent e) {
            lastMouse = e.getPoint();
            if (isCtrlDown(e)) {
                update(true);
            } else if (hightlightHandle != null) {
                clear();
            }
        }
   ```
   
   and in clear():
   
   ```java
        private void clear() {
            if (hightlightHandle != null) {
                pane.getHighlighter().removeHighlight(hightlightHandle);
                hightlightHandle = null;
                highlightRange = null;
                pane.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
            }
        }
   ```
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to