Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to refresh eclipse workspace programmatically?

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.

like image 388
Rahul Avatar asked Mar 29 '11 04:03

Rahul


2 Answers

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.

like image 188
Konstantin Komissarchik Avatar answered Oct 03 '22 01:10

Konstantin Komissarchik


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());
}
like image 26
Ben Holland Avatar answered Oct 03 '22 00:10

Ben Holland