Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » MPart lifecycle class(How to use the lifecycle class of an MPart?)
MPart lifecycle class [message #1288322] Tue, 08 April 2014 13:10 Go to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Hi,

I'm trying to use the lifecycle support for MParts as described here.

What I don't quite understand is how this differs from using the @PostConstruct and @PreDestroy annotations. And I don't have a good idea of what a lifecycle class could look like. Is there an example of such a class somewhere?

Thanks,
Uwe
Re: MPart lifecycle class [message #1288357 is a reply to message #1288322] Tue, 08 April 2014 13:46 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
If you return false from the LF-handler you veto the closing of the
part/perspective/window

You can find an example in the testcases e.g. you are not able to close
the first tab at all. We'll probably revamp the lifecycle support in 1.0
to be model based now that the platform has chose to go a different
route we proposed.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=398837 on our proposal
and how the platform will most likely implement it using in/out data on
the event-bus - crazy I know!

Tom

On 08.04.14 15:10, Uwe San wrote:
> Hi,
>
> I'm trying to use the lifecycle support for MParts as described
> http://wiki.eclipse.org/Efxclipse/Runtime/e4#Lifecycle.
>
> What I don't quite understand is how this differs from using the
> @PostConstruct and @PreDestroy annotations. And I don't have a good idea
> of what a lifecycle class could look like. Is there an example of such a
> class somewhere?
>
> Thanks,
> Uwe
Re: MPart lifecycle class [message #1288405 is a reply to message #1288322] Tue, 08 April 2014 14:34 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Thanks for pointing me at the test case.

What approach would you recommend for loading resources into an MPart after this MPart was rendered? The org.eclipse.fx.ui.lifecycle.annotations package does not seem to provide any annotations for that, and @PostConstruct does not really seem to fit either.
Re: MPart lifecycle class [message #1288413 is a reply to message #1288405] Tue, 08 April 2014 14:38 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
What do you mean with resources? I need to know more about your use case.

Tom

On 08.04.14 16:35, Uwe San wrote:
> Thanks for pointing me at the test case.
>
> What approach would you recommend for loading resources into an MPart
> after this MPart was rendered? The
> org.eclipse.fx.ui.lifecycle.annotations package does not seem to provide
> any annotations for that, and @PostConstruct does not really seem to fit
> either.
Re: MPart lifecycle class [message #1289252 is a reply to message #1288322] Wed, 09 April 2014 06:58 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
I meant resource loading operations that can potentially consume a longer amount of time like querying a database or accessing files over a network. A use case could be a table view that is rendered on screen before its content was fully loaded.
Re: MPart lifecycle class [message #1290505 is a reply to message #1289252] Thu, 10 April 2014 07:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

We currently don't have support for doing things async and report
progress so this is something you need to init in your post-construct
manually.

Eclipse-Core has a Job-API and JavaFX itself also has some Threading-API
so you most likely will use one of the the 2.

Having an e4 service - including e.g. a ProgressView /
Progress-Reporting e.g. in the Bottom-Trim - would make up a nice
contribution ;-)

Tom

On 09.04.14 08:58, Uwe San wrote:
> I meant resource loading operations that can potentially consume a
> longer amount of time like querying a database or accessing files over a
> network. A use case could be a table view that is rendered on screen
> before its content was fully loaded.
Re: MPart lifecycle class [message #1290519 is a reply to message #1290505] Thu, 10 April 2014 07:29 Go to previous message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
Thomas Schindl wrote on Thu, 10 April 2014 03:14

Having an e4 service - including e.g. a ProgressView /
Progress-Reporting e.g. in the Bottom-Trim - would make up a nice
contribution Wink


That's good to know. Wink
Previous Topic:How do configure ANT PDE build for plugin which consumes e(fx)clipse runtime
Next Topic:e(fx)clipse nightly are based on Luna
Goto Forum:
  


Current Time: Mon Sep 23 02:54:42 GMT 2024

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

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

Back to the top