Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » eclipse close lifttime
eclipse close lifttime [message #257381] Thu, 01 July 2004 04:25 Go to next message
Eclipse UserFriend
Originally posted by: naficbm.1net.gr

hello,I have a plugin which does some work
in a long running background
thread.
This plugin include two ViewPart, The two
ViewPart shared this background thread.
When the user closes the workbench (by clicking X, not the
QuitAtion),I want to stop this thread, before
workbench close.

who may give me some hint.
thanks in advance.
Re: eclipse close lifttime [message #257422 is a reply to message #257381] Thu, 01 July 2004 07:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gerhard.kainz.knowing.at

eclipse calls

* @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento)

public void saveState (IMemento memento)

in your view before exiting, there you can place clean up code , atr least
this worked for me.



gerhard

"mastiff_cm" <naficbm@1net.gr> schrieb im Newsbeitrag
news:cc0ho5$ra0$1@eclipse.org...
> hello,I have a plugin which does some work
> in a long running background
> thread.
> This plugin include two ViewPart, The two
> ViewPart shared this background thread.
> When the user closes the workbench (by clicking X, not the
> QuitAtion),I want to stop this thread, before
> workbench close.
>
> who may give me some hint.
> thanks in advance.
Re: eclipse close lifttime [message #257430 is a reply to message #257381] Thu, 01 July 2004 07:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal.ibm.canada

If you are in eclipse 3.0, look at the job API provided in runtime.

PaScaL

mastiff_cm wrote:
> hello,I have a plugin which does some work
> in a long running background
> thread.
> This plugin include two ViewPart, The two
> ViewPart shared this background thread.
> When the user closes the workbench (by clicking X, not the
> QuitAtion),I want to stop this thread, before
> workbench close.
>
> who may give me some hint.
> thanks in advance.
Re: eclipse close lifttime [message #259882 is a reply to message #257381] Thu, 08 July 2004 17:43 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

I think your best bet is to maintain a counter of the number of open
workbench windows. You can update the counter by adding an
IWindowListener to IWorkbench. When the counts reaches zero, all windows
are closed, and the application is about to exit. You can then cancel or
join the background thread.

The only other approach I can think of is a workspace ISaveParticipant.
Save participants get a chance to run before the workbench exits. Look
up ISaveParticipant in the help system for more details. This will not
be available in an RCP application.
--

mastiff_cm wrote:
> hello,I have a plugin which does some work
> in a long running background
> thread.
> This plugin include two ViewPart, The two
> ViewPart shared this background thread.
> When the user closes the workbench (by clicking X, not the
> QuitAtion),I want to stop this thread, before
> workbench close.
>
> who may give me some hint.
> thanks in advance.
Previous Topic:How to jump into function implementation
Next Topic:dependent Java projects and classpath problems...
Goto Forum:
  


Current Time: Mon May 12 19:28:05 EDT 2025

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

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

Back to the top