breakline
breakline

Reputation: 6073

Eclipse saving workbench state

I'm trying to implement saving the workbench/perspective state on exit. I see eclipse is using an xml file for that called workbench.xmi.

I'm trying to implement the following:

  1. on exit saving the state of the windows up to a server via web service
  2. on load the user logs in
  3. getting the saved state and restore it
  4. the user gets the same workbench view he used (even if he was on a different computer/system)

But it seems problematic. I see each view has a saveState and restoreState function but I dont see where they get called, I suspect its somewhere in the Workbench class if I'm correct?

Has anyone done anything similar?

Upvotes: 1

Views: 2257

Answers (1)

Basilevs
Basilevs

Reputation: 23896

There is no way to make this happen in one go. However, you can manually persist editors, views and active perspective by mimicking

org.eclipse.ui.internal.Workbench.saveState(IMemento)

Upvotes: 2

Related Questions