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.
how to refresh eclipse workspace programmatically?
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.
I get IllegalStateException that the workspace is closed. How to solve this problem? –
Sumo
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());
}
I get IllegalStateException that the workspace is closed. How to solve this problem? –
Sumo
Could be a few things. Are you running Eclipse in a headless way by chance? If so make sure you've actually made a workspace. Also check your plugin manifest settings, try reading this post: #962864 –
Mashe
© 2022 - 2024 — McMap. All rights reserved.
Ant Build
, have a tabRefresh
that lets you select what exactly should be refreshed after completion. – Vaish