use of com.intellij.util.ui.RangeBlinker in project intellij-community by JetBrains.
the class SearchForUsagesRunnable method flashUsageScriptaculously.
private static void flashUsageScriptaculously(@NotNull final Usage usage) {
if (!(usage instanceof UsageInfo2UsageAdapter)) {
return;
}
UsageInfo2UsageAdapter usageInfo = (UsageInfo2UsageAdapter) usage;
Editor editor = usageInfo.openTextEditor(true);
if (editor == null)
return;
TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES);
RangeBlinker rangeBlinker = new RangeBlinker(editor, attributes, 6);
List<Segment> segments = new ArrayList<>();
Processor<Segment> processor = Processors.cancelableCollectProcessor(segments);
usageInfo.processRangeMarkers(processor);
rangeBlinker.resetMarkers(segments);
rangeBlinker.startBlinking();
}
Aggregations