mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Spellchecker: add icon to quickfixes
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -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 |
Reference in New Issue
Block a user