void () { EditorColorsScheme defaultScheme = EditorColorsManager.getInstance().getScheme(EditorColorsScheme.DEFAULT_SCHEME_NAME); EditorColorsScheme editorColorsScheme = (EditorColorsScheme)defaultScheme.clone(); editorColorsScheme.setName("rainbow"); final String BEGIN = """ <scheme name="rainbow" version="142" parent_scheme="Default"> <metaInfo> <property name="created" /> <property name="ide" /> <property name="ideVersion" /> <property name="modified" /> <property name="originalScheme" /> """; final String END = " </metaInfo>\n" + "</scheme>"; boolean nonDefaultRainbow = !RainbowHighlighter.DEFAULT_RAINBOW_ON; RainbowHighlighter.setRainbowEnabled(editorColorsScheme, null, nonDefaultRainbow); assertEquals(nonDefaultRainbow, (boolean)RainbowHighlighter.isRainbowEnabled(editorColorsScheme, null)); EditorColorSchemeTestCase.assertXmlOutputEquals( BEGIN + " <property name=\"rainbow Default language\">" + nonDefaultRainbow + "</property>\n" + END, serializeWithFixedMeta(editorColorsScheme)); RainbowHighlighter.setRainbowEnabled(editorColorsScheme, Language.ANY, nonDefaultRainbow); assertEquals(nonDefaultRainbow, (boolean)RainbowHighlighter.isRainbowEnabled(editorColorsScheme, Language.ANY)); EditorColorSchemeTestCase.assertXmlOutputEquals( BEGIN + " <property name=\"rainbow " + Language.ANY.getID() + "\">" + nonDefaultRainbow + "</property>\n" + " <property name=\"rainbow Default language\">" + nonDefaultRainbow + "</property>\n" + END, serializeWithFixedMeta(editorColorsScheme)); RainbowHighlighter.setRainbowEnabled(editorColorsScheme, Language.ANY, null); assertNull(RainbowHighlighter.isRainbowEnabled(editorColorsScheme, Language.ANY)); assertEquals(nonDefaultRainbow, RainbowHighlighter.isRainbowEnabledWithInheritance(editorColorsScheme, Language.ANY)); EditorColorSchemeTestCase.assertXmlOutputEquals( BEGIN + " <property name=\"rainbow Default language\">" + nonDefaultRainbow + "</property>\n" + END, serializeWithFixedMeta(editorColorsScheme)); RainbowHighlighter.setRainbowEnabled(editorColorsScheme, null, RainbowHighlighter.DEFAULT_RAINBOW_ON); assertEquals((boolean)RainbowHighlighter.DEFAULT_RAINBOW_ON, RainbowHighlighter.isRainbowEnabledWithInheritance(editorColorsScheme, null)); assertEquals((boolean)RainbowHighlighter.DEFAULT_RAINBOW_ON, RainbowHighlighter.isRainbowEnabledWithInheritance(editorColorsScheme, Language.ANY)); EditorColorSchemeTestCase.assertXmlOutputEquals( BEGIN + END, serializeWithFixedMeta(editorColorsScheme)); }