Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Detecting IApplication start
Detecting IApplication start [message #1124389] Thu, 03 October 2013 09:36 Go to next message
Filip Deleersnijder is currently offline Filip Deleersnijder
Messages: 4
Registered: October 2013
Junior Member
I am developing an OSGi project where I wish to have a JavaFX-based IApplication. For this I use the AbstractJFXApplication base class. I want OSGi-components to be able to provide Nodes to be added to the scene graph.

I need to make some manager OSGi component that gathers the provided Nodes and adds them to the scene graph. This manager component would need to know if the scene is started in order to access it.

At this point, I register a service with OSGi (via the BundleContext cached in the Activator) at the end of the startJfx method of the AbstractJFXApplication. This service provides access to the Scene object. This service can then be bound by my manager component. This seems somewhat clumsy to me, but it is the only way I can think of.

Is there a declarative way to do this? Or any other better way?

Thanks in advance,

Filip
Re: Detecting IApplication start [message #1124401 is a reply to message #1124389] Thu, 03 October 2013 09:51 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 4651
Registered: July 2009
Senior Member
Hi,

If you have equinox.event in your launch config, the
AbstractJFXApplication will send out an event with the topic
"efxapp/applicationLaunched" after the jfxStart method has returned.

Currently I'm not passing a long any information but if you file a
feature request I could pass the primary stage, we could also discuss if
we should not register the Application in the OSGi-Service registry,
another feature request ;-)

Tom

On 03.10.13 15:36, Filip Deleersnijder wrote:
> I am developing an OSGi project where I wish to have a JavaFX-based
> IApplication. For this I use the AbstractJFXApplication base class. I
> want OSGi-components to be able to provide Nodes to be added to the
> scene graph.
>
> I need to make some manager OSGi component that gathers the provided
> Nodes and adds them to the scene graph. This manager component would
> need to know if the scene is started in order to access it.
>
> At this point, I register a service with OSGi (via the BundleContext
> cached in the Activator) at the end of the startJfx method of the
> AbstractJFXApplication. This service provides access to the Scene
> object. This service can then be bound by my manager component. This
> seems somewhat clumsy to me, but it is the only way I can think of.
>
> Is there a declarative way to do this? Or any other better way?
>
> Thanks in advance,
>
> Filip
Previous Topic:Application.launch() hangs
Next Topic:How to build Test Project
Goto Forum:
  


Current Time: Mon Oct 07 15:08:31 EDT 2013

Powered by FUDForum. Page generated in 0.01613 seconds