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;
   }
 }
Esempio n. 2
0
 private static TextAttributes getTestAttributesForRemoval() {
   final TextAttributes textAttributes = new TextAttributes();
   textAttributes.setEffectType(EffectType.STRIKEOUT);
   textAttributes.setEffectColor(Color.BLACK);
   return textAttributes;
 }
Esempio n. 3
0
 private static TextAttributes getTextAttributesForAdd() {
   final TextAttributes textAttributes = new TextAttributes();
   textAttributes.setEffectType(EffectType.ROUNDED_BOX);
   textAttributes.setEffectColor(JBColor.RED);
   return textAttributes;
 }
 private static TextAttributes strikout(TextAttributes attributes) {
   TextAttributes textAttributes = attributes.clone();
   textAttributes.setEffectColor(Color.BLACK);
   textAttributes.setEffectType(EffectType.STRIKEOUT);
   return textAttributes;
 }
 static {
   UNRESOLVED_ACCESS_ATTRIBUTES.setForegroundColor(Color.BLACK);
   UNRESOLVED_ACCESS_ATTRIBUTES.setEffectColor(Color.GRAY);
   UNRESOLVED_ACCESS_ATTRIBUTES.setEffectType(EffectType.LINE_UNDERSCORE);
 }