コード例 #1
0
 private void highlightUsages() {
   if (mySearchResults.getEditor() == null) return;
   if (mySearchResults.getMatchesCount() >= mySearchResults.getMatchesLimit()) return;
   for (FindResult range : mySearchResults.getOccurrences()) {
     TextAttributes attributes =
         EditorColorsManager.getInstance()
             .getGlobalScheme()
             .getAttributes(EditorColors.TEXT_SEARCH_RESULT_ATTRIBUTES);
     if (range.getLength() == 0) {
       attributes = attributes.clone();
       attributes.setEffectType(EffectType.BOXED);
       attributes.setEffectColor(attributes.getBackgroundColor());
     }
     if (mySearchResults.isExcluded(range)) {
       highlightRange(range, strikout(attributes), myHighlighters);
     } else {
       highlightRange(range, attributes, myHighlighters);
     }
   }
   updateInSelectionHighlighters();
   if (!myListeningSelection) {
     mySearchResults.getEditor().getSelectionModel().addSelectionListener(this);
     myListeningSelection = true;
   }
 }