Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Reference between elements in different diagrams
Reference between elements in different diagrams [message #195011] Mon, 30 June 2008 22:40 Go to next message
Eclipse UserFriend
Originally posted by: balutavasile.yahoo.se

Hi.
How can I create a reference from an element in a diagram to an element in
another diagram? And how can it be done via the properties view?

Thanks for the help.
Re: Reference between elements in different diagrams [message #195118 is a reply to message #195011] Tue, 01 July 2008 12:07 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Vali,

First load target domain model using Load Resource.. popup menu action and
then go to properties view and assign corresponding reference to the desired
target EObject.

-----------------
Alex Shatalin
Re: Reference between elements in different diagrams [message #195189 is a reply to message #195118] Tue, 01 July 2008 18:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: balutavasile.yahoo.se

Thanks for the answer. What you say works but after the asignment the
assigned element it is removed from its digram and moved as a model to
the other diagram. And i Want it to remain in its original diagram.

Thanks.
Re: Reference between elements in different diagrams [message #195197 is a reply to message #195189] Tue, 01 July 2008 19:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: balutavasile.yahoo.se

Back again.

I found the cause of my problem. The emf containment feature of my
property was set to true in the ecore model. After setting it to false and
regenerating the model code it works fine. The referenced element remains
in its diagram.

Thanks for your help.
Re: Reference between elements in different diagrams [message #494839 is a reply to message #195197] Mon, 02 November 2009 21:32 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 62
Registered: July 2009
Member
Hi Vali,

I am looking for existing approaches to referencing elements from other
domain models. What I want to do is the following:

I have a Function Block Editor and a Statechart editor. A Function Block
may contain a Statechart. I'd like to give Function Blocks a reference
to Statecharts from the other domain model and also to open a new
diagram with the Statechart when clicking/double-clicking/right-clicking
on a Function Block that contains a Statechart.

If I understand your posts correctly, you have done the first part, is
that right? I do not completely understand all the posts, could you
explain to me, what has to be done to get it working?

Thanks in advance,
Matthias

Vali wrote:
> Back again.
> I found the cause of my problem. The emf containment feature of my
> property was set to true in the ecore model. After setting it to false
> and regenerating the model code it works fine. The referenced element
> remains in its diagram.
>
> Thanks for your help.
>
Re: Reference between elements in different diagrams [message #494855 is a reply to message #494839] Mon, 02 November 2009 22:41 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 62
Registered: July 2009
Member
I figured I misunderstood Alex' post. Now I got it. Everything works so
far, I have now both editors and the Function Blocks have a reference in
the properties view to Statecharts. And after loading a statechart, I
can even set it to a value. This is really awesome! I didn't know that
GMF could do that!

Regards,
Matthias

Matthias Schmeling wrote:
> Hi Vali,
>
> I am looking for existing approaches to referencing elements from other
> domain models. What I want to do is the following:
>
> I have a Function Block Editor and a Statechart editor. A Function Block
> may contain a Statechart. I'd like to give Function Blocks a reference
> to Statecharts from the other domain model and also to open a new
> diagram with the Statechart when clicking/double-clicking/right-clicking
> on a Function Block that contains a Statechart.
>
> If I understand your posts correctly, you have done the first part, is
> that right? I do not completely understand all the posts, could you
> explain to me, what has to be done to get it working?
>
> Thanks in advance,
> Matthias
>
> Vali wrote:
>> Back again.
>> I found the cause of my problem. The emf containment feature of my
>> property was set to true in the ecore model. After setting it to false
>> and regenerating the model code it works fine. The referenced element
>> remains in its diagram.
>>
>> Thanks for your help.
>>
Re: Reference between elements in different diagrams [message #494870 is a reply to message #494855] Tue, 03 November 2009 01:08 Go to previous message
No real name is currently offline No real nameFriend
Messages: 62
Registered: July 2009
Member
Hm, now I'd like to get the file in which the referenced Statechart is
stored. Through debugging I figured out that the referenced statechart
has an XMIResourceImpl in its eAdapters List with the name of the file.

However, I bet there is an easier way than searching through the
eAdapters list. Does anyone have an idea?

Regards,
Matthias

Matthias Schmeling wrote:
> I figured I misunderstood Alex' post. Now I got it. Everything works so
> far, I have now both editors and the Function Blocks have a reference in
> the properties view to Statecharts. And after loading a statechart, I
> can even set it to a value. This is really awesome! I didn't know that
> GMF could do that!
>
> Regards,
> Matthias
>
> Matthias Schmeling wrote:
>> Hi Vali,
>>
>> I am looking for existing approaches to referencing elements from
>> other domain models. What I want to do is the following:
>>
>> I have a Function Block Editor and a Statechart editor. A Function
>> Block may contain a Statechart. I'd like to give Function Blocks a
>> reference to Statecharts from the other domain model and also to open
>> a new diagram with the Statechart when
>> clicking/double-clicking/right-clicking on a Function Block that
>> contains a Statechart.
>>
>> If I understand your posts correctly, you have done the first part, is
>> that right? I do not completely understand all the posts, could you
>> explain to me, what has to be done to get it working?
>>
>> Thanks in advance,
>> Matthias
>>
>> Vali wrote:
>>> Back again.
>>> I found the cause of my problem. The emf containment feature of my
>>> property was set to true in the ecore model. After setting it to
>>> false and regenerating the model code it works fine. The referenced
>>> element remains in its diagram.
>>>
>>> Thanks for your help.
>>>
Previous Topic:Customizing GMF templates for newbies like me
Next Topic:Eclipse Startup
Goto Forum:
  


Current Time: Thu Apr 25 16:38:06 GMT 2024

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

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

Back to the top