Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Changing diagram files without (visibly) opening their editor
Changing diagram files without (visibly) opening their editor [message #181068] Sat, 05 April 2008 16:04 Go to next message
Eclipse UserFriend
Originally posted by: balancedblend.gmx.de

Hello,



I'm dealing with a quite challenging problem right now:

We're developing an application consisting of multiple GMF-generated
editors. They have a shared data model and one of them serves as interface
editor. It is used to specify an interface consisting of several node types.

Now some other editors use this interface. This means, they include the
interface's nodes in one of their diagrams. The interface nodes should only
be altered by the interface editor. The problem now is: When an interface is
changed, how can the diagrams (respectively the diagram files) using it be
updated? (the interface changes must be propagated to all diagrams using
it). The affected diagram's editor should not be opened! Is there an easy/
elegant way to do this? I'm clueless so far...



Thanks in advance for your help!



Regards,

Johannes
Re: Changing diagram files without (visibly) opening their editor [message #181127 is a reply to message #181068] Mon, 07 April 2008 08:24 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Sounds like you should use a shared editing domin for all editors. A lot
has been said about this in this NG.

Second, put a mapping for the Interface in all editors, but make your
Interface-Editor the only one that has a creation tool for the Interfaces.

Jan

Johannes Koehler schrieb:
> Hello,
>
>
>
> I'm dealing with a quite challenging problem right now:
>
> We're developing an application consisting of multiple GMF-generated
> editors. They have a shared data model and one of them serves as interface
> editor. It is used to specify an interface consisting of several node types.
>
> Now some other editors use this interface. This means, they include the
> interface's nodes in one of their diagrams. The interface nodes should only
> be altered by the interface editor. The problem now is: When an interface is
> changed, how can the diagrams (respectively the diagram files) using it be
> updated? (the interface changes must be propagated to all diagrams using
> it). The affected diagram's editor should not be opened! Is there an easy/
> elegant way to do this? I'm clueless so far...
>
>
>
> Thanks in advance for your help!
>
>
>
> Regards,
>
> Johannes
>
>


---
Get professional support from the Xtext committers at www.typefox.io
Re: Changing diagram files without (visibly) opening their editor [message #181140 is a reply to message #181068] Mon, 07 April 2008 10:54 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Johannes,

> propagated to all diagrams using it). The affected diagram's editor
> should not be opened! Is there an easy/ elegant way to do this? I'm
Then corresponding diagram editor content should be updated automatically
on next diagram openning. If you have to update diagram openned in the other
editor then it should be done for you automatically (if "affected" editor
is not dirty) - generated DocumentProvider listen for any changes in eclipse
resources and perform editor refresh based on this information.

-----------------
Alex Shatalin
Re: Changing diagram files without (visibly) opening their editor [message #185115 is a reply to message #181140] Sat, 03 May 2008 16:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: balancedblend.gmx.de

Thanks for your replies. First of all, I don't think that a shared
editing domain, as Jan Koehnlein proposed, makes sense here. As far as I
understand it, the shared editing domain is used to simultaneously
update multiple views, but this doesn't apply here. My Editors won't be
open at the same time.

What I rather want to have is the possibility to say: A model "X" made
with editor "Y" should use an interface made with the interface editor.
The saved interface consists of two files "name.interface" and
"name.interface_diagram".
Now i want the interface domain model data stored in "name.interface" to
be loaded into model "X".
According to your post, Alex, I assume you know how this works. Can you
please tell me about this?

The topic of this thread sounds a bit misleading, because I started
solving my problem using a different (bad) approach. It should rather be
something like "loading domain model data stored by editor A with editor B".

Thank you in advance!
best regards,
Johannes
Re: Changing diagram files without (visibly) opening their editor [message #185360 is a reply to message #185115] Mon, 05 May 2008 11:09 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Johannes,

Looks like you have to not only load data stored in another file (by using
"Load Resource..." action from the diagram popup menu), but rather create
diagram node representing node from another diagram and draw links to it..
If my guess is correct thenn you can following this discussion thread first:
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg12408.html

-----------------
Alex Shatalin
Re: Changing diagram files without (visibly) opening their editor [message #187630 is a reply to message #185360] Mon, 19 May 2008 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: balancedblend.gmx.de

Hello Alex!

Thank you very much for your answer. This was exactly what I needed. Linking
elements from different diagrams works also very well. The only problem left
now is, that I want to automatically create shortcuts upon opening a
diagram. This works, but my shortcuts are multiplied on each diagram
opening. Is there a way to check, which shortcuts already exist in my
diagram? where are the shortcuts stored?

Best regards,
Johannes
Re: Changing diagram files without (visibly) opening their editor [message #187665 is a reply to message #187630] Mon, 19 May 2008 11:20 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Johannes,

Shortcuts re available via Diagram.getChildren() as well as all the other
diagram nodes. In addition Shortcut elements should be marked using EAnnotation
with source = "Shortcut".

-----------------
Alex Shatalin
Re: Changing diagram files without (visibly) opening their editor [message #189272 is a reply to message #187665] Sat, 24 May 2008 12:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: balancedblend.gmx.de

Hello Alex!

Thank you very much for you helpful answer (again :))
I still have a problem however, a strange one:
I have two diagrams A and B (of different types/ metamodels). B contains
shortcuts to A. When I delete some of the original elements in diagram
A, the visible representation of the shortcuts in B gets completely
messed up. A has two nodetypes, represented by black and white squares.
After deletion of some nodes in A, it happens, that the shortcuts in B
change the color from white to black. Links can be drawn to white
shortcut-nodes. After changing the color, this doesn't work anymore and
existing links disappear.
I also have this problem, when enabling shortcuts from A-diagram type to
itself and it happens too, if the shortcuts were created manually using
the popup menu.
I found two functions, that seem to handle the shortcut updating:
refreshSemantic() in [editorName]CanonicalEditPolicy and
refreshSemanticChildren inherited from the CanonicalEditPolicy
superclass. However, the code of the latter one isn't available.
Do you (or someone else) have an idea, what is causing this?

Thank you in advance!
Best regards,

Johannes
Re: Changing diagram files without (visibly) opening their editor [message #677727 is a reply to message #185360] Thu, 09 June 2011 09:01 Go to previous message
Cindy  is currently offline Cindy Friend
Messages: 59
Registered: May 2011
Member
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg12408.html

hey why can't i open this link? is there something changed to this website?
Previous Topic:Class diagram meta-model
Next Topic:How to place a compartment node in the center of a container node
Goto Forum:
  


Current Time: Tue Apr 16 12:21:56 GMT 2024

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

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

Back to the top