CPP-3150 Warn users about Vim plugin on Welcome screen

* better warning layout
This commit is contained in:
Anton Makeev
2015-05-05 15:59:24 +02:00
parent 11c545f63c
commit 94abd383f8
2 changed files with 21 additions and 6 deletions
@@ -36,6 +36,7 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -98,12 +99,10 @@ public class CustomizeFeaturedPluginsStepPanel extends AbstractCustomizeWizardSt
JLabel descriptionLabel = createHTMLLabel("<i>" + description + "</i>");
JLabel warningLabel = null;
if (isVIM) {
warningLabel = createHTMLLabel("This plugin enables Vim-keymap and 'insert' mode for editing. " +
"If you are not familiar with Vim, it's not recommended to install it.");
warningLabel = createHTMLLabel("Enables Vim-keymap and 'insert' mode for editing. " +
"Not recommended if you are unfamiliar with Vim.");
if (SystemInfo.isMac) UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, warningLabel);
warningLabel.setBackground(new JBColor(ColorUtil.fromHex("F6F199"), ColorUtil.fromHex("52503A")));
warningLabel.setOpaque(true);
}
final CardLayout wrapperLayout = new CardLayout();
@@ -229,7 +228,23 @@ public class CustomizeFeaturedPluginsStepPanel extends AbstractCustomizeWizardSt
gbc.weighty = 1;
groupPanel.add(Box.createVerticalGlue(), gbc);
gbc.weighty = 0;
if (warningLabel != null) groupPanel.add(warningLabel, gbc);
if (warningLabel != null) {
Insets insetsBefore = gbc.insets;
gbc.insets = new Insets(0, -10, SMALL_GAP, -10);
JPanel warningPanel = new JPanel(new BorderLayout()) {
@Override
public Color getBackground() {
return new JBColor(ColorUtil.fromHex("F6F199"), ColorUtil.fromHex("52503A"));
}
};
warningPanel.setBorder(new EmptyBorder(5, 10, 5, 10));
warningPanel.add(warningLabel);
groupPanel.add(warningPanel, gbc);
gbc.insets = insetsBefore;
}
gbc.insets.bottom = 0;
groupPanel.add(buttonWrapper, gbc);
gridPanel.add(groupPanel);
}
@@ -204,7 +204,7 @@ public class PluginGroups {
}
protected static void addVimPlugin(Map<String, String> featuredPlugins) {
featuredPlugins.put("IdeaVIM", "Editor:Emulates Vim behavior and shortcuts:" + IDEA_VIM_PLUGIN_ID);
featuredPlugins.put("IdeaVIM", "Editor:Emulates Vim editor:" + IDEA_VIM_PLUGIN_ID);
}
protected static void addLuaPlugin(Map<String, String> featuredPlugins) {