void (HighlightManager highlightManager) { final Editor sampleEditor = mySampleText.getEditor(); if (sampleEditor != null) { for (RangeHighlighter highlighter : mySampleHighlights) { highlightManager.removeSegmentHighlighter(sampleEditor, highlighter); } mySampleHighlights.clear(); } final Editor regExpEditor = myRegExp.getEditor(); if (myRegExpHighlight != null && regExpEditor != null) { highlightManager.removeSegmentHighlighter(regExpEditor, myRegExpHighlight); myRegExpHighlight = null; } }