From 6cdf7e47e4bc2164c3e9dbecc4265a8690c43433 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 18 Jun 2014 14:09:14 +0400 Subject: [PATCH] moved plugin-specific project types to the different step --- platform/icons/src/nodes/pluginLogo.png | Bin 0 -> 945 bytes .../util/src/com/intellij/icons/AllIcons.java | 1 + .../newProject/PyCharmNewProjectDialog.java | 2 +- .../actions/AbstractProjectSettingsStep.java | 17 +++++--- .../actions/PluginSpecificProjectsStep.java | 37 ++++++++++++++++++ .../actions/PyCharmNewProjectStep.java | 12 +++++- 6 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 platform/icons/src/nodes/pluginLogo.png create mode 100644 python/ide/src/com/jetbrains/python/newProject/actions/PluginSpecificProjectsStep.java diff --git a/platform/icons/src/nodes/pluginLogo.png b/platform/icons/src/nodes/pluginLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..83604cc023edb80f571ebc7c897c9486f6924b73 GIT binary patch literal 945 zcmV;i15W&jP)5G>QmxifRxHZ!OB zS=m)ycA=#rx|yw9rk3fIi=!u|a{H)F;JjVU|$ z%rzPfp-=oSSQUWIB57{-^#i2)#zE3sDqFIfQnm{)XP}@}0T`>#NU-S>$Uu2Kv1nyb z+!r?lpE-R(h0q+7``bM*^-!f7u2zsiLlUv-;)sQbTLi>5EP4(id3kxh%(bkZm=O)o zSri@7rXFSGN<% z@Lff|6Qa%oVgV3auy`7ec^fU4V1N#FR8Uv3)ZC|yB`;8aYB+Q!nT*sNqY&kztV~!L z`GUPlv5C)IR1>0jEaI90&#wI{7>xHn=ju?uiw1!2r*$Mepe? zjr~f^N6o2Zyg}*IJEWcip{L(j5OX$zVk4_3Jj?|FVBiGzlpM0yDiWMgPc)t&AMR(8 z$(Bqq(Uk5DqJj-!VdS%bh;Z$WP|Oq!MYzTKrU``<_Ju<<_ zXY3}$dT$ex7XVE+Ko=UjcN~TpE9U$Vs!C2dW?ok*!bJgK)P@Y`5C5PGJ77Xn&js*+ z0Hg;*tIFVnFt{P&rvVWr7@$`Z6Z$K9@8*0EA6r#MHw2v@fcVUY;4Q&WRq_3}81M-TJ;>Iqj?dej!|26g%h& zHFLCNsSr>d{zapO0MtT@P|2`4HPX?XF)I|n4M9r>fG6mqb-qqb{s2ZG;!+73F>+D_ z1kD%#8W4Sms6#0W;3Nxxs(7qkDF_15FJod}M$LmnpNd%k;ZOkwLJbHhAm)8VjbUX) zYnSne`E0)2z>y+Gun96KG&=|&h@VLXTDGNQI(Se?eV;6J(-z+e}&z&7MS%)7G` zkc$Zx?&n1O9SVakLQ9Y?&;S=$=5!k-v-)BUdqxBbK;nwl2JPk!rho(dx3}Y;HNA87 T9j1|-00000NkvXXu0mjfZ4IOr literal 0 HcmV?d00001 diff --git a/platform/util/src/com/intellij/icons/AllIcons.java b/platform/util/src/com/intellij/icons/AllIcons.java index 3f2ca2612e2f..142fd651655d 100644 --- a/platform/util/src/com/intellij/icons/AllIcons.java +++ b/platform/util/src/com/intellij/icons/AllIcons.java @@ -836,6 +836,7 @@ public class AllIcons { public static final Icon PinToolWindow = IconLoader.getIcon("/nodes/pinToolWindow.png"); // 13x13 public static final Icon Plugin = IconLoader.getIcon("/nodes/plugin.png"); // 16x16 public static final Icon PluginJB = IconLoader.getIcon("/nodes/pluginJB.png"); // 16x16 + public static final Icon PluginLogo = IconLoader.getIcon("/nodes/pluginLogo.png"); // 32x32 public static final Icon Pluginnotinstalled = IconLoader.getIcon("/nodes/pluginnotinstalled.png"); // 16x16 public static final Icon Pluginobsolete = IconLoader.getIcon("/nodes/pluginobsolete.png"); // 16x16 public static final Icon PluginRestart = IconLoader.getIcon("/nodes/pluginRestart.png"); // 16x16 diff --git a/python/ide/src/com/jetbrains/python/newProject/PyCharmNewProjectDialog.java b/python/ide/src/com/jetbrains/python/newProject/PyCharmNewProjectDialog.java index 61e7ecb0fdc9..30d07cac0073 100644 --- a/python/ide/src/com/jetbrains/python/newProject/PyCharmNewProjectDialog.java +++ b/python/ide/src/com/jetbrains/python/newProject/PyCharmNewProjectDialog.java @@ -53,7 +53,7 @@ public class PyCharmNewProjectDialog extends DialogWrapper { @Override public Dimension getMinimumSize() { - return new Dimension(800, 500); + return new Dimension(650, 350); } }; } diff --git a/python/ide/src/com/jetbrains/python/newProject/actions/AbstractProjectSettingsStep.java b/python/ide/src/com/jetbrains/python/newProject/actions/AbstractProjectSettingsStep.java index f276ccd6648f..9f8169e3c986 100644 --- a/python/ide/src/com/jetbrains/python/newProject/actions/AbstractProjectSettingsStep.java +++ b/python/ide/src/com/jetbrains/python/newProject/actions/AbstractProjectSettingsStep.java @@ -24,6 +24,7 @@ import com.intellij.platform.DirectoryProjectGenerator; import com.intellij.platform.WebProjectGenerator; import com.intellij.ui.DocumentAdapter; import com.intellij.ui.JBColor; +import com.intellij.ui.components.JBScrollPane; import com.intellij.util.NullableConsumer; import com.intellij.util.ui.CenteredIcon; import com.jetbrains.python.PythonSdkChooserCombo; @@ -103,14 +104,20 @@ abstract public class AbstractProjectSettingsStep extends AbstractActionWithPane @Override public JPanel createPanel() { final JPanel mainPanel = new JPanel(new BorderLayout()); - mainPanel.setPreferredSize(new Dimension(mainPanel.getPreferredSize().width, 450)); + final JPanel scrollPanel = new JPanel(new BorderLayout()); + + mainPanel.setPreferredSize(new Dimension(mainPanel.getPreferredSize().width, 300)); final JPanel panel = createBasePanel(); - mainPanel.add(panel, BorderLayout.NORTH); - + scrollPanel.add(panel, BorderLayout.NORTH); final JPanel advancedSettings = createAdvancedSettings(); - if (advancedSettings != null) - mainPanel.add(advancedSettings, BorderLayout.CENTER); + if (advancedSettings != null) { + scrollPanel.add(advancedSettings, BorderLayout.CENTER); + } + final JBScrollPane scrollPane = new JBScrollPane(scrollPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, + ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setBorder(null); + mainPanel.add(scrollPane, BorderLayout.CENTER); final JPanel bottomPanel = new JPanel(new BorderLayout()); myCreateButton = new Button(myCreateAction, myCreateAction.getTemplatePresentation()); diff --git a/python/ide/src/com/jetbrains/python/newProject/actions/PluginSpecificProjectsStep.java b/python/ide/src/com/jetbrains/python/newProject/actions/PluginSpecificProjectsStep.java new file mode 100644 index 000000000000..a0c5f6e52fbf --- /dev/null +++ b/python/ide/src/com/jetbrains/python/newProject/actions/PluginSpecificProjectsStep.java @@ -0,0 +1,37 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.jetbrains.python.newProject.actions; + +import com.intellij.icons.AllIcons; +import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.openapi.project.DumbAware; +import com.intellij.platform.DirectoryProjectGenerator; +import com.intellij.util.NullableConsumer; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class PluginSpecificProjectsStep extends DefaultActionGroup implements DumbAware { + + public PluginSpecificProjectsStep(@NotNull final NullableConsumer callback, + @NotNull final List projectGenerators) { + super("Plugin-specific", true); + getTemplatePresentation().setIcon(AllIcons.Nodes.PluginLogo); + for (DirectoryProjectGenerator generator : projectGenerators) { + add(new ProjectSpecificAction(callback, generator)); + } + } +} diff --git a/python/ide/src/com/jetbrains/python/newProject/actions/PyCharmNewProjectStep.java b/python/ide/src/com/jetbrains/python/newProject/actions/PyCharmNewProjectStep.java index acdb46cc7d07..b6134ed5f070 100644 --- a/python/ide/src/com/jetbrains/python/newProject/actions/PyCharmNewProjectStep.java +++ b/python/ide/src/com/jetbrains/python/newProject/actions/PyCharmNewProjectStep.java @@ -15,6 +15,7 @@ */ package com.jetbrains.python.newProject.actions; +import com.google.common.collect.Lists; import com.intellij.ide.GeneralSettings; import com.intellij.ide.util.projectWizard.WebProjectTemplate; import com.intellij.internal.statistic.UsageTrigger; @@ -172,8 +173,17 @@ public class PyCharmNewProjectStep extends DefaultActionGroup implements DumbAwa return o1.getName().compareTo(o2.getName()); } }); + + List pluginSpecificGenerators = Lists.newArrayList(); for (DirectoryProjectGenerator generator : generators) { - add(new ProjectSpecificAction(callback, generator)); + if (generator instanceof PythonProjectGenerator) + add(new ProjectSpecificAction(callback, generator)); + else + pluginSpecificGenerators.add(generator); + } + + if (!pluginSpecificGenerators.isEmpty()) { + add(new PluginSpecificProjectsStep(callback, pluginSpecificGenerators)); } }