Skip to main content



      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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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
Re: Detecting IApplication start [message #1235521 is a reply to message #1124401] Fri, 24 January 2014 10:15 Go to previous message
Eclipse UserFriend
I would also be interested in obtaining the primary stage in this way. Currently there seems to be only the following way in the main E4 part:

@PostConstruct
public void init(final MWindow window) {
    Stage stage = (Stage) ((WWindow<?>) window.getWidget()).getWidget();
}


Or is there a more elegant way? If not, I'd be happy to file a feature request.

Uwe
Previous Topic:BaseRenderer.unbindWidget
Next Topic:Potential contribution for JavaFx Browser
Goto Forum:
  


Current Time: Mon Apr 28 13:06:31 EDT 2025

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

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

Back to the top