Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Eclipse shut down => Status Flag?
Eclipse shut down => Status Flag? [message #273188] Fri, 01 October 2004 05:52 Go to next message
Eclipse UserFriend
Originally posted by: leo.nowhere.com

Does anybody know, if there is a status flag which could be retrieved, if
Eclipse is currently shut down or not?
Re: Eclipse shut down => Status Flag? [message #273209 is a reply to message #273188] Fri, 01 October 2004 13:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.please

boolean org.eclipse.core.runtime.Platform.isRunning()

Returns whether the platform is running.
Returns:
true if the platform is running, and false otherwise
@since
3.0

LeO wrote:

> Does anybody know, if there is a status flag which could be retrieved, if
> Eclipse is currently shut down or not?
Re: Eclipse shut down => Status Flag? [message #273215 is a reply to message #273209] Fri, 01 October 2004 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: leo.nowhere.com

Rafael Chaves wrote:

> boolean org.eclipse.core.runtime.Platform.isRunning()

> Returns whether the platform is running.
> Returns:
> true if the platform is running, and false otherwise
> @since
> 3.0

Hm', our Editor extends TextEditor and therefore we have also
createPartControl

If I ask

if (Platform.isRunning()) {

at the beginning of the createPartControl it return ALL the time true.
Independent if the whole eclipse system is shut down or not.

Did I miss something, or is this a Bug?

LeO

P.S: Eclipse 3.0
Re: Eclipse shut down => Status Flag? [message #273222 is a reply to message #273215] Fri, 01 October 2004 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.please

The API I suggested will return true if Eclipse is currently running,
false otherwise. This is why you always get "true". If it returns "false",
it means Eclipse has not started (your code is not running in Eclipse).
This is useful for when people have code that runs with Eclipse but also
as a standalone application, but it seems this is not what you want. What
are you trying to accomplish? Please describe your use case.

P.S.: Or do you want to know if Eclipse is *shutting* down?

Rafael
Re: Eclipse shut down => Status Flag? [message #273259 is a reply to message #273222] Sat, 02 October 2004 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: leo.nowhere.com

Rafael wrote:

> What are you trying to accomplish? Please describe your use case.

When Eclipse is *shutting* down I wanna block any further activation, i.e.
it should shut down quicker.

> P.S.: Or do you want to know if Eclipse is *shutting* down?

Yes, and if I have this info, then no further init-steps will be
processed. Which is quite annoying in developement-mode, but as well in
real-time! And is useless to process init-step when Eclipse is *shutting*
down.

LeO
Re: Eclipse shut down => Status Flag? [message #273387 is a reply to message #273259] Tue, 05 October 2004 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.please

You get Platform.isRunning() == true because the platform runtime is one
of the the last plugins to be shutdown.

Common idioms for what you want is:

boolean shuttingDown = Platform.getBundle("org.eclipse.osgi").getState()
== Bundle.STOPPING

or

boolean shuttingDown = context.getBundle("org.eclipse.osgi").getState() ==
Bundle.STOPPING

where "context" is a BundleContext provided to your plug-in's start method.

Rafael


LeO wrote:

> Rafael wrote:

> > What are you trying to accomplish? Please describe your use case.

> When Eclipse is *shutting* down I wanna block any further activation, i.e.
> it should shut down quicker.

> > P.S.: Or do you want to know if Eclipse is *shutting* down?

> Yes, and if I have this info, then no further init-steps will be
> processed. Which is quite annoying in developement-mode, but as well in
> real-time! And is useless to process init-step when Eclipse is *shutting*
> down.

> LeO
Re: Eclipse shut down => Status Flag? [message #273435 is a reply to message #273387] Wed, 06 October 2004 04:02 Go to previous message
Eclipse UserFriend
Originally posted by: leo.nowhere.com

Rafael Chaves wrote:

> Common idioms for what you want is:
> boolean shuttingDown = Platform.getBundle("org.eclipse.osgi").getState()
> == Bundle.STOPPING

Does not help at all. Returns also all the time the same state, false!

> or

> boolean shuttingDown = context.getBundle("org.eclipse.osgi").getState() ==
> Bundle.STOPPING

I could only create something like context.getBundle().getState() but this
does not help at all. Also Platform.getBundle(myEditorString).getState
returns the same result.

So, unfortunatley this does not help at all. :(

LeO

P.S.: I click on the red X of the Window. Independent if I wanna save
something or not, it has the same effect.

> Rafael


> > > What are you trying to accomplish? Please describe your use case.
> > When Eclipse is *shutting* down I wanna block any further activation, i.e.
> > it should shut down quicker.
> > > P.S.: Or do you want to know if Eclipse is *shutting* down?
> > Yes, and if I have this info, then no further init-steps will be
> > processed. Which is quite annoying in developement-mode, but as well in
> > real-time! And is useless to process init-step when Eclipse is *shutting*
> > down.
> > LeO
Previous Topic:How to convince technical project leader to install Eclipse 3.0.1?
Next Topic:XPath search and XSLT editor
Goto Forum:
  


Current Time: Thu Jul 17 20:50:59 EDT 2025

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

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

Back to the top