how to refresh eclipse workspace programmatically?

前端 未结 2 1988
南方客
南方客 2020-12-05 18:57

I am new in eclipse plugin development. I want to refresh my workspace or complete Eclipse programmatically . so is there any to refresh eclipse programmatically.

相关标签:
2条回答
  • 2020-12-05 19:34

    Use the IResource.refreshLocal() API. You can do this at project root, a particular folder or an individual file. To refresh all projects in a workspace, simply enumerate all projects using ResourcesPlugin.getWorkspace().getRoot().getProjects() API and refresh each in turn.

    0 讨论(0)
  • 2020-12-05 19:35

    Here is a quick snippet to refresh each project in the Eclipse workspace.

    for(IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()){
        project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
    }
    
    0 讨论(0)
提交回复
热议问题