void (EditorHighlighter highlighter) { ThreadingAssertions.assertEventDispatchThread(); if (myHighlighter != null) { getDocument().removeDocumentListener(myHighlighter); } getDocument().addDocumentListener(highlighter); highlighter.setText(getDocument().getCharsSequence()); myHighlighter = highlighter; myHighlighter.setEditor(this); if (myPanel != null) { reinitSettings(); } }