Project close and rename operations [message #552216] |
Wed, 11 August 2010 10:21 |
Waqas Ilyas Messages: 80 Registered: July 2009 |
Member |
|
|
Hi,
I have a problem regarding saving some custom data in a project file before it is closed or renamed. I am using Eclipse 3.3.1.1.
I have my own project natures and for my projects, I use a file within the project to save information related to project settings. Many settings are handled through the properties view. Before a project is closed 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 strangely the ResourcesPlugin.getWorkspace().isTreeLocked() equals false and I can make modifications at that time. But I do not get the save notification when a project is being moved (renamed).
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.
Regards,
Waqas
[Updated on: Thu, 12 August 2010 10:04] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03755 seconds