use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class FileTemplateConfigurable method createHighlighter.
private EditorHighlighter createHighlighter() {
if (myTemplate != null && myVelocityFileType != FileTypes.UNKNOWN) {
return EditorHighlighterFactory.getInstance().createEditorHighlighter(myProject, new LightVirtualFile("aaa." + myTemplate.getExtension() + ".ft"));
}
FileType fileType = null;
if (myTemplate != null) {
fileType = FileTypeManager.getInstance().getFileTypeByExtension(myTemplate.getExtension());
}
if (fileType == null) {
fileType = FileTypes.PLAIN_TEXT;
}
SyntaxHighlighter originalHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, null, null);
if (originalHighlighter == null) {
originalHighlighter = new PlainSyntaxHighlighter();
}
final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
LayeredLexerEditorHighlighter highlighter = new LayeredLexerEditorHighlighter(new TemplateHighlighter(), scheme);
highlighter.registerLayer(FileTemplateTokenType.TEXT, new LayerDescriptor(originalHighlighter, ""));
return highlighter;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class EditorWindowImpl method getHighlighter.
@NotNull
@Override
public EditorHighlighter getHighlighter() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
SyntaxHighlighter syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(myInjectedFile.getLanguage(), getProject(), myInjectedFile.getVirtualFile());
EditorHighlighter highlighter = HighlighterFactory.createHighlighter(syntaxHighlighter, scheme);
highlighter.setText(getDocument().getText());
highlighter.setEditor(new LightHighlighterClient(getDocument(), getProject()));
return highlighter;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class ColoredOutputTypeRegistry method getDefaultBackgroundColor.
@NotNull
private static Color getDefaultBackgroundColor() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
Color color = scheme.getColor(ConsoleViewContentType.CONSOLE_BACKGROUND_KEY);
if (color == null) {
color = scheme.getDefaultBackground();
}
return color;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class ColoredOutputTypeRegistry method getDefaultForegroundColor.
@NotNull
private static Color getDefaultForegroundColor() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
TextAttributes attr = scheme.getAttributes(ConsoleViewContentType.NORMAL_OUTPUT_KEY);
Color color = attr != null ? attr.getForegroundColor() : null;
if (color == null) {
color = scheme.getDefaultForeground();
}
return color;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class FontEditorPreview method updateView.
@Override
public void updateView() {
EditorColorsScheme scheme = updateOptionsScheme(myOptions.getSelectedScheme());
myEditor.setColorsScheme(scheme);
myEditor.reinitSettings();
}
Aggregations