Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Loading the contents of a model(Loading the contents of a model)
Loading the contents of a model [message #1061600] Mon, 03 June 2013 08:50 Go to next message
Andrea Sindico is currently offline Andrea Sindico
Messages: 266
Registered: November 2010
Senior Member

I have managed to the develop a plugin implementing a graphical editor based on Graphiti for an example ECORE meta-model. I have also managed to change the file extension and relate the new extension to the Graphiti editor. Now I'd like to relate the Graphiti file to the file containing the model it represents so that when clicking on the diagram file the contents of the model are automatically loaded and graphically depicted.
What is the most appropriate point in the graphical editor plugin to load the resourceset of the model?


Follow me on Twitter @andreasindico

Re: Loading the contents of a model [message #1061840 is a reply to message #1061600] Tue, 04 June 2013 10:26 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1592
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Andrea,

not sure if I understood what you meant. So wrote that you managed to open
the diagram when double clicking on the diagram file (with changed
extension), so I guess you meant to write "open the diagram editor when
double clicking on a model file"?

In case that is what you meant, you can try to register your diagram editor
(your own subclass of the Graphiti diagram editor) as editor for the
extension of the model files and in the overridded init method in your
subclass check if the passed file editor input points to such a model file.
In case yes you might create a diagram for that model and a diagram editor
input object and set that as the input for the editor. DiagramEditor does
something similiar for passing a diagram file editor input which is changed
to DiagramEditorInput on setInput.

Michael
Previous Topic:The accelerator does not work
Next Topic:Spray: Cannot Satisfy Dependency
Goto Forum:
  


Current Time: Tue Sep 16 03:08:02 GMT 2014

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

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