Start plugins wizard #20 icons for categories
authorVassiliy <vassiliy.kudryashov@jetbrains.com>
Fri, 25 Apr 2014 10:22:07 +0000 (14:22 +0400)
committerVassiliy <vassiliy.kudryashov@jetbrains.com>
Fri, 25 Apr 2014 10:22:47 +0000 (14:22 +0400)
27 files changed:
community-resources/src/plugins/Android.png [new file with mode: 0644]
community-resources/src/plugins/Android@2x.png [new file with mode: 0644]
community-resources/src/plugins/ApplicationServers.png [new file with mode: 0644]
community-resources/src/plugins/ApplicationServers@2x.png [new file with mode: 0644]
community-resources/src/plugins/BuildTools.png [new file with mode: 0644]
community-resources/src/plugins/BuildTools@2x.png [new file with mode: 0644]
community-resources/src/plugins/Clouds.png [new file with mode: 0644]
community-resources/src/plugins/Clouds@2x.png [new file with mode: 0644]
community-resources/src/plugins/DatabaseTools.png [new file with mode: 0644]
community-resources/src/plugins/DatabaseTools@2x.png [new file with mode: 0644]
community-resources/src/plugins/JavaFrameworks.png [new file with mode: 0644]
community-resources/src/plugins/JavaFrameworks@2x.png [new file with mode: 0644]
community-resources/src/plugins/OtherTools.png [new file with mode: 0644]
community-resources/src/plugins/OtherTools@2x.png [new file with mode: 0644]
community-resources/src/plugins/PluginDevelopment.png [new file with mode: 0644]
community-resources/src/plugins/PluginDevelopment@2x.png [new file with mode: 0644]
community-resources/src/plugins/Swing.png [new file with mode: 0644]
community-resources/src/plugins/Swing@2x.png [new file with mode: 0644]
community-resources/src/plugins/TestTools.png [new file with mode: 0644]
community-resources/src/plugins/TestTools@2x.png [new file with mode: 0644]
community-resources/src/plugins/VersionControls.png [new file with mode: 0644]
community-resources/src/plugins/VersionControls@2x.png [new file with mode: 0644]
community-resources/src/plugins/WebDevelopment.png [new file with mode: 0644]
community-resources/src/plugins/WebDevelopment@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/customize/CustomizePluginsStepPanel.java
platform/platform-impl/src/com/intellij/ide/customize/IdSet.java
platform/platform-impl/src/com/intellij/ide/customize/PluginGroups.java

