Search in sources :

Example 1 with FilteringProcessor

use of com.intellij.util.FilteringProcessor in project intellij-community by JetBrains.

the class EditorHyperlinkSupport method getHyperlinks.

private static List<RangeHighlighter> getHyperlinks(int startOffset, int endOffset, final Editor editor) {
    final MarkupModelEx markupModel = (MarkupModelEx) editor.getMarkupModel();
    final CommonProcessors.CollectProcessor<RangeHighlighterEx> processor = new CommonProcessors.CollectProcessor<>();
    markupModel.processRangeHighlightersOverlappingWith(startOffset, endOffset, new FilteringProcessor<>(rangeHighlighterEx -> rangeHighlighterEx.isValid() && getHyperlinkInfo(rangeHighlighterEx) != null, processor));
    return new ArrayList<>(processor.getResults());
}
Also used : EditorMouseAdapter(com.intellij.openapi.editor.event.EditorMouseAdapter) UIUtil(com.intellij.util.ui.UIUtil) HyperlinkInfoBase(com.intellij.execution.filters.HyperlinkInfoBase) Document(com.intellij.openapi.editor.Document) EditorUtil(com.intellij.openapi.editor.ex.util.EditorUtil) EditorColorsManager(com.intellij.openapi.editor.colors.EditorColorsManager) MarkupModelEx(com.intellij.openapi.editor.ex.MarkupModelEx) LinkedHashMap(com.intellij.util.containers.hash.LinkedHashMap) ArrayList(java.util.ArrayList) NavigatableAdapter(com.intellij.pom.NavigatableAdapter) FilteringProcessor(com.intellij.util.FilteringProcessor) CodeInsightColors(com.intellij.openapi.editor.colors.CodeInsightColors) RangeHighlighterEx(com.intellij.openapi.editor.ex.RangeHighlighterEx) HighlighterLayer(com.intellij.openapi.editor.markup.HighlighterLayer) Map(java.util.Map) RangeHighlighter(com.intellij.openapi.editor.markup.RangeHighlighter) Project(com.intellij.openapi.project.Project) EditorEx(com.intellij.openapi.editor.ex.EditorEx) OccurenceNavigator(com.intellij.ide.OccurenceNavigator) CommonProcessors(com.intellij.util.CommonProcessors) Filter(com.intellij.execution.filters.Filter) Collection(java.util.Collection) Key(com.intellij.openapi.util.Key) Editor(com.intellij.openapi.editor.Editor) LogicalPosition(com.intellij.openapi.editor.LogicalPosition) MouseMotionAdapter(java.awt.event.MouseMotionAdapter) MouseEvent(java.awt.event.MouseEvent) EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) HighlighterTargetArea(com.intellij.openapi.editor.markup.HighlighterTargetArea) java.awt(java.awt) HyperlinkInfo(com.intellij.execution.filters.HyperlinkInfo) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) TextAttributes(com.intellij.openapi.editor.markup.TextAttributes) NotNull(org.jetbrains.annotations.NotNull) RelativePoint(com.intellij.ui.awt.RelativePoint) Consumer(com.intellij.util.Consumer) MarkupModelEx(com.intellij.openapi.editor.ex.MarkupModelEx) RangeHighlighterEx(com.intellij.openapi.editor.ex.RangeHighlighterEx) ArrayList(java.util.ArrayList) CommonProcessors(com.intellij.util.CommonProcessors)

Aggregations

Filter (com.intellij.execution.filters.Filter)1 HyperlinkInfo (com.intellij.execution.filters.HyperlinkInfo)1 HyperlinkInfoBase (com.intellij.execution.filters.HyperlinkInfoBase)1 OccurenceNavigator (com.intellij.ide.OccurenceNavigator)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 LogicalPosition (com.intellij.openapi.editor.LogicalPosition)1 CodeInsightColors (com.intellij.openapi.editor.colors.CodeInsightColors)1 EditorColorsManager (com.intellij.openapi.editor.colors.EditorColorsManager)1 EditorMouseAdapter (com.intellij.openapi.editor.event.EditorMouseAdapter)1 EditorMouseEvent (com.intellij.openapi.editor.event.EditorMouseEvent)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 MarkupModelEx (com.intellij.openapi.editor.ex.MarkupModelEx)1 RangeHighlighterEx (com.intellij.openapi.editor.ex.RangeHighlighterEx)1 EditorUtil (com.intellij.openapi.editor.ex.util.EditorUtil)1 HighlighterLayer (com.intellij.openapi.editor.markup.HighlighterLayer)1 HighlighterTargetArea (com.intellij.openapi.editor.markup.HighlighterTargetArea)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)1 Project (com.intellij.openapi.project.Project)1