Search in sources :

Example 1 with SettingsImpl

use of com.intellij.openapi.editor.impl.SettingsImpl in project intellij-community by JetBrains.

the class DetailViewImpl method createEditor.

@NotNull
protected Editor createEditor(@Nullable Project project, Document document, VirtualFile file) {
    EditorEx editor = (EditorEx) EditorFactory.getInstance().createViewer(document, project);
    final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
    EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(file, scheme, project);
    editor.setFile(file);
    editor.setHighlighter(highlighter);
    EditorSettings settings = editor.getSettings();
    settings.setAnimatedScrolling(false);
    settings.setRefrainFromScrolling(false);
    settings.setLineNumbersShown(true);
    settings.setFoldingOutlineShown(false);
    if (settings instanceof SettingsImpl) {
        ((SettingsImpl) settings).setSoftWrapAppliancePlace(SoftWrapAppliancePlaces.PREVIEW);
    }
    editor.getFoldingModel().setFoldingEnabled(false);
    return editor;
}
Also used : EditorEx(com.intellij.openapi.editor.ex.EditorEx) SettingsImpl(com.intellij.openapi.editor.impl.SettingsImpl) EditorColorsScheme(com.intellij.openapi.editor.colors.EditorColorsScheme) EditorHighlighter(com.intellij.openapi.editor.highlighter.EditorHighlighter) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 EditorHighlighter (com.intellij.openapi.editor.highlighter.EditorHighlighter)1 SettingsImpl (com.intellij.openapi.editor.impl.SettingsImpl)1 NotNull (org.jetbrains.annotations.NotNull)1