Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Dynamically extending the workbench model
Dynamically extending the workbench model [message #533328] Thu, 13 May 2010 07:58 Go to next message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Hi,

I am trying to evaluate Eclipse e4 development and as a test case I
started to implement a proof of concept of a new product.

One of the requests of the new product is that it is an application that
will have to open up on multiple monitors in full screen on all monitors.

The number of available monitors is, of course detected only at runtime
and this means that the model defined in Application.e4xmi needs to be
dynamically extended at startup.

To achieve that I used LifecycleHandler and intercepted
*processAdditions* event to create one new window per monitor.

It mostly worked like a charm (you can read my experiences here:
http://luolong.blogspot.com/2010/05/experiencing.html)

However I was left with 2 questions:

1) In my initial implementation I used standard EMF model factory
methods to manually create the excess windows in code. However it would
make much more sense to me in many ways if I could instead read the
window configuration from some sort of template instead and
insert/populate window instances loaded/created from the template into
the application model...

2) The other issue I had was that a MWindow model seems to be missing
"fullScreen" attribute. What is your suggestion - is it a deliberate
omission and I should instead create my own window renderer for this
purpose? Or is it simply an oversight and will be added in some near
future release?

--
Roland Tepp
Re: Dynamically extending the workbench model [message #533383 is a reply to message #533328] Thu, 13 May 2010 11:21 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5277
Registered: July 2009
Senior Member
Am 13.05.10 13:58, schrieb Roland Tepp:
> Hi,
>
> I am trying to evaluate Eclipse e4 development and as a test case I
> started to implement a proof of concept of a new product.
>
> One of the requests of the new product is that it is an application that
> will have to open up on multiple monitors in full screen on all monitors.
>
> The number of available monitors is, of course detected only at runtime
> and this means that the model defined in Application.e4xmi needs to be
> dynamically extended at startup.
>
> To achieve that I used LifecycleHandler and intercepted
> *processAdditions* event to create one new window per monitor.
>
> It mostly worked like a charm (you can read my experiences here:
> http://luolong.blogspot.com/2010/05/experiencing.html)
>
> However I was left with 2 questions:
>
> 1) In my initial implementation I used standard EMF model factory
> methods to manually create the excess windows in code. However it would
> make much more sense to me in many ways if I could instead read the
> window configuration from some sort of template instead and
> insert/populate window instances loaded/created from the template into
> the application model...

Well you can create an XMI-File which holds your MWindow and the load it
use standard EMF-Resources. It quite similar to what the extension point
(org.eclipse.e4.workbench.model) does when you are contributing a
snippet (Take a look at
org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor ).

Looking at the code there you can contribute a MModelComponent which
holds an processor which is of type
org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor so you
don't need to hook yourself into the startup process and rely on certain
implementation details :-)

>
> 2) The other issue I had was that a MWindow model seems to be missing
> "fullScreen" attribute. What is your suggestion - is it a deliberate
> omission and I should instead create my own window renderer for this
> purpose? Or is it simply an oversight and will be added in some near
> future release?
>

Well, first of you are the first requesting this but I'm not sure the
Application Model is the right place for this information. IMHO it would
make probably sense to control this use CSS and as you already said
yourself you could easily write your own renderer.

Beside that you can naturally extend our EMF-Model and add such an
attribute so that your renderers can use this information.

Tom
Re: Dynamically extending the workbench model [message #533472 is a reply to message #533383] Fri, 14 May 2010 03:38 Go to previous messageGo to next message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Hey Tom,

> (Take a look at
> org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor )

Thanks for the tips - I'll take a look at it :)


13.05.2010 18:21, Tom Schindl kirjutas:
> Well, first of you are the first requesting this but I'm not sure the
> Application Model is the right place for this information. IMHO it would
> make probably sense to control this use CSS and as you already said
> yourself you could easily write your own renderer.

I was actually considering this approach - and in my particular case it
would most likely make a whole lot of sense, since the appliocation's
natural state is in full-screen, but then I remembered great many
applications where an ability to switch at between full-screen and
windowed mode at runtime is quite expected behavior (like media players
graphics editing tools, presentation software, etc.)

I'd say, e4 is still young enough platform to be largely unknown or
mistrusted by many developers, so the fact that I was the first one to
request such a thing is not really surprising...


> Beside that you can naturally extend our EMF-Model and add such an
> attribute so that your renderers can use this information.

True, but if "fullScreen" attribute is to be included in the model, I'd
rather see it as part of a "standard model". YMMV :)


--
Roland Tepp
Re: Dynamically extending the workbench model [message #533671 is a reply to message #533472] Sat, 15 May 2010 04:56 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5277
Registered: July 2009
Senior Member
Am 14.05.10 09:38, schrieb Roland Tepp:
> Hey Tom,
>
>> (Take a look at
>> org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor )
>
> Thanks for the tips - I'll take a look at it :)
>
>
> 13.05.2010 18:21, Tom Schindl kirjutas:
>> Well, first of you are the first requesting this but I'm not sure the
>> Application Model is the right place for this information. IMHO it would
>> make probably sense to control this use CSS and as you already said
>> yourself you could easily write your own renderer.
>
> I was actually considering this approach - and in my particular case it
> would most likely make a whole lot of sense, since the appliocation's
> natural state is in full-screen, but then I remembered great many
> applications where an ability to switch at between full-screen and
> windowed mode at runtime is quite expected behavior (like media players
> graphics editing tools, presentation software, etc.)
>
> I'd say, e4 is still young enough platform to be largely unknown or
> mistrusted by many developers, so the fact that I was the first one to
> request such a thing is not really surprising...
>

True

>
>> Beside that you can naturally extend our EMF-Model and add such an
>> attribute so that your renderers can use this information.
>
> True, but if "fullScreen" attribute is to be included in the model, I'd
> rather see it as part of a "standard model". YMMV :)
>
>

