Task #256648 - Shortly after creating Setuptools project, Netbeans terminates with no explanation or log entry
Prevent users from creating Setuptools projects on Windows until Bug#256194 is fixed.
1.1 --- a/python.project2/src/org/netbeans/modules/python/project2/templates/EmptyPythonProjectDescription.html Tue Nov 17 12:02:53 2015 -0600
1.2 +++ b/python.project2/src/org/netbeans/modules/python/project2/templates/EmptyPythonProjectDescription.html Tue Nov 17 12:10:19 2015 -0600
1.3 @@ -7,6 +7,7 @@
1.4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
1.5 </head>
1.6 <body>
1.7 - New Empty Python Project using setuptools
1.8 + New Empty Python Project using setuptools.<br />
1.9 + (available on Linux, Solaris and Mac only).
1.10 </body>
1.11 </html>
2.1 --- a/python.project2/src/org/netbeans/modules/python/project2/templates/EmptyPythonProjectPanelVisual.java Tue Nov 17 12:02:53 2015 -0600
2.2 +++ b/python.project2/src/org/netbeans/modules/python/project2/templates/EmptyPythonProjectPanelVisual.java Tue Nov 17 12:10:19 2015 -0600
2.3 @@ -11,9 +11,12 @@
2.4 import javax.swing.event.DocumentListener;
2.5 import javax.swing.text.Document;
2.6 import org.netbeans.spi.project.ui.support.ProjectChooser;
2.7 +import org.openide.DialogDisplayer;
2.8 +import org.openide.NotifyDescriptor;
2.9 import org.openide.WizardDescriptor;
2.10 import org.openide.WizardValidationException;
2.11 import org.openide.filesystems.FileUtil;
2.12 +import org.openide.util.Utilities;
2.13
2.14 public final class EmptyPythonProjectPanelVisual extends SettingsPanel implements DocumentListener {
2.15
2.16 @@ -21,6 +24,14 @@
2.17 private final PanelConfigureProject panel;
2.18
2.19 public EmptyPythonProjectPanelVisual(PanelConfigureProject panel) {
2.20 +
2.21 + boolean bIsWindows = Utilities.isWindows();
2.22 + if( bIsWindows) {
2.23 + NotifyDescriptor message = new NotifyDescriptor.Message(
2.24 + "Cannot create setuptools project for Windows. Press Cancel",
2.25 + NotifyDescriptor.ERROR_MESSAGE); // invalid
2.26 + DialogDisplayer.getDefault().notify(message);
2.27 + }
2.28 initComponents();
2.29 this.panel = panel;
2.30 // Register listener on the textFields to make the automatic updates
2.31 @@ -145,7 +156,12 @@
2.32
2.33 @Override
2.34 boolean valid(WizardDescriptor wizardDescriptor) {
2.35 -
2.36 + boolean bIsWindows = Utilities.isWindows();
2.37 + if( bIsWindows) {
2.38 + wizardDescriptor.putProperty("WizardPanel_errorMessage",
2.39 + "Cannot create setuptools project for Windows. Press Cancel"); // invalid
2.40 + return false;
2.41 + }
2.42 if (projectNameTextField.getText().length() == 0) {
2.43 wizardDescriptor.putProperty("WizardPanel_errorMessage",
2.44 "Project Name is not a valid folder name.");