I like to use Eclipse's Java editor feature that allows the me to split the editor window into several panes so I can look at multiple files at once.
Often the layout of the splits is context dependent. Ideally I'd like to be able to save the layout itself as well preserve which files were open. IntelliJ IDEA supports saving the complete context including split window layouts.
I am already familiar with and use the Mylyn task context save/restore. In fact, the Mylyn task restore actually destroys and clears the split-window arrangement upon task switch. There's a five-year-old Mylyn bug report for this defect.
It seems that the save perspective feature also doesn't save the pane layout. Is there a way to do this with or without a plugin?
General answer: probably it's possible.
Open editors and UI settings are kept in <WS>/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
path, in great part. As you can see it's kept in a place independent of the installed plugins, so you can even restore the layout when there are no plugins responsible for opened editors (it happens to me often, as I share one workspace between many Eclipse configuration).
Skimming through the Eclipse sources, I see this file being accessed from org.eclipse.ui.internal.Workbench
, in restoreState()
(reading) and in recordWorkbenchState()
+saveMementoToFile()
(writing). So reproducing this functionality in a separate plugin and reading/writing to a different (profile) file should be enough for basic usage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With