Skip to main content


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 13:36 Go to next message
Filip Deleersnijder is currently offline Filip DeleersnijderFriend
Messages: 10
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 13:51 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
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
Re: Detecting IApplication start [message #1235521 is a reply to message #1124401] Fri, 24 January 2014 15:15 Go to previous message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
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: Wed Apr 24 19:31:10 GMT 2024

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

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

Back to the top