Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Watching e4 model from BundleActivator?
Watching e4 model from BundleActivator? [message #524901] Sat, 03 April 2010 20:15 Go to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi,

I'd like to watch the startup of an product.
Is there any way to really watch the product starting up?

The "Watcher" shall be installed in BundleActivator start() method..


Sebastian
Re: Watching e4 model from BundleActivator? [message #525060 is a reply to message #524901] Mon, 05 April 2010 16:57 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
Hi Sebastien.

> I'd like to watch the startup of an product.
> Is there any way to really watch the product starting up?
>
> The "Watcher" shall be installed in BundleActivator start() method..

There isn't at present -- the model is created and loaded in the product's
application's start(), and so happens before most other code is loaded.

What kind of things to you want to watch?

Brian.
Re: Watching e4 model from BundleActivator? [message #528195 is a reply to message #525060] Mon, 19 April 2010 16:27 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Brian,

sorry for answering that late.

I'd like to declare the app model in Application.e4xmi in "application plug-in".

Another plug-in may contribute Parts to a Perspective via extension point org.eclipse.e4.workbench.model using compontent descriptors.

When the workbench is initialized an "ready to run" I'd like to show that declared part of contributing plug-in depending on run-time decisions, because the app plug-in doesn't know about the contribution.

Currently, it seems, that this is not possible, since I haven't found a way about getting informed about the workbench and model having been initialized.
Even giving it a try via IStartup doesn't work out (is org.eclipse.ui.startup broken?)

Sebastian
Re: Watching e4 model from BundleActivator? [message #528206 is a reply to message #528195] Mon, 19 April 2010 16:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Sebastian,

See one of my work-items
http://tomsondev.bestsolution.at/2010/04/17/a-week-at-e4-bra nch-tweak-break-and-adjust/

It talks about programmatic contribution (not 100% what you are
describing) but could be used to.

Another thing that has been added to the latest model is
Application#addons which allows you to contribute classes which are
going to instanatiated after the model is loaded (the exact details are
not worked out yet) - e.g. the Perspective-Swichter will be implemented
like this.

Tom

Am 19.04.10 18:27, schrieb Sebastian:
> Hi Brian,
>
> sorry for answering that late.
>
> I'd like to declare the app model in Application.e4xmi in "application
> plug-in".
>
> Another plug-in may contribute Parts to a Perspective via extension
> point org.eclipse.e4.workbench.model using compontent descriptors.
>
> When the workbench is initialized an "ready to run" I'd like to show
> that declared part of contributing plug-in depending on run-time
> decisions, because the app plug-in doesn't know about the contribution.
>
> Currently, it seems, that this is not possible, since I haven't found a
> way about getting informed about the workbench and model having been
> initialized.
> Even giving it a try via IStartup doesn't work out (is
> org.eclipse.ui.startup broken?)
>
> Sebastian
Re: Watching e4 model from BundleActivator? [message #528260 is a reply to message #528206] Mon, 19 April 2010 20:53 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom,

awesome! This could help for especially for synchronous use.

Another case could be an async way accessing the workbench model - currently have no example on my mind.
Would it be useful, to send an event after E4Workbench has been created?

Sebastian
Re: Watching e4 model from BundleActivator? [message #528265 is a reply to message #528260] Mon, 19 April 2010 21:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes - there's a proposal for sending an event to the e4-eventbus but I
don't know the bug OTOH.

Tom

Am 19.04.10 22:53, schrieb Sebastian:
> Hi Tom,
>
> awesome! This could help for especially for synchronous use.
>
> Another case could be an async way accessing the workbench model -
> currently have no example on my mind.
> Would it be useful, to send an event after E4Workbench has been created?
>
> Sebastian
>
Re: Watching e4 model from BundleActivator? [message #529347 is a reply to message #528265] Fri, 23 April 2010 21:25 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom,

currently I'm working around the whole thing
using an addon to install a non-headless event subscriber for topic "*"
which will perform the modifications on the model once and only on the first event.

Smile

Sebastian
Re: Watching e4 model from BundleActivator? [message #529361 is a reply to message #529347] Fri, 23 April 2010 23:31 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom again Smile

Found out, that you could use the LifeCycleManager (property lifeCycleURI in extension org.eclipse.core.runtime.products) for modifications.
The class should have the methods

public void postContextCreate(IEclipseContext ctx);
public void processAdditions(IEclipseContext ctx);
public void processRemovals(IEclipseContext ctx);


Won't help in my case, but could be a good starting point for your programmatic contributions (if i got you right)

Sebastian
Re: Watching e4 model from BundleActivator? [message #529367 is a reply to message #529361] Sat, 24 April 2010 07:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well for the programmatic contribution I think a modififcation of the
contribution extension point is the best.

The reason is that the contribution should be merged into the model
BEFORE the ModelReconciler is consulted and the change management is
collecting delas.

Tom

Am 24.04.10 01:31, schrieb Sebastian:
> Hi Tom again :)
>
> Found out, that you could use the LifeCycleManager (property
> lifeCycleURI in extension org.eclipse.core.runtime.products) for
> modifications.
> The class should have the methods
>
> public void postContextCreate(IEclipseContext ctx);
> public void processAdditions(IEclipseContext ctx);
> public void processRemovals(IEclipseContext ctx);
>
> Won't help in my case, but could be a good starting point for your
> programmatic contributions (if i got you right)
>
> Sebastian
Re: Watching e4 model from BundleActivator? [message #529401 is a reply to message #529367] Sat, 24 April 2010 17:58 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hey,

sure, really smarter solution.

I can only work with e4 as is Smile

Sebastian
Re: Watching e4 model from BundleActivator? [message #574848 is a reply to message #525060] Mon, 19 April 2010 16:27 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Brian,

sorry for answering that late.

I'd like to declare the app model in Application.e4xmi in "application plug-in".

Another plug-in may contribute Parts to a Perspective via extension point org.eclipse.e4.workbench.model using compontent descriptors.

When the workbench is initialized an "ready to run" I'd like to show that declared part of contributing plug-in depending on run-time decisions, because the app plug-in doesn't know about the contribution.

Currently, it seems, that this is not possible, since I haven't found a way about getting informed about the workbench and model having been initialized.
Even giving it a try via IStartup doesn't work out (is org.eclipse.ui.startup broken?)

Sebastian
Re: Watching e4 model from BundleActivator? [message #574862 is a reply to message #574848] Mon, 19 April 2010 16:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Sebastian,

See one of my work-items
http://tomsondev.bestsolution.at/2010/04/17/a-week-at-e4-bra nch-tweak-break-and-adjust/

It talks about programmatic contribution (not 100% what you are
describing) but could be used to.

Another thing that has been added to the latest model is
Application#addons which allows you to contribute classes which are
going to instanatiated after the model is loaded (the exact details are
not worked out yet) - e.g. the Perspective-Swichter will be implemented
like this.

Tom

Am 19.04.10 18:27, schrieb Sebastian:
> Hi Brian,
>
> sorry for answering that late.
>
> I'd like to declare the app model in Application.e4xmi in "application
> plug-in".
>
> Another plug-in may contribute Parts to a Perspective via extension
> point org.eclipse.e4.workbench.model using compontent descriptors.
>
> When the workbench is initialized an "ready to run" I'd like to show
> that declared part of contributing plug-in depending on run-time
> decisions, because the app plug-in doesn't know about the contribution.
>
> Currently, it seems, that this is not possible, since I haven't found a
> way about getting informed about the workbench and model having been
> initialized.
> Even giving it a try via IStartup doesn't work out (is
> org.eclipse.ui.startup broken?)
>
> Sebastian
Re: Watching e4 model from BundleActivator? [message #574894 is a reply to message #528206] Mon, 19 April 2010 20:53 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom,

awesome! This could help for especially for synchronous use.

Another case could be an async way accessing the workbench model - currently have no example on my mind.
Would it be useful, to send an event after E4Workbench has been created?

Sebastian
Re: Watching e4 model from BundleActivator? [message #574911 is a reply to message #574894] Mon, 19 April 2010 21:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes - there's a proposal for sending an event to the e4-eventbus but I
don't know the bug OTOH.

Tom

Am 19.04.10 22:53, schrieb Sebastian:
> Hi Tom,
>
> awesome! This could help for especially for synchronous use.
>
> Another case could be an async way accessing the workbench model -
> currently have no example on my mind.
> Would it be useful, to send an event after E4Workbench has been created?
>
> Sebastian
>
Re: Watching e4 model from BundleActivator? [message #575149 is a reply to message #528265] Fri, 23 April 2010 21:25 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom,

currently I'm working around the whole thing
using an addon to install a non-headless event subscriber for topic "*"
which will perform the modifications on the model once and only on the first event.

:)

Sebastian
Re: Watching e4 model from BundleActivator? [message #575162 is a reply to message #575149] Fri, 23 April 2010 23:31 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi Tom again :)

Found out, that you could use the LifeCycleManager (property lifeCycleURI in extension org.eclipse.core.runtime.products) for modifications.
The class should have the methods

public void postContextCreate(IEclipseContext ctx);
public void processAdditions(IEclipseContext ctx);
public void processRemovals(IEclipseContext ctx);

Won't help in my case, but could be a good starting point for your programmatic contributions (if i got you right)

Sebastian
Re: Watching e4 model from BundleActivator? [message #575184 is a reply to message #575162] Sat, 24 April 2010 07:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well for the programmatic contribution I think a modififcation of the
contribution extension point is the best.

The reason is that the contribution should be merged into the model
BEFORE the ModelReconciler is consulted and the change management is
collecting delas.

Tom

Am 24.04.10 01:31, schrieb Sebastian:
> Hi Tom again :)
>
> Found out, that you could use the LifeCycleManager (property
> lifeCycleURI in extension org.eclipse.core.runtime.products) for
> modifications.
> The class should have the methods
>
> public void postContextCreate(IEclipseContext ctx);
> public void processAdditions(IEclipseContext ctx);
> public void processRemovals(IEclipseContext ctx);
>
> Won't help in my case, but could be a good starting point for your
> programmatic contributions (if i got you right)
>
> Sebastian
Re: Watching e4 model from BundleActivator? [message #575201 is a reply to message #529367] Sat, 24 April 2010 17:58 Go to previous message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hey,

sure, really smarter solution.

I can only work with e4 as is :)

Sebastian
Previous Topic:e4 + RAP 1.3 + Documentation
Next Topic:Contacts based app, use of IObservable
Goto Forum:
  


Current Time: Thu Mar 28 09:59:01 GMT 2024

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

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

Back to the top