IDEA-72903 Debugger tooltips and Intention tooltips hide each other

This commit is contained in:
Vassiliy Kudryashov
2012-09-19 18:19:10 +04:00
parent 99c6d1e0bd
commit ad8ee0c5c7
2 changed files with 12 additions and 0 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.debugger.ui;
import com.intellij.codeInsight.daemon.impl.DaemonListeners;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.DebuggerInvocationUtil;
import com.intellij.debugger.SourcePosition;
@@ -123,13 +124,22 @@ public class PositionHighlighter {
DebuggerColors.EXECUTION_LINE_HIGHLIGHTERLAYER,
scheme.getAttributes(DebuggerColors.EXECUTIONPOINT_ATTRIBUTES)
);
adjustCounter(myEditor, 1);
myHighlighter.setErrorStripeTooltip(DebuggerBundle.message("position.highlighter.stripe.tooltip"));
myHighlighter.putUserData(HIGHLIGHTER_USERDATA_KEY, Boolean.TRUE);
}
private static void adjustCounter(@NotNull Editor editor, int increment) {
JComponent component = editor.getComponent();
Object o = component.getClientProperty(DaemonListeners.IGNORE_MOUSE_TRACKING);
Integer value = ((o instanceof Integer) ? (Integer)o : 0) + increment;
component.putClientProperty(DaemonListeners.IGNORE_MOUSE_TRACKING, value > 0 ? value : null);
}
public void remove() {
if(!myIsActive) return;
myIsActive = false;
adjustCounter(myEditor, -1);
if (myHighlighter != null) {
myHighlighter.dispose();
myHighlighter = null;
@@ -89,6 +89,7 @@ import java.util.Set;
*/
public class DaemonListeners implements Disposable {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.DaemonListeners");
public static final Object IGNORE_MOUSE_TRACKING = "ignore_mouse_tracking";
private final Project myProject;
private final DaemonCodeAnalyzerImpl myDaemonCodeAnalyzer;
@@ -545,6 +546,7 @@ public class DaemonListeners implements Disposable {
public void mouseMoved(EditorMouseEvent e) {
Editor editor = e.getEditor();
if (myProject != editor.getProject()) return;
if (editor.getComponent().getClientProperty(IGNORE_MOUSE_TRACKING) != null) return;
boolean shown = false;
try {