提交 44ddbd9c 编写于 作者: A alexp

7016942: Revert a refactoring in TooltipManager to allow reflection hack

Reviewed-by: rupashka
上级 9d798a9e
...@@ -75,6 +75,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener ...@@ -75,6 +75,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
private MouseMotionListener moveBeforeEnterListener = null; private MouseMotionListener moveBeforeEnterListener = null;
private KeyListener accessibilityKeyListener = null; private KeyListener accessibilityKeyListener = null;
private KeyStroke postTip;
private KeyStroke hideTip;
// PENDING(ges) // PENDING(ges)
protected boolean lightWeightPopupEnabled = true; protected boolean lightWeightPopupEnabled = true;
protected boolean heavyWeightPopupEnabled = false; protected boolean heavyWeightPopupEnabled = false;
...@@ -89,6 +92,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener ...@@ -89,6 +92,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
moveBeforeEnterListener = new MoveBeforeEnterListener(); moveBeforeEnterListener = new MoveBeforeEnterListener();
accessibilityKeyListener = new AccessibilityKeyListener(); accessibilityKeyListener = new AccessibilityKeyListener();
postTip = KeyStroke.getKeyStroke(KeyEvent.VK_F1, InputEvent.CTRL_MASK);
hideTip = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
} }
/** /**
...@@ -805,13 +811,13 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener ...@@ -805,13 +811,13 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (!e.isConsumed()) { if (!e.isConsumed()) {
JComponent source = (JComponent) e.getComponent(); JComponent source = (JComponent) e.getComponent();
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { KeyStroke keyStrokeForEvent = KeyStroke.getKeyStrokeForEvent(e);
if (hideTip.equals(keyStrokeForEvent)) {
if (tipWindow != null) { if (tipWindow != null) {
hide(source); hide(source);
e.consume(); e.consume();
} }
} else if (e.getKeyCode() == KeyEvent.VK_F1 } else if (postTip.equals(keyStrokeForEvent)) {
&& e.getModifiers() == Event.CTRL_MASK) {
// Shown tooltip will be hidden // Shown tooltip will be hidden
ToolTipManager.this.show(source); ToolTipManager.this.show(source);
e.consume(); e.consume();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册