Skip to main content



      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 04:50 Go to next message
Eclipse UserFriend
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?
Re: Loading the contents of a model [message #1061840 is a reply to message #1061600] Tue, 04 June 2013 06:26 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 23:42:43 EDT 2025

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

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

Back to the top