From 61e5e23660c5bd84c4ece46b860e1dbcced2fd25 Mon Sep 17 00:00:00 2001 From: Alexander Doroshko Date: Tue, 27 Sep 2011 16:51:54 +0400 Subject: [PATCH] New Flex IDE project wizard --- .../ProjectNameWithTypeStep.form | 8 ++-- .../ProjectNameWithTypeStep.java | 39 +++++++++++++++---- resources/src/META-INF/IdeaPlugin.xml | 1 + resources/src/idea/RichPlatformPlugin.xml | 1 - 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.form b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.form index e9cd22082c9c..edd8c49725cc 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.form +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.form @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -56,7 +56,7 @@ - + diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.java index 1b4bb93abad3..e0c9079c278e 100644 --- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.java +++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.java @@ -53,7 +53,7 @@ import java.util.List; public class ProjectNameWithTypeStep extends ProjectNameStep { private JEditorPane myModuleDescriptionPane; private JList myTypesList; - private JCheckBox myCreateModuleCb; + protected JCheckBox myCreateModuleCb; private JPanel myModulePanel; private JPanel myInternalPanel; private JTextField myModuleName; @@ -61,6 +61,11 @@ public class ProjectNameWithTypeStep extends ProjectNameStep { private TextFieldWithBrowseButton myModuleFileLocation; private JPanel myHeader; + private JLabel myModuleTypeLabel; + private JLabel myDescriptionLabel; + private JBScrollPane myModuleTypeScrollPane; + private JBScrollPane myDescriptionScrollPane; + private boolean myModuleNameChangedByUser = false; private boolean myModuleNameDocListenerEnabled = true; @@ -179,8 +184,9 @@ public class ProjectNameWithTypeStep extends ProjectNameStep { myModuleNameChangedByUser = true; } String path = getDefaultBaseDir(wizardContext); - if (path.length() > 0 && !Comparing.strEqual(myModuleName.getText().trim(), myNamePathComponent.getNameValue())) { - path += "/" + myModuleName.getText(); + final String moduleName = getModuleName(); + if (path.length() > 0 && !Comparing.strEqual(moduleName, myNamePathComponent.getNameValue())) { + path += "/" + moduleName; } if (!myContentRootChangedByUser) { final boolean f = myModuleNameChangedByUser; @@ -320,8 +326,10 @@ public class ProjectNameWithTypeStep extends ProjectNameStep { super.updateDataModel(); final ModuleBuilder builder = (ModuleBuilder)myMode.getModuleBuilder(); assert builder != null; - builder.setName(myModuleName.getText()); - builder.setModuleFilePath(FileUtil.toSystemIndependentName(myModuleFileLocation.getText()) + "/" + myModuleName.getText() + ModuleFileType.DOT_DEFAULT_EXTENSION); + final String moduleName = getModuleName(); + builder.setName(moduleName); + builder.setModuleFilePath( + FileUtil.toSystemIndependentName(myModuleFileLocation.getText()) + "/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION); builder.setContentEntryPath(FileUtil.toSystemIndependentName(myModuleContentRoot.getText())); } else { mySequence.setType(null); @@ -329,12 +337,12 @@ public class ProjectNameWithTypeStep extends ProjectNameStep { } } - private String getSelectedBuilderId() { + protected String getSelectedBuilderId() { return ((ModuleBuilder)myTypesList.getSelectedValue()).getBuilderId(); } public boolean validate() throws ConfigurationException { - final String moduleName = myModuleName.getText().trim(); + final String moduleName = getModuleName(); if (myCreateModuleCb.isSelected() || !myWizardContext.isCreatingNewProject()) { final String moduleFileDirectory = myModuleFileLocation.getText(); if (moduleFileDirectory.length() == 0) { @@ -397,4 +405,21 @@ public class ProjectNameWithTypeStep extends ProjectNameStep { public String getHelpId() { return "reference.dialogs.new.project.fromScratch"; } + + protected String getModuleName() { + return myModuleName.getText().trim(); + } + + protected void addModuleNameListener(final DocumentListener listener) { + myModuleName.getDocument().addDocumentListener(listener); + } + + protected void replaceModuleTypeOptions(final Component component) { + myModuleTypeLabel.setVisible(false); + myDescriptionLabel.setVisible(false); + myModuleTypeScrollPane.setVisible(false); + myDescriptionScrollPane.setVisible(false); + myInternalPanel.add(component, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(10, 0, 0, 0), 0, 0)); + } } \ No newline at end of file diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index 2cd5dd3f92b3..9ad998fd2e4b 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -968,6 +968,7 @@ + diff --git a/resources/src/idea/RichPlatformPlugin.xml b/resources/src/idea/RichPlatformPlugin.xml index 1481e92bdc01..fcb1d198c0c6 100644 --- a/resources/src/idea/RichPlatformPlugin.xml +++ b/resources/src/idea/RichPlatformPlugin.xml @@ -268,7 +268,6 @@ -