use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class TextEditorImpl method loadEditorInBackground.
@NotNull
protected Runnable loadEditorInBackground() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(myFile, scheme, myProject);
EditorEx editor = (EditorEx) getEditor();
highlighter.setText(editor.getDocument().getImmutableCharSequence());
return () -> editor.setHighlighter(highlighter);
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class IterationStateTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
DEFAULT_BACKGROUND = colorsScheme.getDefaultBackground();
CARET_ROW_BACKGROUND = colorsScheme.getColor(EditorColors.CARET_ROW_COLOR);
SELECTION_BACKGROUND = colorsScheme.getColor(EditorColors.SELECTION_BACKGROUND_COLOR);
assertEquals(3, new HashSet<>(Arrays.asList(DEFAULT_BACKGROUND, CARET_ROW_BACKGROUND, SELECTION_BACKGROUND)).size());
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-plugins by JetBrains.
the class DartMethodLineMarkerProvider method getLineMarkerInfo.
@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
if (!myDaemonSettings.SHOW_METHOD_SEPARATORS) {
return null;
}
// only continue if element is one of the markable elements (such as methods)
if (isMarkableElement(element)) {
// the method line markers are not nestable, aka, methods inside of methods, are not marked
if (PsiTreeUtil.findFirstParent(element, true, DartMethodLineMarkerProvider::isMarkableElement) != null) {
return null;
}
// move the marker to previous siblings until comments have been included
PsiElement markerLocation = element;
while (markerLocation.getPrevSibling() != null && (markerLocation.getPrevSibling() instanceof PsiComment || (markerLocation.getPrevSibling() instanceof PsiWhiteSpace && markerLocation.getPrevSibling().getPrevSibling() != null && markerLocation.getPrevSibling().getPrevSibling() instanceof PsiComment))) {
markerLocation = markerLocation.getPrevSibling();
}
// if the markerLocation element doesn't have a previous sibling (not whitespace), do not mark
PsiElement prevElement = markerLocation;
while (prevElement.getPrevSibling() != null && prevElement.getPrevSibling() instanceof PsiWhiteSpace) {
prevElement = prevElement.getPrevSibling();
}
if (prevElement.getPrevSibling() == null) {
return null;
}
// finally, create the marker
LineMarkerInfo info = new LineMarkerInfo<>(markerLocation, markerLocation.getTextRange(), null, Pass.LINE_MARKERS, FunctionUtil.<Object, String>nullConstant(), null, GutterIconRenderer.Alignment.RIGHT);
EditorColorsScheme scheme = myColorsManager.getGlobalScheme();
info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
info.separatorPlacement = SeparatorPlacement.TOP;
return info;
}
return null;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class CodeStyleAbstractPanel method updatePreviewHighlighter.
private void updatePreviewHighlighter(final EditorEx editor) {
EditorColorsScheme scheme = editor.getColorsScheme();
editor.getSettings().setCaretRowShown(false);
editor.setHighlighter(createHighlighter(scheme));
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class DefaultHighlightInfoProcessor method highlightsOutsideVisiblePartAreProduced.
@Override
public void highlightsOutsideVisiblePartAreProduced(@NotNull final HighlightingSession session, @NotNull final List<HighlightInfo> infos, @NotNull final TextRange priorityRange, @NotNull final TextRange restrictedRange, final int groupId) {
final PsiFile psiFile = session.getPsiFile();
final Project project = psiFile.getProject();
final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null)
return;
final long modificationStamp = document.getModificationStamp();
((HighlightingSessionImpl) session).applyInEDT(() -> {
if (project.isDisposed() || modificationStamp != document.getModificationStamp())
return;
EditorColorsScheme scheme = session.getColorsScheme();
UpdateHighlightersUtil.setHighlightersOutsideRange(project, document, psiFile, infos, scheme, restrictedRange.getStartOffset(), restrictedRange.getEndOffset(), ProperTextRange.create(priorityRange), groupId);
Editor editor = session.getEditor();
if (editor != null) {
DaemonListeners.repaintErrorStripeRenderer(editor, project);
}
});
}
Aggregations