| Detecting IApplication start [message #1124389] |
Thu, 03 October 2013 09:36  |
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  |
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
|
|
|
Powered by
FUDForum. Page generated in 0.01613 seconds