Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Copy & paste non-EMF business objects
Copy & paste non-EMF business objects [message #762092] Wed, 07 December 2011 14:31 Go to next message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member

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?

Re: Copy & paste non-EMF business objects [message #762623 is a reply to message #762092] Thu, 08 December 2011 12:01 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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.

Previous Topic:Overlapping Connections
Next Topic:Export as gif file failing
Goto Forum:

Current Time: Tue Aug 04 10:48:06 GMT 2020

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

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

Back to the top