取消C++/C工程的 Pdom Index任务

取消C++/C工程的 Pdom Index任务
    /**
     * 取消C++/C工程的 Index 任务
     * @param modelProject
     * @param jobManager
     * @throws CoreException
     */
    private List<Job> cancelCPPIndexJob(IProject project)
    {
        List<Job> jobs=new ArrayList<Job>();
        
        //过滤非c++的工程
        if (project == null
                || !ILanguageType.LANGUAGE_TYPE_CPP.equals(LanguageTypeUtil.getLanguageType(project)))
        {
            return jobs;
        }
        Job[] findJobs = Job.getJobManager()
                .find(CCorePlugin.getIndexManager());
        if (findJobs == null)
        {
            return jobs;
        }
       
        for (Job job : findJobs)
        {
            if (job instanceof PDOMIndexerJob)
            {
                IIndexManager indexManager = CCorePlugin.getIndexManager();
                if (indexManager instanceof PDOMManager)
                {
                    Object object = ReflectionUtil.invokeMethod(indexManager,
                            "getIndexer", //$NON-NLS-1$
                            new Class[] {ICProject.class},
                            CoreModel.getDefault().create(project));
                    if (object instanceof IPDOMIndexer)
                    {
                        ((PDOMIndexerJob)job).cancelJobs((IPDOMIndexer)object,
                                true);
                    }
                }
            }
        }
        return jobs;
    }
取消C++/C工程的 Pdom Index任务

取消C++/C工程的 Pdom Index任务,布布扣,bubuko.com

取消C++/C工程的 Pdom Index任务

上一篇:Cross Site Request Forgery (CSRF)--spring security -转


下一篇:[转]C/C++获取当前系统时间