Added an informational / warning message when an invalid Python platform is encountered.
Task #152377 - adding an invalid python platform throws PythonException (to log)
1.1 --- a/python.core/src/org/netbeans/modules/python/api/PythonPlatformManager.java Sun Nov 08 12:46:54 2015 -0600
1.2 +++ b/python.core/src/org/netbeans/modules/python/api/PythonPlatformManager.java Sun Nov 08 18:11:23 2015 -0600
1.3 @@ -17,6 +17,7 @@
1.4 import java.util.concurrent.Future;
1.5 import java.util.logging.Level;
1.6 import java.util.logging.Logger;
1.7 +import javax.swing.JOptionPane;
1.8 import org.netbeans.api.project.ProjectManager;
1.9 import org.netbeans.spi.project.support.ant.EditableProperties;
1.10 import org.netbeans.spi.project.support.ant.PropertyUtils;
1.11 @@ -62,6 +63,10 @@
1.12
1.13 /** Singleton instance variable **/
1.14 private static PythonPlatformManager instance;
1.15 +
1.16 + protected void showPlatformError( String message ){
1.17 + JOptionPane.showMessageDialog(null,message ,"Python Platform Error", JOptionPane.ERROR_MESSAGE);
1.18 + }
1.19
1.20 private PythonPlatform getBundledPlatform() {
1.21 PythonPlatform platform = new PythonPlatform(PLATFORM_ID_DEFAULT);
1.22 @@ -416,6 +421,10 @@
1.23 }else{
1.24 // throw new PythonException("Could not discover Python properties");
1.25 LOGGER.log(Level.SEVERE, "Could not discover Python properties in ", cmd);
1.26 + showPlatformError( "Unable to discover Python properties in platform : " + // NOI18N
1.27 + cmd +
1.28 + "\nPlease check the installation path and entry in Python Platforms. " // NOI18N
1.29 + );
1.30 return (PythonPlatform) null;
1.31 }
1.32 // }catch(PythonException ex){