Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Extending the diagram from another plugin project?
Extending the diagram from another plugin project? [message #499714] Mon, 23 November 2009 19:54 Go to next message
Bastian Roth is currently offline Bastian RothFriend
Messages: 19
Registered: September 2009
Junior Member
Hello,

I want to extend the generated diagram without touching anything of the
generated code or rewriting some XPand templates. My idea is to create
another plugin project which depends on the diagram project and realizes
my extension needs. But how is it possible to react to changes that are
made within any opened diagram (for example when an object is selected,
created, removed etc.)?
I hope there is a solution for it ...

Regards,
Bastian
Re: Extending the diagram from another plugin project? [message #499807 is a reply to message #499714] Tue, 24 November 2009 09:22 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Hi Bastian,

We had a similar problem last year with the use of EMF. The problem we faced was that the jar packaging makes it impossible to change the code.
It is also better not to modify the code of existing plugins because after if Eclipse change then you can't upgrade. We have for example upgraded from Eclipse 3.3 to Eclipse 3.4 a customer project which has completely redone GMF for specific needs. The result was that its plugin was a real nightmare to upgrade to Eclipse 3.4 and the company lost 20% of existing features during the upgrade.

The solution was for us to paste and copy the code of the plugin inside our own source code, fix the problem and call our method and not EMF method inside our plugin.
It did the job !!
Re: Extending the diagram from another plugin project? [message #499858 is a reply to message #499807] Tue, 24 November 2009 12:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Vlad,

Comments below.

Vlad Varnica wrote:
> Hi Bastian,
>
> We had a similar problem last year with the use of EMF. The problem we
> faced was that the jar packaging makes it impossible to change the code.
He's not asking to change the code. Extension is about reusing
libraries as they are provided...
>
> It is also better not to modify the code of existing plugins because
> after if Eclipse change then you can't upgrade. We have for example
> upgraded from Eclipse 3.3 to Eclipse 3.4 a customer project which has
> completely redone GMF for specific needs.
And was this modified version made publicly available in compliance with
the EPL?
> The result was that its plugin was a real nightmare to upgrade to
> Eclipse 3.4 and the company lost 20% of existing features during the
> upgrade.
As if anyone should need to have explained to them the problems with
modifying code provided by others...
>
> The solution was for us to paste and copy the code of the plugin
> inside our own source code, fix the problem and call our method and
> not EMF method inside our plugin.
> It did the job !!
Of course you'd never consider contributing a fix to the base, but
others do thank goodness.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extending the diagram from another plugin project? [message #499952 is a reply to message #499858] Tue, 24 November 2009 15:04 Go to previous messageGo to next message
Bastian Roth is currently offline Bastian RothFriend
Messages: 19
Registered: September 2009
Junior Member
Yes, Ed is right. I want to reuse the diagram project like a library and
therefore my separate plugin project needs to be registered at each
diagram instance. Does anybody else knows a solution for this?

Bastian

Ed Merks schrieb:
> Vlad,
>
> Comments below.
>
> Vlad Varnica wrote:
>> Hi Bastian,
>>
>> We had a similar problem last year with the use of EMF. The problem we
>> faced was that the jar packaging makes it impossible to change the code.
> He's not asking to change the code. Extension is about reusing
> libraries as they are provided...
>>
>> It is also better not to modify the code of existing plugins because
>> after if Eclipse change then you can't upgrade. We have for example
>> upgraded from Eclipse 3.3 to Eclipse 3.4 a customer project which has
>> completely redone GMF for specific needs.
> And was this modified version made publicly available in compliance with
> the EPL?
>> The result was that its plugin was a real nightmare to upgrade to
>> Eclipse 3.4 and the company lost 20% of existing features during the
>> upgrade.
> As if anyone should need to have explained to them the problems with
> modifying code provided by others...
>>
>> The solution was for us to paste and copy the code of the plugin
>> inside our own source code, fix the problem and call our method and
>> not EMF method inside our plugin.
>> It did the job !!
> Of course you'd never consider contributing a fix to the base, but
> others do thank goodness.
Re: Extending the diagram from another plugin project? [message #500832 is a reply to message #499714] Sun, 29 November 2009 12:20 Go to previous message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Bastian,

You have to listen for notifications from all instances of org.eclipse.gmf.runtime.notation.View.
It's easy to install corresponding listeners on loading all the EMF model
elements - see generated ???DocumentProvider.

-----------------
Alex Shatalin
Previous Topic:GMF - How to create domain model and diagram in one file instead of two?
Next Topic:i need help setting a node's child editpart as contents for the RootEditPart
Goto Forum:
  


Current Time: Tue Sep 24 18:00:30 GMT 2024

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

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

Back to the top