Search in sources :

Example 1 with HintManagerImpl

use of com.intellij.codeInsight.hint.HintManagerImpl in project intellij-community by JetBrains.

the class TrafficTooltipRendererImpl method show.

@Override
public LightweightHint show(@NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint) {
    myTrafficLightRenderer = (TrafficLightRenderer) ((EditorMarkupModelImpl) editor.getMarkupModel()).getErrorStripeRenderer();
    myPanel = new TrafficProgressPanel(myTrafficLightRenderer, editor, hintHint);
    repaintTooltipWindow();
    LineTooltipRenderer.correctLocation(editor, myPanel, p, alignToRight, true, myPanel.getMinWidth());
    LightweightHint hint = new LightweightHint(myPanel);
    HintManagerImpl hintManager = (HintManagerImpl) HintManager.getInstance();
    hintManager.showEditorHint(hint, editor, p, HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_OTHER_HINT | HintManager.HIDE_BY_SCROLLING, 0, false, hintHint);
    hint.addHintListener(new HintListener() {

        @Override
        public void hintHidden(EventObject event) {
            //double hide?
            if (myPanel == null)
                return;
            myPanel = null;
            onHide.run();
        }
    });
    return hint;
}
Also used : HintListener(com.intellij.ui.HintListener) HintManagerImpl(com.intellij.codeInsight.hint.HintManagerImpl) LightweightHint(com.intellij.ui.LightweightHint) EditorMarkupModelImpl(com.intellij.openapi.editor.impl.EditorMarkupModelImpl) EventObject(java.util.EventObject)

Aggregations

HintManagerImpl (com.intellij.codeInsight.hint.HintManagerImpl)1 EditorMarkupModelImpl (com.intellij.openapi.editor.impl.EditorMarkupModelImpl)1 HintListener (com.intellij.ui.HintListener)1 LightweightHint (com.intellij.ui.LightweightHint)1 EventObject (java.util.EventObject)1