Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Saving project data before a project is closed or deleted
icon4.gif  Saving project data before a project is closed or deleted [message #553699] Wed, 18 August 2010 14:12
Waqas Ilyas is currently offline Waqas IlyasFriend
Messages: 66
Registered: July 2009

I have a problem regarding saving some custom data in a project file before it is closed or deleted. I am using Eclipse

I have my own project natures and for my projects, I use a file within the project to save information related to project settings (much like .project file). Many settings are handled through the properties view and also when files are added or deleted from the project. So I cannot save the data in RAM at the time of modification to file. Before a project is closed/deleted I need to save the data in ram to that file.

For this I have added save participants to the workspace, so that my data gets periodically saved and additionally I have added listeners to resource change events so that I can save my data just before a project is closed/deleted.

The problem is that when I get resource change events for a project that is being deleted or closed (IResourceChangeEvent.PRE_CLOSE, IResourceChangeEvent.PRE_DELETE), the resource tree is locked for any modifications. I therefore am unable to make any changes to the project. Any suggestions?

In case of closing a project my save participant does get notification and I can save at that time. But I do not get the save notification when a project is being moved (renamed) or closed.

I presume that this is a common requirement that users of Eclipse who create their own project natures need to save project settings to a file within the project. What would be the preferred way to achieve that? Save the file as soon as settings are changed via property dialogs or property view? What is then the purpose of a save participant.

Previous Topic:Two questions about files in bundle and ISpellingEngine
Next Topic:Software update problems in our application.
Goto Forum:

Current Time: Sat Jun 23 20:17:17 GMT 2018

Powered by FUDForum. Page generated in 0.01847 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top