[Pydev-cvs] org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited/jav
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-07-31 01:47:31
|
Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31519/tests_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration Modified Files: AbstractJavaIntegrationTestWorkbench.java Log Message: <li>Fixed NPE when creating editor with no interpreter configured</li> <li>Hyperlink works in the same way that F3 (saves file before search)</li> <li>Fixed problem while navigating pydev package explorer ( https://sourceforge.net/tracker/index.php?func=detail&aid=2008015&group_id=85796&atid=577329 )</li> <li>Applied patch that fixes race condition in PythonNature (thanks to Radim Kubacki)</li> <li><strong>Eclipse 3.4</strong>: Move / rename working</li> Index: AbstractJavaIntegrationTestWorkbench.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/AbstractJavaIntegrationTestWorkbench.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractJavaIntegrationTestWorkbench.java 18 May 2008 20:02:16 -0000 1.3 --- AbstractJavaIntegrationTestWorkbench.java 31 Jul 2008 01:47:36 -0000 1.4 *************** *** 118,121 **** --- 118,153 ---- String mod1Contents = "import java.lang.Class\njava.lang.Class"; mod1.create(new ByteArrayInputStream(mod1Contents.getBytes()), true, monitor); + + + + PythonNature nature = PythonNature.getPythonNature(project); + + //Let's give it some time to run the jobs that restore the nature + long finishAt = System.currentTimeMillis()+5000; //5 secs is the max tie + + Display display = Display.getCurrent(); + if(display == null){ + display = Display.getDefault(); + } + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()){ + display.sleep(); + } + if(finishAt<System.currentTimeMillis()){ + break; + } + if(nature != null){ + if(nature.getAstManager() != null){ + break; + } + } + } + + + assertTrue(nature != null); + assertTrue(nature.getAstManager() != null); + + editor = (PyEdit) PydevPlugin.doOpenEditor(mod1, true); } *************** *** 137,144 **** /** * Goes to 'manual' mode to allow the interaction with the opened eclipse instance. */ ! protected void goToManual() { System.out.println("going to manual..."); Display display = Display.getCurrent(); --- 169,182 ---- + protected void goToManual() { + goToManual(-1); + } + /** * Goes to 'manual' mode to allow the interaction with the opened eclipse instance. */ ! protected void goToManual(long millis) { ! long finishAt = System.currentTimeMillis()+millis; ! System.out.println("going to manual..."); Display display = Display.getCurrent(); *************** *** 151,154 **** --- 189,195 ---- display.sleep(); } + if(millis > 0 && finishAt<System.currentTimeMillis()){ + break; + } } System.out.println("finishing..."); *************** *** 299,310 **** } ! /** * Creates a source folder and configures the project to use it and the junit.jar */ protected IFolder createSourceFolder(IProgressMonitor monitor, IProject project) throws CoreException { IFolder sourceFolder = project.getFolder(new Path("src")); sourceFolder.create(true, true, monitor); ! PythonNature.addNature(project, monitor, PythonNature.JYTHON_VERSION_2_1, "/pydev_unit_test_project/src|/pydev_unit_test_project/junit.jar"); return sourceFolder; } --- 340,362 ---- } ! /** * Creates a source folder and configures the project to use it and the junit.jar */ protected IFolder createSourceFolder(IProgressMonitor monitor, IProject project) throws CoreException { + return createSourceFolder(monitor, project, true); + } + + /** + * Creates a source folder and configures the project to use it and the junit.jar + * + * @param addNature if false, no nature will be initially added to the project (if true, the nature will be added) + */ + protected IFolder createSourceFolder(IProgressMonitor monitor, IProject project, boolean addNature) throws CoreException { IFolder sourceFolder = project.getFolder(new Path("src")); sourceFolder.create(true, true, monitor); ! if(addNature){ ! PythonNature.addNature(project, monitor, PythonNature.JYTHON_VERSION_2_1, "/pydev_unit_test_project/src|/pydev_unit_test_project/junit.jar"); ! } return sourceFolder; } |