use of com.intellij.application.options.colors.SimpleEditorPreview in project intellij-community by JetBrains.
the class SetBackgroundImageDialog method createEditorPreview.
@NotNull
private static SimpleEditorPreview createEditorPreview() {
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
ColorAndFontOptions options = new ColorAndFontOptions();
options.reset();
options.selectScheme(scheme.getName());
ColorSettingsPage[] pages = ColorSettingsPages.getInstance().getRegisteredPages();
int index;
int attempt = 0;
do {
index = (int) Math.round(Math.random() * (pages.length - 1));
} while (StringUtil.countNewLines(pages[index].getDemoText()) < 8 && ++attempt < 10);
return new SimpleEditorPreview(options, pages[index], false);
}
Aggregations