From f02458fc17eb376e3caba7d13485832abdd678c1 Mon Sep 17 00:00:00 2001 From: Olga Strizhenko Date: Tue, 28 Nov 2017 05:37:45 +0300 Subject: [PATCH] Spellchecker:(minor) anonymous -> lambda --- .../settings/SpellCheckerSettingsPane.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/spellchecker/src/com/intellij/spellchecker/settings/SpellCheckerSettingsPane.java b/spellchecker/src/com/intellij/spellchecker/settings/SpellCheckerSettingsPane.java index 6af6a2804d76..d49868b5e294 100644 --- a/spellchecker/src/com/intellij/spellchecker/settings/SpellCheckerSettingsPane.java +++ b/spellchecker/src/com/intellij/spellchecker/settings/SpellCheckerSettingsPane.java @@ -40,7 +40,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; import java.awt.*; import java.util.*; import java.util.List; @@ -64,16 +63,14 @@ public class SpellCheckerSettingsPane implements Disposable { this.settings = settings; manager = SpellCheckerManager.getInstance(project); HyperlinkLabel link = new HyperlinkLabel(SpellCheckerBundle.message("link.to.inspection.settings")); - link.addHyperlinkListener(new HyperlinkListener() { - public void hyperlinkUpdate(final HyperlinkEvent e) { - if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { - Settings allSettings = Settings.KEY.getData(DataManager.getInstance().getDataContext()); - if (allSettings != null) { - final ErrorsConfigurable errorsConfigurable = allSettings.find(ErrorsConfigurable.class); - if (errorsConfigurable != null) { - allSettings.select(errorsConfigurable).doWhenDone( - () -> errorsConfigurable.selectInspectionTool(SpellCheckingInspection.SPELL_CHECKING_INSPECTION_TOOL_NAME)); - } + link.addHyperlinkListener(e -> { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + Settings allSettings = Settings.KEY.getData(DataManager.getInstance().getDataContext()); + if (allSettings != null) { + final ErrorsConfigurable errorsConfigurable = allSettings.find(ErrorsConfigurable.class); + if (errorsConfigurable != null) { + allSettings.select(errorsConfigurable).doWhenDone( + () -> errorsConfigurable.selectInspectionTool(SpellCheckingInspection.SPELL_CHECKING_INSPECTION_TOOL_NAME)); } } }