Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding instances in runtime from another diagram editor
Adding instances in runtime from another diagram editor [message #1723175] Fri, 12 February 2016 10:48 Go to next message
Davide Profeta is currently offline Davide ProfetaFriend
Messages: 4
Registered: February 2016
Junior Member
Hi,
is there a way to enter into an editor (default.xxxx_diagram) in runtime all instances or only a part from another default2.xxxx_diagram? And if it's possible, can i do this by adding this option in the editor's palette?
Re: Adding instances in runtime from another diagram editor [message #1723766 is a reply to message #1723175] Wed, 17 February 2016 18:07 Go to previous messageGo to next message
Davide Profeta is currently offline Davide ProfetaFriend
Messages: 4
Registered: February 2016
Junior Member
I thought of using XML by copying from the default2.xxxx (that is a file xml) tags and paste them into my default.xxxx, so my editor will be updated accordingly.. but i have no idea how to do it. Any help or advice?
icon3.gif  Re: Adding instances in runtime from another diagram editor [message #1723839 is a reply to message #1723766] Thu, 18 February 2016 11:34 Go to previous message
Ángel Moreno is currently offline Ángel MorenoFriend
Messages: 13
Registered: November 2013
Location: Madrid
Junior Member
Hi Davide,

Your question is not nothing simple, it's a complete project. Some tricks to start to work:

- Learn how to create Eclipse Plug-ins and how works Eclipse. Very Important!

- Using objectContributions, for example, as plug-in extensions of your diagram editor A, create some actions that helps you to collect the objects selected in the diagram "A" and save this objects in memory in some property of your class diagram editor A, adding public accesors to this class to give access from the environment to the selected objects.

- Later, in your diagram editor B, you must create some context menu actions (for example) that helps you to import the objects selected in the editor A. You must explore the editors opened and give support to the user to select the correct source diagram editor instance and access to the accesors created before... Other trick:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();

Give you the references to the opened editors

- In a third step, executed the before action over the diagram editor B, you must modify the underlining model resource (learn how to work EMF, Resources and ResourcesSets) associated with the diagram editor B, add the EObjects imported to this model, and make a refresh of the editor. It's posible that your imported objects appears delocalized.... For this reason it's posible that you must relocate this objects programmatically.

You have much work to do.... be patient... and research in the information available.

Regards and good luck with your develepment!!!

Ángel M.


Ángel M.
Researcher @ Kybele Research Group
Rey Juan Carlos University, Madrid, Spain

[Updated on: Thu, 18 February 2016 13:56]

Report message to a moderator

Previous Topic:GMF Runtime Tutorial
Next Topic:Change picture of node based on their type
Goto Forum:
  


Current Time: Thu Jun 22 12:12:50 GMT 2017

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

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