diff --git a/community-resources/src/plugins/Android.png b/community-resources/src/plugins/Android.png
new file mode 100644 (file)
index 0000000..9d55c0e
Binary files /dev/null and b/community-resources/src/plugins/Android.png differ
diff --git a/community-resources/src/plugins/Android@2x.png b/community-resources/src/plugins/Android@2x.png
new file mode 100644 (file)
index 0000000..e3d989d
Binary files /dev/null and b/community-resources/src/plugins/Android@2x.png differ
diff --git a/community-resources/src/plugins/ApplicationServers.png b/community-resources/src/plugins/ApplicationServers.png
new file mode 100644 (file)
index 0000000..a6195b8
Binary files /dev/null and b/community-resources/src/plugins/ApplicationServers.png differ
diff --git a/community-resources/src/plugins/ApplicationServers@2x.png b/community-resources/src/plugins/ApplicationServers@2x.png
new file mode 100644 (file)
index 0000000..d6901f8
Binary files /dev/null and b/community-resources/src/plugins/ApplicationServers@2x.png differ
diff --git a/community-resources/src/plugins/BuildTools.png b/community-resources/src/plugins/BuildTools.png
new file mode 100644 (file)
index 0000000..c16226f
Binary files /dev/null and b/community-resources/src/plugins/BuildTools.png differ
diff --git a/community-resources/src/plugins/BuildTools@2x.png b/community-resources/src/plugins/BuildTools@2x.png
new file mode 100644 (file)
index 0000000..ecd58cf
Binary files /dev/null and b/community-resources/src/plugins/BuildTools@2x.png differ
diff --git a/community-resources/src/plugins/Clouds.png b/community-resources/src/plugins/Clouds.png
new file mode 100644 (file)
index 0000000..9da8c7f
Binary files /dev/null and b/community-resources/src/plugins/Clouds.png differ
diff --git a/community-resources/src/plugins/Clouds@2x.png b/community-resources/src/plugins/Clouds@2x.png
new file mode 100644 (file)
index 0000000..5338f61
Binary files /dev/null and b/community-resources/src/plugins/Clouds@2x.png differ
diff --git a/community-resources/src/plugins/DatabaseTools.png b/community-resources/src/plugins/DatabaseTools.png
new file mode 100644 (file)
index 0000000..459b90e
Binary files /dev/null and b/community-resources/src/plugins/DatabaseTools.png differ
diff --git a/community-resources/src/plugins/DatabaseTools@2x.png b/community-resources/src/plugins/DatabaseTools@2x.png
new file mode 100644 (file)
index 0000000..8b7fbbf
Binary files /dev/null and b/community-resources/src/plugins/DatabaseTools@2x.png differ
diff --git a/community-resources/src/plugins/JavaFrameworks.png b/community-resources/src/plugins/JavaFrameworks.png
new file mode 100644 (file)
index 0000000..1ba077c
Binary files /dev/null and b/community-resources/src/plugins/JavaFrameworks.png differ
diff --git a/community-resources/src/plugins/JavaFrameworks@2x.png b/community-resources/src/plugins/JavaFrameworks@2x.png
new file mode 100644 (file)
index 0000000..1b9e872
Binary files /dev/null and b/community-resources/src/plugins/JavaFrameworks@2x.png differ
diff --git a/community-resources/src/plugins/OtherTools.png b/community-resources/src/plugins/OtherTools.png
new file mode 100644 (file)
index 0000000..5fb7ae5
Binary files /dev/null and b/community-resources/src/plugins/OtherTools.png differ
diff --git a/community-resources/src/plugins/OtherTools@2x.png b/community-resources/src/plugins/OtherTools@2x.png
new file mode 100644 (file)
index 0000000..fa3b202
Binary files /dev/null and b/community-resources/src/plugins/OtherTools@2x.png differ
diff --git a/community-resources/src/plugins/PluginDevelopment.png b/community-resources/src/plugins/PluginDevelopment.png
new file mode 100644 (file)
index 0000000..68a4a9c
Binary files /dev/null and b/community-resources/src/plugins/PluginDevelopment.png differ
diff --git a/community-resources/src/plugins/PluginDevelopment@2x.png b/community-resources/src/plugins/PluginDevelopment@2x.png
new file mode 100644 (file)
index 0000000..f02ae30
Binary files /dev/null and b/community-resources/src/plugins/PluginDevelopment@2x.png differ
diff --git a/community-resources/src/plugins/Swing.png b/community-resources/src/plugins/Swing.png
new file mode 100644 (file)
index 0000000..f0b032a
Binary files /dev/null and b/community-resources/src/plugins/Swing.png differ
diff --git a/community-resources/src/plugins/Swing@2x.png b/community-resources/src/plugins/Swing@2x.png
new file mode 100644 (file)
index 0000000..a071268
Binary files /dev/null and b/community-resources/src/plugins/Swing@2x.png differ
diff --git a/community-resources/src/plugins/TestTools.png b/community-resources/src/plugins/TestTools.png
new file mode 100644 (file)
index 0000000..9d79fa4
Binary files /dev/null and b/community-resources/src/plugins/TestTools.png differ
diff --git a/community-resources/src/plugins/TestTools@2x.png b/community-resources/src/plugins/TestTools@2x.png
new file mode 100644 (file)
index 0000000..95af9f2
Binary files /dev/null and b/community-resources/src/plugins/TestTools@2x.png differ
diff --git a/community-resources/src/plugins/VersionControls.png b/community-resources/src/plugins/VersionControls.png
new file mode 100644 (file)
index 0000000..be67616
Binary files /dev/null and b/community-resources/src/plugins/VersionControls.png differ
diff --git a/community-resources/src/plugins/VersionControls@2x.png b/community-resources/src/plugins/VersionControls@2x.png
new file mode 100644 (file)
index 0000000..427637d
Binary files /dev/null and b/community-resources/src/plugins/VersionControls@2x.png differ
diff --git a/community-resources/src/plugins/WebDevelopment.png b/community-resources/src/plugins/WebDevelopment.png
new file mode 100644 (file)
index 0000000..d9e7430
Binary files /dev/null and b/community-resources/src/plugins/WebDevelopment.png differ
diff --git a/community-resources/src/plugins/WebDevelopment@2x.png b/community-resources/src/plugins/WebDevelopment@2x.png
new file mode 100644 (file)
index 0000000..52f6be4
Binary files /dev/null and b/community-resources/src/plugins/WebDevelopment@2x.png differ
index 055a1d67e2cf5d89ed15af851f62d379212c95ee..6b6abf833fa9db2d6847b110194a13b366c610a4 100644 (file)
@@ -17,6 +17,8 @@ package com.intellij.ide.customize;
 
 import com.intellij.openapi.application.ApplicationNamesInfo;
 import com.intellij.openapi.ui.VerticalFlowLayout;
