From 5f03ff5849f4dbadf196ccb2b9d61ffdaa2eeda0 Mon Sep 17 00:00:00 2001 From: Ekaterina Shliakhovetskaja Date: Tue, 13 Oct 2009 01:30:46 +0400 Subject: [PATCH] Spellchecker: add icon to quickfixes --- .../quickfixes/AcceptWordAsCorrect.java | 5 +++++ .../spellchecker/quickfixes/ShowSuggestions.java | 8 +++++++- .../quickfixes/SpellCheckerQuickFix.java | 3 ++- .../spellchecker/quickfixes/spellcheck.png | Bin 0 -> 737 bytes 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/spellcheck.png diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java index 18a93ed00d80..2d93575065e4 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java @@ -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")); + } } diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/ShowSuggestions.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/ShowSuggestions.java index d41972672461..8c9fe5f5ceb8 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/ShowSuggestions.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/ShowSuggestions.java @@ -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")); + } + } diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/SpellCheckerQuickFix.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/SpellCheckerQuickFix.java index 9bb123f549fd..d9b4d9fc2536 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/SpellCheckerQuickFix.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/SpellCheckerQuickFix.java @@ -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(); diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/spellcheck.png b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/spellcheck.png new file mode 100644 index 0000000000000000000000000000000000000000..308e4a0cd95f5b02330bf9e5d53be672482845ca GIT binary patch literal 737 zcmV<70v`Q|P)IcMaM8nNWv*+#G+d0CJ1_nsHr^`g%*S$Qf}OYiz0Ag5Cpj? zh+-17tPr6G2_{&e6-}f?5T&Wj=vX7p+_~MyX%P(?22p2uINx{9`JKav2>%n}zX~tT zR`K`ok!^fsl5>7i6veHQBo#2mIyvWUrKP2UAP7eoV;39_N8zv9iG|@dA}RwBfruc> zvKzn zg+kF-EY`ZcRUY{^Wdz8E>`a%=008^jD;yql`SiH?(1=m4Gn1d|ty=B?01g0ked?}; zTkiZniR=2*eR|v+CKI_*DtoO;S?81B0l?JBV_M%IS6@%xvQl^`ke6D0Gp!SXJs?QP z;39Nb!m+D+Kk3QUi3qjVvRq8jKL`$_8*zGIB{0rJWJ#&07ZsMv7+@O=@p-#-pfPr7 zWs@X>{oQJ9{>Gd>u9#dimtesJ07xtaijaw^cVBKF^`EUjPFoKB~mlaoVUua|0SYV3-N zik}AU?d>cO2&6=#QKw-TskUu9iAW|QnM+8q4G;hWfX+GBIOm!uikhmb@yg1|1S29$ zPfw$(tBa3~jqz|e%r#9DOw;6+WibE{1c5|Rv}IYgv$L};zu#}Sw6xehpASC(HWeO9 T7736t00000NkvXXu0mjf1p7!6 literal 0 HcmV?d00001