Cloning a resource [message #415923] |
Fri, 11 January 2008 11:47 |
steve rooks Messages: 3 Registered: July 2009 |
Junior Member |
|
|
What is the best way to clone the contents of a resource, preserving all
object links?
Today, I've done something really simple, I save the resouce as a duplicate
file, and then open it, however I'm running into UI thread issues when I do
the save (I was trying todo this within a job).
So, is there something like,
cloneResource = originalResource.clone();
If not, how difficult would this be to achieve?
Many thanks,
steve rooks
|
|
|
Re: Cloning a resource [message #415926 is a reply to message #415923] |
Fri, 11 January 2008 12:50 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Steve,
You can use EcoreUtil.copyAll(resource.getContents()) and then add them
all to a new resource.
steve rooks wrote:
> What is the best way to clone the contents of a resource, preserving all
> object links?
>
> Today, I've done something really simple, I save the resouce as a duplicate
> file, and then open it, however I'm running into UI thread issues when I do
> the save (I was trying todo this within a job).
>
> So, is there something like,
>
> cloneResource = originalResource.clone();
>
> If not, how difficult would this be to achieve?
>
> Many thanks,
>
> steve rooks
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.16738 seconds