+import com.intellij.openapi.util.IconLoader;
+import com.intellij.openapi.util.Pair;
 import com.intellij.ui.ColorUtil;
 import com.intellij.ui.JBCardLayout;
 import com.intellij.ui.JBColor;
@@ -60,8 +62,8 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple
     add(scrollPane, MAIN);
     add(myCustomizePanel, CUSTOMIZE);
 
-    Map<String, List<String>> groups = PluginGroups.getInstance().getTree();
-    for (Map.Entry<String, List<String>> entry : groups.entrySet()) {
+    Map<String, Pair<String, List<String>>> groups = PluginGroups.getInstance().getTree();
+    for (final Map.Entry<String, Pair<String, List<String>>> entry : groups.entrySet()) {
       final String group = entry.getKey();
       if (PluginGroups.CORE.equals(group)) continue;
 
@@ -74,18 +76,19 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple
       };
       gridPanel.setOpaque(true);
       GridBagConstraints gbc = new GridBagConstraints();
-      gbc.insets = new Insets(0, 0, 10, 0);
       gbc.fill = GridBagConstraints.BOTH;
       gbc.gridwidth = GridBagConstraints.REMAINDER;
       gbc.weightx = 1;
-      JLabel titleLabel = new JLabel("<html><body><h2 style=\"text-align:left;\">" + group + "</h2></body></html>") {
+      JLabel titleLabel = new JLabel("<html><body><h2 style=\"text-align:left;\">" + group + "</h2></body></html>", SwingConstants.CENTER) {
         @Override
         public boolean isEnabled() {
           return isGroupEnabled(group);
         }
       };
+      groupPanel.add(new JLabel(IconLoader.getIcon(entry.getValue().getFirst())), gbc);
+      //gbc.insets.bottom = 5;
       groupPanel.add(titleLabel, gbc);
-      JLabel descriptionLabel = new JLabel(PluginGroups.getInstance().getDescription(group)) {
+      JLabel descriptionLabel = new JLabel(PluginGroups.getInstance().getDescription(group), SwingConstants.CENTER) {
         @Override
         public Dimension getPreferredSize() {
           Dimension size = super.getPreferredSize();
@@ -107,18 +110,16 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple
       gbc.weighty = 1;
       groupPanel.add(Box.createVerticalGlue(), gbc);
       gbc.weighty = 0;
+      JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 5));
+      buttonsPanel.setOpaque(false);
       if (PluginGroups.getInstance().getSets(group).size() == 1) {
-        groupPanel.add(createLink(SWITCH_COMMAND + ":" + group, getGroupSwitchTextProvider(group)), gbc);
+        buttonsPanel.add(createLink(SWITCH_COMMAND + ":" + group, getGroupSwitchTextProvider(group)));
       }
       else {
-        JPanel buttonsPanel = new JPanel(new GridLayout(1, 2, 10, 5));
-        buttonsPanel.setOpaque(false);
-        LinkLabel customizeButton = createLink(CUSTOMIZE_COMMAND + ":" + group, CUSTOMIZE_TEXT_PROVIDER);
-        buttonsPanel.add(customizeButton);
-        LinkLabel disableAllButton = createLink(SWITCH_COMMAND + ":" + group, getGroupSwitchTextProvider(group));
-        buttonsPanel.add(disableAllButton);
-        groupPanel.add(buttonsPanel, gbc);
+        buttonsPanel.add(createLink(CUSTOMIZE_COMMAND + ":" + group, CUSTOMIZE_TEXT_PROVIDER));
+        buttonsPanel.add(createLink(SWITCH_COMMAND + ":" + group, getGroupSwitchTextProvider(group)));
       }
+      groupPanel.add(buttonsPanel, gbc);
       gridPanel.add(groupPanel);
     }
 
@@ -133,7 +134,7 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple
           protected Color getColor() {
             return ColorUtil.withAlpha(JBColor.foreground(), .2);
           }
-        }, BorderFactory.createEmptyBorder(GAP, GAP, GAP, GAP)));
+        }, BorderFactory.createEmptyBorder(GAP / 2, GAP, GAP / 2, GAP)));
       cursor++;
     }
   }
