From 6cc553fe509de18b2e5371feb2a4dfe7427ef0cf Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Wed, 4 Jun 2014 15:37:22 +0400 Subject: [PATCH] cleanup --- .../options/colors/SchemesPanel.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java index c373fa2b28f2..e21f1dc9e73e 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/SchemesPanel.java @@ -29,7 +29,7 @@ import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.options.SchemesManager; import com.intellij.util.Consumer; import com.intellij.util.EventDispatcher; -import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; @@ -61,7 +61,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { mySchemeComboBox.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(@NotNull ActionEvent e) { if (mySchemeComboBox.getSelectedIndex() != -1) { EditorColorsScheme selected = myOptions.selectScheme((String)mySchemeComboBox.getSelectedItem()); if (ColorAndFontOptions.isReadOnly(selected)) { @@ -97,16 +97,6 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { return myListLoaded; } - public void clearSearch() { - } - - @Nullable - @SuppressWarnings({"unchecked"}) - public static T safeCast(final Object obj, final Class expectedClass) { - if (expectedClass.isInstance(obj)) return (T)obj; - return null; - } - private JPanel createSchemePanel() { JPanel panel = new JPanel(new GridBagLayout()); @@ -124,7 +114,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { JButton saveAsButton = new JButton(ApplicationBundle.message("button.save.as")); saveAsButton.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(@NotNull ActionEvent e) { showSaveAsDialog(); } }); @@ -135,7 +125,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { myDeleteButton = new JButton(ApplicationBundle.message("button.delete")); myDeleteButton.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(@NotNull ActionEvent e) { if (mySchemeComboBox.getSelectedIndex() != -1) { myOptions.removeScheme((String)mySchemeComboBox.getSelectedItem()); } @@ -151,7 +141,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { myExportButton = new JButton("Share..."); myExportButton.addActionListener(new ActionListener() { @Override - public void actionPerformed(final ActionEvent e) { + public void actionPerformed(@NotNull final ActionEvent e) { EditorColorsScheme selected = myOptions.getOriginalSelectedScheme(); ExportSchemeAction .doExport((EditorColorsSchemeImpl)selected, ((EditorColorsManagerImpl)EditorColorsManager.getInstance()).getSchemesManager()); @@ -170,7 +160,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { myImportButton.setMnemonic('I'); myImportButton.addActionListener(new ActionListener() { @Override - public void actionPerformed(final ActionEvent e) { + public void actionPerformed(@NotNull final ActionEvent e) { SchemesToImportPopup popup = new SchemesToImportPopup(SchemesPanel.this) { @Override @@ -196,7 +186,7 @@ public class SchemesPanel extends JPanel implements SkipSelfSearchComponent { final JButton button = new JButton(importHandler.getTitle()); button.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { + public void actionPerformed(@NotNull ActionEvent e) { importHandler.performImport(button, new Consumer() { @Override public void consume(EditorColorsScheme scheme) {