Copy & paste non-EMF business objects [message #762092] |
Wed, 07 December 2011 09:31  |
Eclipse User |
|
|
|
Hi,
I am trying to implement copy & paste for my non-EMF model objects. From the Graphiti API it looks like it would be possible, since putToClipboard() and getFromClipboard() methods take Object[]. But when looking at the source code, internally EObjects are expected. So I wonder if copy & paste for non-EMF objects are planned (or if there is some workaround)?
In the meantime, I tried to wrap the IndependenceSolver key for my business object in an attribute in a dynamically created EObject and send that to putToClipboard(), but it turned out that I have to have a Resource associated with those clipboard EObjects, and that this resource had to be associated with a Platform URI, so I needed to save a temporary file as soon as I did a copy operation (and saved in the actual project folder since it had to be a Platform URI). This temporary file is a quite messy solution, so I again wonder if there is some better way of achieving this?
Regards,
Jakob
|
|
|
Re: Copy & paste non-EMF business objects [message #762623 is a reply to message #762092] |
Thu, 08 December 2011 07:01  |
Eclipse User |
|
|
|
I would suggest not to try to force that into the existing EMF copy
functionality; this is written to copy EMF objects, nothing else. I would
recomment to implement your own copy and paste functionality by subclassing
AbstractCopyFeature and AbstractPasteFeature and implementing putToClipboard
and getFromClipboard they way that suits your technology.
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.07481 seconds