Jason S
Jason S

Reputation: 189626

eclipse: explicitly saving project / workspace

Is there a way to force Eclipse to save project / workspace settings? I can't find a "save workspace" or "save project" command.

(I've never had a problem with this in Eclipse, but TI's Code Composer 4 is based on Eclipse and it sometimes crashes and doesn't retain the changes I made in project settings.)

Upvotes: 10

Views: 6666

Answers (2)

Soulkan
Soulkan

Reputation: 11

The place where is a workspace - workbranch is in Workspace\.metadata\.plugins\org.eclipse.e4.workbench\

You can use wakeup() method to force save workspace

  Job[] jobs = WorkbenchJob.getJobManager().find("WorkbenchAuto-Save Job");
  Job workspaceJob = Arrays.asList(jobs).get(0);
  workspaceJob.wakeUp(); 

Upvotes: 1

VonC
VonC

Reputation: 1323135

The surest way to force such a save would be to switch workspace.

Switch to an empty workspace, and then switch back to your current workspace: every project settings should have been saved and restored.

Note: the bug 27821 ([Workbench] saving state and preferences) is a duplicate of:
bug 2369 ([Workbench] Would like to be able to save workspace without exiting), which is opened since... 2001!
So even the "switching workspace" trick might not be enough to save every settings, but that is a start.


Edit September 2011:

Aaron Digulla add in the comments he has added a plugin 'saveui' (bug 337593, which duplicates bug 2369), and which could be a good solution to save your workspace state (without having to close your Eclipse or switch your workspace).

To use this plugin, download the code, open the archive, copy the "dropins" folder into your "eclipse" folder (possibly merging with the existing dropins folder), close Eclipse, and re-open Eclipse. You should see a small lock-like icon in the toolbar, just below the menus. Clicking this icon is supposed to save the workspace.

Upvotes: 7

Related Questions