Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Copy & paste "link" elements in a model
Copy & paste "link" elements in a model [message #637681] Mon, 08 November 2010 10:45 Go to next message
Carlos  is currently offline Carlos Friend
Messages: 6
Registered: November 2010
Junior Member
Hello.

I have observed that when I copy and paste a "link" element, insted an element which is a reference to a "physical" element at the model, the paste is not complete in the next sense. If I modify some properties of the recent copied element, that values are not updated in the rest of the references and the "source" element. However, is I save the editor and reopen it, the model is loaded right...

So I wanted to know if I have to execute this kind of copy & paste operations about "link" elements in order to refresh the model state without saving and reopening.

I have observed that the editor execute this operation right like a DND operation, but I was also very interested in getting the same behaviour for the copy & paste.

Have you got any suggestion?

Thanks in advance.
Best regards.
Carlos.
Re: Copy & paste "link" elements in a model [message #637730 is a reply to message #637681] Mon, 08 November 2010 13:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Carlos,

Comments below.


Carlos wrote:
> Hello.
>
> I have observed that when I copy and paste a "link" element, insted an
> element which is a reference to a "physical" element at the model, the
> paste is not complete in the next sense. If I modify some properties
> of the recent copied element, that values are not updated in the rest
> of the references and the "source" element. However, is I save the
> editor and reopen it, the model is loaded right...
Are you saying you're pasting into a non-containment reference? And you
displaying the same object more than once in the tree view?
>
> So I wanted to know if I have to execute this kind of copy & paste
> operations about "link" elements in order to refresh the model state
> without saving and reopening.
>
> I have observed that the editor execute this operation right like a
> DND operation, but I was also very interested in getting the same
> behaviour for the copy & paste.
>
> Have you got any suggestion?
>
> Thanks in advance.
> Best regards.
> Carlos.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Copy & paste "link" elements in a model [message #637855 is a reply to message #637730] Tue, 09 November 2010 08:09 Go to previous messageGo to next message
Carlos  is currently offline Carlos Friend
Messages: 6
Registered: November 2010
Junior Member
Ed,

yes, that's exactly I wanted to say.
It's like "DND.DROP_LINK" but through copy&paste operation.

When I finish the copy&paste operation, if I modify a property in the element that has been pasted, the value is not updated in all the instances.

How can I get the refresh or something in order to get the recent pasted non-containment reference have the same behaviour that the other instances without reloading the model?.

Thanks in advance.
Carlos.
Re: Copy & paste "link" elements in a model [message #638269 is a reply to message #637855] Wed, 10 November 2010 14:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Carlos,

Comments below.

Carlos wrote:
> Ed,
> yes, that's exactly I wanted to say.
> It's like "DND.DROP_LINK" but through copy&paste operation.
It's a little tricky though right, because copy produces a copy and that
copied object won't be contained by anything. Adding it to a
non-containment reference will leave it as a dangling reference unless
you take some type of action.
>
> When I finish the copy&paste operation, if I modify a property in the
> element that has been pasted, the value is not updated in all the
> instances.
No doubt it's a copy.
>
> How can I get the refresh or something in order to get the recent
> pasted non-containment reference have the same behaviour that the
> other instances without reloading the model?.
Well, I don't understand this issue of "it works after it's been
reloaded". You mean for drag and drop? You also didn't answer my
question about the same object showing up more than once in the tree. I
asked it for a good reason; my providing helpful information depends on
the answer. I.e., you'll need to ensure that you produce wrappers for
the non-contained children.
>
> Thanks in advance.
> Carlos.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Copy & paste "link" elements in a model [message #638722 is a reply to message #638269] Fri, 12 November 2010 10:55 Go to previous message
Carlos  is currently offline Carlos Friend
Messages: 6
Registered: November 2010
Junior Member
Ed,
Firstable, excuse me because of my previous confusing explanation.
In order to answer your question, the same object showing up more than once in the tree.
The point was that after the copy&paste, when I tried to modify some properties at the dangling reference, obviuosly, that values were not updated in the other references.
When I said "it works after it's been reloaded", I wanted to say that after the copy&paste, I saved, closed and reopened the editor, and the dangling reference, became a "normal" reference.
So that I have done is implementing the behaviour I want over the standard copy & paste in order to allow the user to paste the non-containment references. Now, after the copy&paste, if I modify some property at the recent pasted reference, that value also changes in all the references.

Anyway, thank you very much for your attention.
Best regards.
Carlos.
Previous Topic:EMF Generic Search
Next Topic:EMF Helios Dev Environment
Goto Forum:
  


Current Time: Thu Apr 25 14:01:06 GMT 2024

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

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

Back to the top