diff --git a/platform/icons/src/nodes/pluginLogo.png b/platform/icons/src/nodes/pluginLogo.png new file mode 100644 index 000000000000..83604cc023ed Binary files /dev/null and b/platform/icons/src/nodes/pluginLogo.png differ 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)); } }