index 66a0b462908addc89f4d30bede2cd9709428bbf0..af4da5358aacb5014ace2e74328ece58906232a8 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Arrays;
 import java.util.List;
 
 class IdSet {
-  private static final List<String> BLACK_LIST = Arrays.asList("Support", "Integration", "integration");
+  private static final List<String> BLACK_LIST = Arrays.asList("Support", "support", "Integration", "integration");
 
   String myTitle;
   String[] myIds;
index e3af6525cda506cb7240fb06b5712fbb815175c1..3712905f766b89ec1eb11bec079d3c4cfeb62f71 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.idea.StartupUtil;
 import com.intellij.openapi.application.PathManager;
 import com.intellij.openapi.extensions.PluginId;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.containers.ContainerUtil;
@@ -32,12 +33,12 @@ import java.util.*;
 
 class PluginGroups {
   static final String CORE = "Core";
-  private static final int MAX_DESCR_LENGTH = 50;
+  private static final int MAX_DESCR_LENGTH = 55;
 
 
   private static PluginGroups instance = null;
 
-  final Map<String, List<String>> myTree = new LinkedHashMap<String, List<String>>();
+  final Map<String, Pair<String, List<String>>> myTree = new LinkedHashMap<String, Pair<String, List<String>>>();
   final Map<String, String> myFeaturedPlugins = new LinkedHashMap<String, String>();
 
   private final Map<String, List<IdSet>> myGroups = new LinkedHashMap<String, List<IdSet>>();
@@ -67,7 +68,7 @@ class PluginGroups {
     PluginManager.loadDisabledPlugins(new File(PathManager.getConfigPath()).getPath(), myDisabledPluginIds);
 
 
-    myTree.put(CORE, Arrays.asList(
+    myTree.put(CORE, Pair.create((String)null, Arrays.asList(
       "com.intellij.copyright",
       "com.intellij.java-i18n",
       "org.intellij.intelliLang",
@@ -76,8 +77,8 @@ class PluginGroups {
       "Structural Search",
       "Type Migration",
       "ZKM"
-    ));
-    myTree.put("Java Frameworks", Arrays.asList(
+    )));
+    myTree.put("Java Frameworks", Pair.create("/plugins/JavaFrameworks.png", Arrays.asList(
       "com.intellij.appengine",
       "org.intellij.grails",
       "com.intellij.gwt",
@@ -112,13 +113,13 @@ class PluginGroups {
       "GuiceyIDEA",
       "com.intellij.aspectj",
       "Osmorc"
-    ));
-    myTree.put("Build Tools", Arrays.asList(
+    )));
+    myTree.put("Build Tools", Pair.create("/plugins/BuildTools.png", Arrays.asList(
       "AntSupport",
       "Maven:org.jetbrains.idea.maven,org.jetbrains.idea.maven.ext",
       "org.jetbrains.plugins.gradle"
-    ));
-    myTree.put("Web Development", Arrays.asList(
+    )));
+    myTree.put("Web Development", Pair.create("/plugins/WebDevelopment.png", Arrays.asList(
       "HTML:HtmlTools,QuirksMode,W3Validators",
       "org.jetbrains.plugins.haml",
       "com.jetbrains.plugins.jade",
@@ -131,8 +132,8 @@ class PluginGroups {
       "com.intellij.flex",
       "com.intellij.plugins.html.instantEditing",
       "com.jetbrains.restClient"
-    ));
-    myTree.put("Version Controls", Arrays.asList(
+    )));
+    myTree.put("Version Controls", Pair.create("/plugins/VersionControls.png", Arrays.asList(
       "ClearcasePlugin",
       "CVS",
       "Git4Idea",
@@ -141,15 +142,15 @@ class PluginGroups {
       "PerforceDirectPlugin",
       "Subversion",
       "TFS"
-    ));
-    myTree.put("Test Tools", Arrays.asList(
+    )));
+    myTree.put("Test Tools", Pair.create("/plugins/TestTools.png", Arrays.asList(
       "JUnit",
       "TestNG-J",
       "cucumber-java",
       "cucumber",
       "Coverage:Coverage,Emma"
-    ));
-    myTree.put("Application Servers", Arrays.asList(
+    )));
+    myTree.put("Application Servers", Pair.create("/plugins/ApplicationServers.png", Arrays.asList(
       "com.intellij.javaee.view",
       "Geronimo",
       "GlassFish",
@@ -161,26 +162,26 @@ class PluginGroups {
       "WebSphere",
       "com.intellij.dmserver",
       "JSR45Plugin"
-    ));
-    myTree.put("Clouds", Arrays.asList(
+    )));
+    myTree.put("Clouds", Pair.create("/plugins/Clouds.png", Arrays.asList(
       "CloudFoundry",
       "CloudBees",
       "Heroku",
       "OpenShift"
-    ));
+    )));
     //myTree.put("Groovy", Arrays.asList("org.intellij.grails"));
     //TODO Scala -> Play 2.x (Play 2.0 Support)
-    myTree.put("Swing", Arrays.asList(
+    myTree.put("Swing", Pair.create("/plugins/Swing.png", Arrays.asList(
       "com.intellij.uiDesigner"//TODO JavaFX?
-    ));
-    myTree.put("Android", Arrays.asList(
+    )));
+    myTree.put("Android", Pair.create("/plugins/Android.png", Arrays.asList(
       "org.jetbrains.android",
-      "com.intellij.android-designer"));
-    myTree.put("Database Tools", Arrays.asList(
+      "com.intellij.android-designer")));
+    myTree.put("Database Tools", Pair.create("/plugins/DatabaseTools.png", Arrays.asList(
       "com.intellij.sql",
       "com.intellij.persistence.database"
-    ));
-    myTree.put("Other Tools", Arrays.asList(
+    )));
+    myTree.put("Other Tools", Pair.create("/plugins/OtherTools.png", Arrays.asList(
       "ByteCodeViewer",
       "com.intellij.dsm",
       "org.jetbrains.idea.eclipse",
@@ -190,8 +191,8 @@ class PluginGroups {
       "com.intellij.diagram",
       "org.jetbrains.plugins.yaml",
       "XSLT and XPath:XPathView,XSLT-Debugger"
-    ));
-    myTree.put("Plugin Development", Arrays.asList("DevKit"));
+    )));
+    myTree.put("Plugin Development", Pair.create("/plugins/PluginDevelopment.png", Arrays.asList("DevKit")));
 
     myFeaturedPlugins.put("Scala", "Custom Languages:Plugin for Scala language support:org.intellij.scala");
     myFeaturedPlugins.put("Live Edit Tool", "Web Development:Provides live edit HTML/CSS/JavaScript:com.intellij.plugins.html.instantEditing");
@@ -204,13 +205,13 @@ class PluginGroups {
   private void initIfNeed() {
     if (myInitialized) return;
     myInitialized = true;
-    for (Map.Entry<String, List<String>> entry : myTree.entrySet()) {
+    for (Map.Entry<String, Pair<String, List<String>>> entry : myTree.entrySet()) {
       final String group = entry.getKey();
       if (CORE.equals(group)) continue;
 
       List<IdSet> idSets = new ArrayList<IdSet>();
       StringBuilder description = new StringBuilder();
-      for (String idDescription : entry.getValue()) {
+      for (String idDescription : entry.getValue().getSecond()) {
         IdSet idSet = new IdSet(idDescription);
         String idSetTitle = idSet.getTitle();
         if (idSetTitle == null) continue;
@@ -226,12 +227,12 @@ class PluginGroups {
         int lastWord = description.lastIndexOf(",", MAX_DESCR_LENGTH);
         description.delete(lastWord, description.length()).append("...");
       }
-      description.insert(0, "<html><body><i>");
+      description.insert(0, "<html><body><center><i>");
       myDescriptions.put(group, description.toString());
     }
   }
 
-  Map<String, List<String>> getTree() {
+  Map<String, Pair<String, List<String>>> getTree() {
     initIfNeed();
     return myTree;
   }