1

I am creating an RCP application where I need to read the list of Recently Opened Files and display it in a dialog.

I have tried using

IContributionItem reEdit = ContributionItemFactory.REOPEN_EDITORS.create(window);

but the history attribute is private so not accessible.

However, when my RCP app start, it displays empty list (in debugging). How to make it to be saved in the preferences to be retrieved after restart as well.

Any pointers on how it can be done?

skaffman
  • 398,947
  • 96
  • 818
  • 769
  • So, you are saying that the editor history list is empty each time you restart the workbench? Perhaps you have set "clear configuration area..." in your debug configuration? – Martti Käärik Jan 09 '12 at 07:24
  • In my WorkbenchAdvisor class, I have added this small piece of code and able to retain the list. @Override public void initialize(IWorkbenchConfigurer configurer) { configurer.setSaveAndRestore(true); } – user1133939 Jan 10 '12 at 06:40
  • My earlier comment was misleading. Editor history data is actually stored in workspace rather than configuration area. You can look into _/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml_ file. If it contains `` element with file list then this info is stored correctly and the problem is somewhere else. – Martti Käärik Jan 10 '12 at 08:06

0 Answers0