mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
choose some nice and decent preview text
This commit is contained in:
@@ -109,8 +109,13 @@ public class SetBackgroundImageDialog extends DialogWrapper {
|
||||
options.reset();
|
||||
options.selectScheme(scheme.getName());
|
||||
ColorSettingsPage[] pages = ColorSettingsPages.getInstance().getRegisteredPages();
|
||||
int round = (int)Math.round(Math.random() * (pages.length - 1));
|
||||
return new SimpleEditorPreview(options, pages[round], false);
|
||||
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);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user