Search in sources :

Example 11 with GutterMark

use of com.intellij.codeInsight.daemon.GutterMark in project intellij-plugins by JetBrains.

the class DartServerOverrideMarkerProviderTest method checkGutter.

public static void checkGutter(final List<GutterMark> gutters, final String expectedText, final Icon expectedIcon) {
    final List<String> textList = Lists.newArrayList();
    for (GutterMark gutter : gutters) {
        final String text = gutter.getTooltipText();
        textList.add(text);
        if (expectedText.equals(text) && expectedIcon.equals(gutter.getIcon())) {
            return;
        }
    }
    fail("Not found gutter mark: " + expectedText + "  " + expectedIcon + "\nin\n" + StringUtil.join(textList, "\n"));
}
Also used : GutterMark(com.intellij.codeInsight.daemon.GutterMark)

Example 12 with GutterMark

use of com.intellij.codeInsight.daemon.GutterMark in project intellij-plugins by JetBrains.

the class FlexColorAnnotatorTest method testIdea94474.

@JSTestOptions(JSTestOption.WithFlexSdk)
public void testIdea94474() throws Exception {
    GutterMark r = myFixture.findGutter(getTestName(false) + '.' + "css");
    assertNull(r);
}
Also used : GutterMark(com.intellij.codeInsight.daemon.GutterMark) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 13 with GutterMark

use of com.intellij.codeInsight.daemon.GutterMark in project intellij-plugins by JetBrains.

the class ActionJavaAnnotatorTest method checkGutterTargetElements.

/**
   * Checks whether the gutter target elements in the given class resolve to the given names.
   *
   * @param javaFile            Path to class.
   * @param nameResolveFunction Naming function
   * @param expectedNames       Expected names.
   */
private void checkGutterTargetElements(@NonNls final String javaFile, final Function<PsiElement, String> nameResolveFunction, @NonNls final String... expectedNames) {
    final GutterMark renderer = myFixture.findGutter(javaFile);
    assertNotNull(renderer);
    AnnotatorTestUtils.checkGutterTargets(renderer, nameResolveFunction, expectedNames);
}
Also used : GutterMark(com.intellij.codeInsight.daemon.GutterMark)

Example 14 with GutterMark

use of com.intellij.codeInsight.daemon.GutterMark in project intellij-community by JetBrains.

the class RangeHighlighterImpl method setGutterIconRenderer.

@Override
public void setGutterIconRenderer(GutterIconRenderer renderer) {
    GutterMark old = myGutterIconRenderer;
    myGutterIconRenderer = renderer;
    if (!Comparing.equal(old, renderer)) {
        fireChanged(true, false);
    }
}
Also used : GutterMark(com.intellij.codeInsight.daemon.GutterMark)

Example 15 with GutterMark

use of com.intellij.codeInsight.daemon.GutterMark in project intellij-community by JetBrains.

the class CodeInsightTestFixtureImpl method findGutters.

private void findGutters(Processor<GutterMark> processor) {
    int offset = myEditor.getCaretModel().getOffset();
    final Collection<HighlightInfo> infos = doHighlighting();
    for (HighlightInfo info : infos) {
        if (info.endOffset >= offset && info.startOffset <= offset) {
            final GutterMark renderer = info.getGutterIconRenderer();
            if (renderer != null && !processor.process(renderer)) {
                return;
            }
        }
    }
    RangeHighlighter[] highlighters = DocumentMarkupModel.forDocument(myEditor.getDocument(), getProject(), true).getAllHighlighters();
    for (RangeHighlighter highlighter : highlighters) {
        if (highlighter.getEndOffset() >= offset && highlighter.getStartOffset() <= offset) {
            GutterMark renderer = highlighter.getGutterIconRenderer();
            if (renderer != null && !processor.process(renderer)) {
                return;
            }
        }
    }
}
Also used : RangeHighlighter(com.intellij.openapi.editor.markup.RangeHighlighter) GutterMark(com.intellij.codeInsight.daemon.GutterMark) ExtensionPoint(com.intellij.openapi.extensions.ExtensionPoint)

Aggregations

GutterMark (com.intellij.codeInsight.daemon.GutterMark)23 NonHideableIconGutterMark (com.intellij.codeInsight.daemon.NonHideableIconGutterMark)6 HintHint (com.intellij.ui.HintHint)6 RelativePoint (com.intellij.ui.awt.RelativePoint)6 ScalableIcon (com.intellij.openapi.util.ScalableIcon)4 JSTestOptions (com.intellij.lang.javascript.JSTestOptions)3 Ref (com.intellij.openapi.util.Ref)3 TooltipController (com.intellij.codeInsight.hint.TooltipController)2 ApplicationManager (com.intellij.openapi.application.ApplicationManager)2 Document (com.intellij.openapi.editor.Document)2 MarkupModelEx (com.intellij.openapi.editor.ex.MarkupModelEx)2 RangeHighlighterEx (com.intellij.openapi.editor.ex.RangeHighlighterEx)2 com.intellij.openapi.editor.markup (com.intellij.openapi.editor.markup)2 Project (com.intellij.openapi.project.Project)2 Balloon (com.intellij.openapi.ui.popup.Balloon)2 ContainerUtil (com.intellij.util.containers.ContainerUtil)2 ColorIconCache (com.intellij.xml.util.ColorIconCache)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 GutterIconNavigationHandler (com.intellij.codeInsight.daemon.GutterIconNavigationHandler)1