Package org.python.pydev.utils

Examples of org.python.pydev.utils.JobProgressComunicator


            try {
                if (monitor.isCanceled()) {
                    return Status.OK_STATUS;
                }
                final JobProgressComunicator jobProgressComunicator = new JobProgressComunicator(monitor,
                        "Rebuilding modules", IProgressMonitor.UNKNOWN, this);
                final PythonNature nature = PythonNature.this;
                try {
                    ICodeCompletionASTManager tempAstManager = astManager;
                    if (tempAstManager == null) {
                        tempAstManager = new ASTManager();
                    }
                    if (monitor.isCanceled()) {
                        return Status.OK_STATUS;
                    }
                    synchronized (tempAstManager.getLock()) {
                        astManager = tempAstManager;
                        tempAstManager.setProject(getProject(), nature, false); //it is a new manager, so, remove all deltas

                        //begins task automatically
                        tempAstManager.changePythonPath(paths, project, jobProgressComunicator);
                        if (monitor.isCanceled()) {
                            return Status.OK_STATUS;
                        }
                        saveAstManager();

                        List<IInterpreterObserver> participants = ExtensionHelper
                                .getParticipants(ExtensionHelper.PYDEV_INTERPRETER_OBSERVER);
                        for (IInterpreterObserver observer : participants) {
                            if (monitor.isCanceled()) {
                                return Status.OK_STATUS;
                            }
                            try {
                                observer.notifyProjectPythonpathRestored(nature, jobProgressComunicator);
                            } catch (Exception e) {
                                //let's keep it safe
                                Log.log(e);
                            }
                        }
                    }
                } catch (Throwable e) {
                    Log.log(e);
                }

                if (monitor.isCanceled()) {
                    return Status.OK_STATUS;
                }
                PythonNatureListenersManager.notifyPythonPathRebuilt(project, nature);
                //end task
                jobProgressComunicator.done();
            } catch (Exception e) {
                Log.log(e);
            }
            return Status.OK_STATUS;
        }
View Full Code Here

TOP

Related Classes of org.python.pydev.utils.JobProgressComunicator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.