Search in sources :

Example 1 with LineStatusMarkerRenderer

use of com.intellij.openapi.vcs.ex.LineStatusMarkerRenderer in project intellij-community by JetBrains.

the class VcsPreviewPanel method addHighlighter.

private void addHighlighter(@NotNull Range range, @NotNull ColorKey colorKey) {
    TextRange textRange = DiffUtil.getLinesRange(myEditor.getDocument(), range.getLine1(), range.getLine2());
    RangeHighlighter highlighter = LineStatusMarkerRenderer.createRangeHighlighter(range, textRange, myEditor.getMarkupModel());
    highlighter.setLineMarkerRenderer(new LineStatusMarkerRenderer(range) {

        @Override
        public boolean canDoAction(MouseEvent e) {
            return isInsideMarkerArea(e);
        }

        @Override
        public void doAction(Editor editor, MouseEvent e) {
            myDispatcher.getMulticaster().selectionInPreviewChanged(colorKey.getExternalName());
        }
    });
}
Also used : RangeHighlighter(com.intellij.openapi.editor.markup.RangeHighlighter) LineStatusMarkerRenderer(com.intellij.openapi.vcs.ex.LineStatusMarkerRenderer) MouseEvent(java.awt.event.MouseEvent) TextRange(com.intellij.openapi.util.TextRange) Editor(com.intellij.openapi.editor.Editor)

Aggregations

Editor (com.intellij.openapi.editor.Editor)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 TextRange (com.intellij.openapi.util.TextRange)1 LineStatusMarkerRenderer (com.intellij.openapi.vcs.ex.LineStatusMarkerRenderer)1 MouseEvent (java.awt.event.MouseEvent)1