public static void createGuardedBlock(Document document, String reason, boolean highlight) {
createGuardedBlock(document, 0, document.getTextLength(), reason);
if (!highlight) {
Editor[] editors = EditorFactory.getInstance().getEditors(document);
for (Editor editor : editors) {
ColorKey key = ColorKey.find("READONLY_FRAGMENT_BACKGROUND");
EditorColorsScheme scheme = editor.getColorsScheme();
scheme.setColor(key, scheme.getDefaultBackground());
}
}
}