@@ -100,7 +100,7 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
100100
101101 private FocusListener focusChangeListener = null ;
102102 private MouseMotionListener moveBeforeEnterListener = null ;
103- private KeyListener accessibilityKeyListener = null ;
103+ // private KeyListener accessibilityKeyListener = null;
104104
105105 // PENDING(ges)
106106 protected boolean lightWeightPopupEnabled = false ; // BH 2018 true;
@@ -155,7 +155,7 @@ public void actionPerformed(ActionEvent e) {
155155 insideTimer .setRepeats (false );
156156
157157 moveBeforeEnterListener = new MoveBeforeEnterListener ();
158- accessibilityKeyListener = new AccessibilityKeyListener ();
158+ // accessibilityKeyListener = new AccessibilityKeyListener();
159159 }
160160
161161 /**
@@ -274,7 +274,13 @@ public int getReshowDelay() {
274274 void showTipWindow () {
275275 if (insideComponent == null || !insideComponent .isShowing ())
276276 return ;
277+ Component win = insideComponent .getTopLevelAncestor ();
278+ if (win instanceof Window ) {
279+ if (((Window ) win ).getModalBlocker () != null )
280+ return ;
281+ }
277282
283+
278284// System.out.println("TTM showTipWindow1");
279285
280286// String mode = UIManager.getString("ToolTipManager.enableToolTipMode");
@@ -432,8 +438,8 @@ public void registerComponent(JComponent component) {
432438 component .addMouseListener (this );
433439 component .removeMouseMotionListener (moveBeforeEnterListener );
434440 component .addMouseMotionListener (moveBeforeEnterListener );
435- component .removeKeyListener (accessibilityKeyListener );
436- component .addKeyListener (accessibilityKeyListener );
441+ // component.removeKeyListener(accessibilityKeyListener);
442+ // component.addKeyListener(accessibilityKeyListener);
437443 }
438444
439445 /**
@@ -444,7 +450,7 @@ public void registerComponent(JComponent component) {
444450 public void unregisterComponent (JComponent component ) {
445451 component .removeMouseListener (this );
446452 component .removeMouseMotionListener (moveBeforeEnterListener );
447- component .removeKeyListener (accessibilityKeyListener );
453+ // component.removeKeyListener(accessibilityKeyListener);
448454 }
449455
450456 // implements java.awt.event.MouseListener
@@ -823,28 +829,28 @@ private void hide(JComponent source) {
823829 insideComponent = null ;
824830 }
825831
826- /*
827- * This listener is registered when the tooltip is first registered on a
828- * component in order to process accessibility keybindings. This will apply
829- * globally across L&F
830- *
831- * Post Tip: Ctrl+F1 Unpost Tip: Esc and Ctrl+F1
832- */
833- private class AccessibilityKeyListener extends KeyAdapter {
834- public void keyPressed (KeyEvent e ) {
835- if (!e .isConsumed ()) {
836- JComponent source = (JComponent ) e .getComponent ();
837- if (e .getKeyCode () == KeyEvent .VK_ESCAPE ) {
838- if (tipWindow != null ) {
839- hide (source );
840- e .consume ();
841- }
842- } else if (e .getKeyCode () == KeyEvent .VK_F1 && e .getModifiers () == Event .CTRL_MASK ) {
843- // Shown tooltip will be hidden
844- ToolTipManager .this .show (source );
845- e .consume ();
846- }
847- }
848- }
849- }
832+ // /*
833+ // * This listener is registered when the tooltip is first registered on a
834+ // * component in order to process accessibility keybindings. This will apply
835+ // * globally across L&F
836+ // *
837+ // * Post Tip: Ctrl+F1 Unpost Tip: Esc and Ctrl+F1
838+ // */
839+ // private class AccessibilityKeyListener extends KeyAdapter {
840+ // public void keyPressed(KeyEvent e) {
841+ // if (!e.isConsumed()) {
842+ // JComponent source = (JComponent) e.getComponent();
843+ // if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
844+ // if (tipWindow != null) {
845+ // hide(source);
846+ // e.consume();
847+ // }
848+ // } else if (e.getKeyCode() == KeyEvent.VK_F1 && e.getModifiers() == Event.CTRL_MASK) {
849+ // // Shown tooltip will be hidden
850+ // ToolTipManager.this.show(source);
851+ // e.consume();
852+ // }
853+ // }
854+ // }
855+ // }
850856}
0 commit comments