Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Avoiding Duplicate EditParts?
Avoiding Duplicate EditParts? [message #157010] Wed, 24 October 2007 16:45 Go to next message
Eclipse UserFriend
Originally posted by: Simon.James.aepona.com

Hi

In my semantic model, I have a class XYZ. An instance of XYZ is contained
either by class ABC or class DEF.
Both types of containment need to be shown in my diagram.
When I generate the diagram, the code generator creates XYZEditPart (for
containment by ABC) and XYZ2EditPart (containment by DEF).
They are identical apart from VISUAL_ID constants etc.
Is there any way of avoiding or at least reducing the duplication?

Thanks.

Simon
Re: Avoiding Duplicate EditParts? [message #157113 is a reply to message #157010] Thu, 25 October 2007 14:59 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Simon,

There is no way to do it. Why do you care about generated code - it will
be automatically updated for you.. ;-)

-----------------
Alex Shatalin
Re: Avoiding Duplicate EditParts? [message #157128 is a reply to message #157113] Thu, 25 October 2007 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Simon.James.aepona.com

Thanks, Alex.
I thought this was probably the case.

I need to customise the editpart(s), so I just checked to see if I could
avoid making the same changes/additions more than once.
Re: Avoiding Duplicate EditParts? [message #157200 is a reply to message #157128] Fri, 26 October 2007 10:06 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Simon,

> I need to customise the editpart(s), so I just checked to see if I
> could avoid making the same changes/additions more than once.
As an option you can try to create your own custom templates with corresponding
additions .

-----------------
Alex Shatalin
Re: Avoiding Duplicate EditParts? [message #157252 is a reply to message #157200] Fri, 26 October 2007 14:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Simon.James.aepona.com

Thanks for the tip.
I'd be grateful for a reference to where this subject is
described/discussed.
Re: Avoiding Duplicate EditParts? [message #157306 is a reply to message #157252] Fri, 26 October 2007 16:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Simon,

See http://wiki.eclipse.org/GMF_GenModel_Hints, Template Directory; http://www.eclipse.org/gmf/new/gmf-new-1.0M5.php,
Dynamic Templates

-----------------
Alex Shatalin
Re: Avoiding Duplicate EditParts? [message #157430 is a reply to message #157252] Sat, 27 October 2007 12:30 Go to previous message
gerhard preisinger is currently offline gerhard preisingerFriend
Messages: 10
Registered: July 2009
Junior Member
hi,

maybe try this (posting 'Re: Duplicate edit parts', tobias):

"I'm not sure if this always works, but it works for me: When I did not have
the references for the child nodes in my gmfmap defined (you do use
references, don't you?) I did a first test-generation of the diagram code.
Back then the edit parts were created once only - of cource. When I then
created the child-references and recreated the diagram code, no duplicate
edit parts were created, while they are created, when I completely delete
the diagram editor project, so I guess that the gmfgen does not create
duplicates, when it finds adequate classen in the existing project.

Try to delete the gmfgen and the diagram code, cut out the child references,
generate gmfgen and code, paste in the child references again and recreate
the code. Maybe it works. Good luck!"



Simon James schrieb:
> Thanks for the tip.
> I'd be grateful for a reference to where this subject is
> described/discussed.
>
Previous Topic:diamond polygon
Next Topic:creating a link the target is always null
Goto Forum:
  


Current Time: Sun Sep 01 00:49:02 GMT 2024

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

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

Back to the top