Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Contributing to any e4 Application
Contributing to any e4 Application [message #797397] Mon, 13 February 2012 12:38 Go to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 100
Registered: January 2012
Senior Member
Hi all,
I am trying to learn e4, but maybe I am biased by 3.x and need some clarifications.
In 3.x you can contribute (with a View, a Command or whatsoever) with a plug-in, without knowing nothing about which Application will benefit from your plugin, you just contribute to any application (maybe the IDE itself), as soon as your plugin is included into the launch/product.
In e4 I am finding several documentation pages that point out that you must, in the e4 Model Fragment, reference to the parentElementId that you want to contribute.
Is really this way or does exists a way in e4 to contribute like in 3.x in a more generic manner?
In this latter case how can I do it (could someone attach a minimal sample)?

Thank you very much
Vincenzo Caselli
Re: Contributing to any e4 Application [message #797511 is a reply to message #797397] Mon, 13 February 2012 15:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5462
Registered: July 2009
Senior Member
There are 2 ways:
a) Fragment.e4xmi with the current drawback that you have to know the
parent you want to contribute to (enhancement request can on how
this could be overcome is here [1])

b) Use a Processor and create the contribution programmatically

c) A new option I just came up in this very second is that instead of
using XPath we could add one where you give the system a Java-Class
to identify the merge target

The nice thing about all current fragment solution is that one can
plug-in his/her own one because the merge into the target model is done
by the EMF-Element itself [see patch in 1] so implementing and using a)
/ c) does not require help/changes from the E4AP, what a clever design ;-)

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=324954

Am 13.02.12 13:38, schrieb Vincenzo Caselli:
> Hi all,
> I am trying to learn e4, but maybe I am biased by 3.x and need some
> clarifications.
> In 3.x you can contribute (with a View, a Command or whatsoever) with a
> plug-in, without knowing nothing about which Application will benefit
> from your plugin, you just contribute to any application (maybe the IDE
> itself), as soon as your plugin is included into the launch/product.
> In e4 I am finding several documentation pages that point out that you
> must, in the e4 Model Fragment, reference to the parentElementId that
> you want to contribute.
> Is really this way or does exists a way in e4 to contribute like in 3.x
> in a more generic manner?
> In this latter case how can I do it (could someone attach a minimal
> sample)?
>
> Thank you very much
> Vincenzo Caselli
Re: Contributing to any e4 Application [message #805596 is a reply to message #797397] Thu, 23 February 2012 23:50 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1049
Registered: July 2009
Senior Member

Vincenzo: Have a look here: Eclipse 4 Modularity
Re: Contributing to any e4 Application [message #806088 is a reply to message #797397] Fri, 24 February 2012 14:39 Go to previous messageGo to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 100
Registered: January 2012
Senior Member
Tom, Lars,
thank you for your answers!
As a newby of E4 however I still have the feeling that 3.x has/had the incredible power of the combination between:

1) declarative (plugin.xml) contribution

2) contribution plugin can be used by any application (no ties with a "base"
application = no 1->N relationship between application->contributions)

I would not be misunderstood: I am eager to learn to work with E4 and I will encourage other to switch from 3.x. I am just trying to be sure we are not loosing something so great like the combination of the above points.
Lars, I have read the tutorial "Eclipse 4 Modularity": very useful!

Any link to other tutorials on how to do the same contribution for other things (parts, perspectives, menus, perspective extensions, preference pages, etc..) is greatly welcome!

Thank you again
Vincenzo
Re: Contributing to any e4 Application [message #806128 is a reply to message #806088] Fri, 24 February 2012 15:18 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5462
Registered: July 2009
Senior Member
The xpath contribution would be exactly this kind of thing - it would
allow you to contribute to ANY application.

In reality in 3.x you've been able to contribute only
views/editors/commands/handlers to any application - menus and others
who needed a ref-id have not been possible there as well.

So all that is missing is that you we provide a possibility to
contribute to the root-application element without using an id - you can
file a feature request if you want.

Tom

Am 24.02.12 15:39, schrieb Vincenzo Caselli:
> Tom, Lars,
> thank you for your answers!
> As a newby of E4 however I still have the feeling that 3.x has/had the
> incredible power of the combination between:
>
> 1) declarative (plugin.xml) contribution
>
> 2) contribution plugin can be used by any application (no ties with a
> "base" application = no 1->N relationship between
> application->contributions)
>
> I would not be misunderstood: I am eager to learn to work with E4 and I
> will encourage other to switch from 3.x. I am just trying to be sure we
> are not loosing something so great like the combination of the above
> points.
> Lars, I have read the tutorial "Eclipse 4 Modularity": very useful!
>
> Any link to other tutorials on how to do the same contribution for other
> things (parts, perspectives, menus, perspective extensions, preference
> pages, etc..) is greatly welcome!
>
> Thank you again
> Vincenzo
Re: Contributing to any e4 Application [message #806356 is a reply to message #806128] Fri, 24 February 2012 21:51 Go to previous messageGo to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 100
Registered: January 2012
Senior Member
Hi Tom,
where can I find some example of xpath contribution in e4?
Thank you
Vincenzo
Re: Contributing to any e4 Application [message #806979 is a reply to message #806356] Sat, 25 February 2012 20:24 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1049
Registered: July 2009
Senior Member

@Tom: you could also safely contribute to org.eclipse.ui.main.menu and org.eclipse.ui.main.toolbar. But great idea to use a xpath contribution way instead of the id. +1 for such a feature

@Vincenzo: I definitely will extend the tutorial in the future with additional examples.
Re: Contributing to any e4 Application [message #807432 is a reply to message #806356] Sun, 26 February 2012 12:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5462
Registered: July 2009
Senior Member
The implementation is not yet finished. The link to the bug was part of
my first reply and is found at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=324954.

I don't think this addition will make it into 4.2 though - a more likely
one would be one that delegates the look up to a class instead of
directly referencing an ID.

Tom

Am 24.02.12 22:51, schrieb Vincenzo Caselli:
> Hi Tom,
> where can I find some example of xpath contribution in e4?
> Thank you
> Vincenzo
Re: Contributing to any e4 Application [message #1196365 is a reply to message #797511] Tue, 19 November 2013 11:31 Go to previous message
Michael Relby is currently offline Michael RelbyFriend
Messages: 3
Registered: November 2013
Junior Member
Thomas Schindl wrote on Mon, 13 February 2012 10:28
c) A new option I just came up in this very second is that instead of
using XPath we could add one where you give the system a Java-Class
to identify the merge target


Any example/docs of implementing this option?

And why target milestone of bug 324954 is set to 4.3 M4 when 4.3.1 still have no XPath feature implemented?

Thanks,
Michael.

[Updated on: Wed, 20 November 2013 05:33]

Report message to a moderator

Previous Topic:Eclipse 4 on Red Hat Linux
Next Topic:Invalid Thread Access in MenuManagerRenderer.contextDisposed
Goto Forum:
  


Current Time: Fri Nov 21 12:26:34 GMT 2014

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

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