You can file a bug and then we can discuss there.

Tom
Re: Dynamically extending the workbench model [message #575987 is a reply to message #533328] Thu, 13 May 2010 11:21 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5277
Registered: July 2009
Senior Member
Am 13.05.10 13:58, schrieb Roland Tepp:
> Hi,
>
> I am trying to evaluate Eclipse e4 development and as a test case I
> started to implement a proof of concept of a new product.
>
> One of the requests of the new product is that it is an application that
> will have to open up on multiple monitors in full screen on all monitors.
>
> The number of available monitors is, of course detected only at runtime
> and this means that the model defined in Application.e4xmi needs to be
> dynamically extended at startup.
>
> To achieve that I used LifecycleHandler and intercepted
> *processAdditions* event to create one new window per monitor.
>
> It mostly worked like a charm (you can read my experiences here:
> http://luolong.blogspot.com/2010/05/experiencing.html)
>
> However I was left with 2 questions:
>
> 1) In my initial implementation I used standard EMF model factory
> methods to manually create the excess windows in code. However it would
> make much more sense to me in many ways if I could instead read the
> window configuration from some sort of template instead and
> insert/populate window instances loaded/created from the template into
> the application model...

Well you can create an XMI-File which holds your MWindow and the load it
use standard EMF-Resources. It quite similar to what the extension point
(org.eclipse.e4.workbench.model) does when you are contributing a
snippet (Take a look at
org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor ).

Looking at the code there you can contribute a MModelComponent which
holds an processor which is of type
org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor so you
don't need to hook yourself into the startup process and rely on certain
implementation details :-)

>
> 2) The other issue I had was that a MWindow model seems to be missing
> "fullScreen" attribute. What is your suggestion - is it a deliberate
> omission and I should instead create my own window renderer for this
> purpose? Or is it simply an oversight and will be added in some near
> future release?
>

Well, first of you are the first requesting this but I'm not sure the
Application Model is the right place for this information. IMHO it would
make probably sense to control this use CSS and as you already said
yourself you could easily write your own renderer.

Beside that you can naturally extend our EMF-Model and add such an
attribute so that your renderers can use this information.

Tom
Re: Dynamically extending the workbench model [message #576063 is a reply to message #533383] Fri, 14 May 2010 03:38 Go to previous message
Roland Tepp is currently offline Roland Tepp
Messages: 336
Registered: July 2009
Senior Member
Hey Tom,

> (Take a look at
> org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor )

Thanks for the tips - I'll take a look at it :)


13.05.2010 18:21, Tom Schindl kirjutas:
> Well, first of you are the first requesting this but I'm not sure the
> Application Model is the right place for this information. IMHO it would
> make probably sense to control this use CSS and as you already said
> yourself you could easily write your own renderer.

I was actually considering this approach - and in my particular case it
would most likely make a whole lot of sense, since the appliocation's
natural state is in full-screen, but then I remembered great many
applications where an ability to switch at between full-screen and
windowed mode at runtime is quite expected behavior (like media players
graphics editing tools, presentation software, etc.)

I'd say, e4 is still young enough platform to be largely unknown or
mistrusted by many developers, so the fact that I was the first one to
request such a thing is not really surprising...


> Beside that you can naturally extend our EMF-Model and add such an
> attribute so that your renderers can use this information.

True, but if "fullScreen" attribute is to be included in the model, I'd
rather see it as part of a "standard model". YMMV :)


--
Roland Tepp
Re: Dynamically extending the workbench model [message #576099 is a reply to message #533472] Sat, 15 May 2010 04:56 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5277
Registered: July 2009
Senior Member
Am 14.05.10 09:38, schrieb Roland Tepp:
> Hey Tom,
>
>> (Take a look at
>> org.eclipse.e4.workbench.ui.internal.ModelExtensionProcessor )
>
> Thanks for the tips - I'll take a look at it :)
>
>
> 13.05.2010 18:21, Tom Schindl kirjutas:
>> Well, first of you are the first requesting this but I'm not sure the
>> Application Model is the right place for this information. IMHO it would
>> make probably sense to control this use CSS and as you already said
>> yourself you could easily write your own renderer.
>
> I was actually considering this approach - and in my particular case it
> would most likely make a whole lot of sense, since the appliocation's
> natural state is in full-screen, but then I remembered great many
> applications where an ability to switch at between full-screen and
> windowed mode at runtime is quite expected behavior (like media players
> graphics editing tools, presentation software, etc.)
>
> I'd say, e4 is still young enough platform to be largely unknown or
> mistrusted by many developers, so the fact that I was the first one to
> request such a thing is not really surprising...
>

True

>
>> Beside that you can naturally extend our EMF-Model and add such an
>> attribute so that your renderers can use this information.
>
> True, but if "fullScreen" attribute is to be included in the model, I'd
> rather see it as part of a "standard model". YMMV :)
>
>

You can file a bug and then we can discuss there.

Tom
Previous Topic:Customizing the workbench window
Next Topic:XWT + DataBinding + TableViewer Issue
Goto Forum:
  


Current Time: Wed Aug 20 12:49:31 EDT 2014

Powered by FUDForum. Page generated in 0.04950 seconds