We have an RCP application, using Eclipse 3.x and we are migrating to Eclipse 4.
At a certain point in our application, we need to save the workbench.xml file with the contents of the perspectives. In Eclipse 3.x this was done by writing to the file using memento.
Is there any way in Eclipse 4 to save the workbench.xmi file with the perspectives content?
Apparently all the methods that existed in the Workbench class relating to saving perspectives have been removed and there are no others that do the same.
I tried to find where workbench.xmi is saved but without success.
Can someone help me?
You can use
org.eclipse.e4.ui.workbench.IModelResourceHandlerto save the workbench.xmiYou can get this using
@Injector from theIEclipseContext.Use the save method: