EditorFragmentComponent (Editor editor, int startLine, int endLine, boolean showFolding, boolean showGutter, boolean useCaretRowBackground) { final EditorEx editorEx = (EditorEx)editor; final Color old = editorEx.getBackgroundColor(); Color backColor = getBackgroundColor(editor, useCaretRowBackground); editorEx.setBackgroundColor(backColor); EditorFragmentComponent fragmentComponent = new EditorFragmentComponent(editorEx, startLine, endLine, showFolding, showGutter); fragmentComponent.setBackground(backColor); editorEx.setBackgroundColor(old); return fragmentComponent; }