Skip to main content



      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 05:48 Go to next message
Eclipse UserFriend
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 13:07 Go to previous messageGo to next message
Eclipse UserFriend
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 06:34 Go to previous message
Eclipse UserFriend
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.

[Updated on: Thu, 18 February 2016 08:56] by Moderator

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


Current Time: Tue May 20 06:57:36 EDT 2025

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

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

Back to the top