Spellchecker: add icon to quickfixes

This commit is contained in:
Ekaterina Shliakhovetskaja
2009-10-13 01:32:38 +04:00
parent eb9cf447a7
commit 5f03ff5849
4 changed files with 14 additions and 2 deletions
@@ -23,6 +23,8 @@ import com.intellij.spellchecker.SpellCheckerManager;
import com.intellij.spellchecker.util.SpellCheckerBundle;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
public class AcceptWordAsCorrect implements SpellCheckerQuickFix {
private String word;
@@ -51,4 +53,7 @@ public class AcceptWordAsCorrect implements SpellCheckerQuickFix {
spellCheckerManager.acceptWordAsCorrect(word);
}
public Icon getIcon(int flags) {
return new ImageIcon(ShowSuggestions.class.getResource("spellcheck.png"));
}
}
@@ -17,14 +17,16 @@ package com.intellij.spellchecker.quickfixes;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Iconable;
import com.intellij.openapi.util.TextRange;
import com.intellij.spellchecker.SpellCheckerManager;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.util.List;
public abstract class ShowSuggestions implements LocalQuickFix {
public abstract class ShowSuggestions implements LocalQuickFix, Iconable {
protected TextRange textRange;
protected String word;
@@ -55,4 +57,8 @@ public abstract class ShowSuggestions implements LocalQuickFix {
suggestions = manager.getSuggestions(word);
}
public Icon getIcon(int flags) {
return new ImageIcon(ShowSuggestions.class.getResource("spellcheck.png"));
}
}
@@ -17,9 +17,10 @@ package com.intellij.spellchecker.quickfixes;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.openapi.actionSystem.Anchor;
import com.intellij.openapi.util.Iconable;
import org.jetbrains.annotations.NotNull;
public interface SpellCheckerQuickFix extends LocalQuickFix {
public interface SpellCheckerQuickFix extends LocalQuickFix, Iconable {
@NotNull
Anchor getPopupActionAnchor();
Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B