Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Load EMF
Load EMF [message #997792] Tue, 08 January 2013 18:52 Go to next message
Anatoliy Tischenko is currently offline Anatoliy Tischenko
Messages: 7
Registered: July 2012
Junior Member
Hi,

Could you help me please??

I have prepared file with next content:

<?xml version="1.0" encoding="UTF-8"?>
<org.eclipse.example.friends:FriendList xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:org.eclipse.example.friends="http:///org/eclipse/example/friends.ecore">
<peoples firstName="Anatoliy" lastName="Tischenko"/>
<peoples firstName="Viktor" lastName="Vasil'ev" friends="//@peoples.0"/>
</org.eclipse.example.friends:FriendList>


And I have prepared Graphiti diagram for model(model.jpg)

Can I load my prepared file in diagram and How??

And how I can save My Friends List from diagram?

  • Attachment: model.jpg
    (Size: 20.11KB, Downloaded 59 times)
Re: Load EMF [message #998671 is a reply to message #997792] Thu, 10 January 2013 13:31 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Anatoliy,

you will need some hook point where you can trigger the loading, e.g. an
action in the project explorer or the toolbar. There you would:
1) Load your prepared file as an EMF resource into an EMF ResourceSet
2) Create a diagram in a second resource in the same EMF ResourceSet
3) Navigate through the prepared file (using EMF means) and extracting the
EObjects you want to add to the diagram
4) Call an add feature for each of those objects that add the graphical
representation

In order to save that again, you just need to ensure that when you create
new people EObject you store them in the file resource the other people are
stored as well. The diagram editor will care about persisting the diagram
and all other loaded resources automatically.

HTH,
Michael
Re: Load EMF [message #999157 is a reply to message #998671] Fri, 11 January 2013 13:23 Go to previous message
Anatoliy Tischenko is currently offline Anatoliy Tischenko
Messages: 7
Registered: July 2012
Junior Member
Thank you!

I thought that Graphiti is providing loading diagram from file. Smile
Previous Topic:Domain Models, Diagrams and Sphinx
Next Topic:How do I link by ID instead of hierarchy
Goto Forum:
  


Current Time: Sat Oct 25 23:34:16 GMT 2014

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

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