private static void highlightElement(@NotNull PsiElement element) {
    final Project project = element.getProject();
    final FileEditorManager editorManager = FileEditorManager.getInstance(project);
    final HighlightManager highlightManager = HighlightManager.getInstance(project);
    final EditorColorsManager editorColorsManager = EditorColorsManager.getInstance();
    final Editor editor = editorManager.getSelectedTextEditor();
    final EditorColorsScheme globalScheme = editorColorsManager.getGlobalScheme();
    final TextAttributes textattributes =
        globalScheme.getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);
    final PsiElement[] elements = new PsiElement[] {element};
    highlightManager.addOccurrenceHighlights(editor, elements, textattributes, true, null);

    StatusBar.Info.set(
        IntentionPowerPackBundle.message("status.bar.escape.highlighting.message"), project);
  }
Example #2
0
 @Override
 @NotNull
 public String getText() {
   //noinspection UnresolvedPropertyKey
   return IntentionPowerPackBundle.message(getPrefix() + ".name");
 }
 @Override
 protected String getIntentionName() {
   return IntentionPowerPackBundle.message(
       "replace.operator.assignment.with.assignment.intention.name", "+=");
 }
 public void testConditionalAssignment() {
   doTest(
       IntentionPowerPackBundle.message(
           "replace.operator.assignment.with.assignment.intention.name", "*="));
 }
 @Override
 protected String getIntentionName() {
   return IntentionPowerPackBundle.message(
       "replace.fully.qualified.name.with.import.intention.name");
 }
 @Override
 protected String getIntentionName() {
   return IntentionPowerPackBundle.message("remove.unnecessary.parentheses.intention.name");
 }