| Oh I see what you mean. You can add listeners that you can attach to the workbench. But you are correct. We need to make this easier. On easy way it to do your save in the stop method of your plugin. I think we've been doing that. Not really the best solution and I think I will make a better way in the future. I might also revisit the reasons that we don't use Resources. It was a good decision before but may no longer apply to our situation.
Jesse
On 20-Jul-06, at 3:25 PM, Lewis H. Fishgold wrote: Ok, but how do I know when the application is being shutdown (so I know when to save)? Is there a listener I can implement?
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jesse Eichar Sent: Thursday, July 20, 2006 6:00 PM To: User-friendly Desktop Internet GIS Subject: Re: [udig-devel] plugin persistence
Most UI plugins have a PropertyStore that you can use. For example: ProjectUIPlugin.getDefault().getPropertyStore(). I use those quite often since we don't include the Resources plugin with uDig. Jesse
On 20-Jul-06, at 3:01 PM, Lewis H. Fishgold wrote: Hi, I am trying to make my plugin implement persistence across application shutdowns. Typically, you do this by having your plugin implement ISaveParticipant and register itself as a save participant using ISavedState lastState = ResourcesPlugin.getWorkspace().addSaveParticipant(plugin,this); In order for the save method of the ISaveParticipant to be called at exit (to save the plugin’s state), the application’s WorkbenchAdvisor (UDIGWorkbenchAdvisor in this case) must override preShutdown() and call ResourcesPlugin.getWorkspace().save(true,new NullProgressMonitor()); UDIGWorkbenchAdvisor currently does not do this. Can someone do this for me, or is there some other way to implement persistence? Thank you. Lewis _______________________________________________ User-friendly Desktop Internet GIS (uDig)
_______________________________________________ User-friendly Desktop Internet GIS (uDig) |
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel