Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Copy/Paste across editor instances
Copy/Paste across editor instances [message #1743865] Tue, 20 September 2016 09:55 Go to next message
Erwin De Ley is currently offline Erwin De LeyFriend
Messages: 52
Registered: August 2013
Member
With org.eclipse.graphiti.ui.features.AbstractCopyFeature.putToClipboard(Object[]) and org.eclipse.graphiti.ui.features.AbstractPasteFeature.getFromClipboard() it's possible to copy/paste diagram elements in a same diagram or across diagrams in a same Eclipse RCP Graphiti editor instance.

On the other hand I can not copy/paste between diagrams opened in 2 separate RCP instances. This seems to be related to the use of LocalSelectionTransfer in org.eclipse.graphiti.ui.internal.util.clipboard.ModelClipboard.getLocalSelectionContent().

The copy does place the selected elements in my "system-wide" clipboard, e.g. I can then paste in Notepad++ or so and get e.g. :
ContainerShape "org.eclipse.graphiti.mm.pictograms.impl.ContainerShapeImpl@49c4118b (visible: true, active: true)": platform:/resource/test/workflows/t2.tdml#/0/@children.4
  active=true
  visible=true
  class=org.eclipse.graphiti.mm.pictograms.ContainerShape

for a copied diagram element.

This also works when opening a plain text file in the other eclipse instance and pasting in there.

But the Graphiti paste does not "see" it in the other eclipse instance.

Is there a way to implement paste across eclipse instances with Graphiti?

thanks
erwin
Re: Copy/Paste across editor instances [message #1744015 is a reply to message #1743865] Wed, 21 September 2016 12:52 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1937
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Erwin,

unfortunataly, copy&paste is curently only supported withinthe same Eclipse instance, due to what you already wrote. There is a open bugzilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=375334) for reworking that but it has not yet made it into development. Enhancing that could be one task within that.

You may try to use your own ModelClipboard implementations though from your paste (and maybe copy ) feature and make use of other transfer implementations there, but I'm not sure which ones could apply here.

HTH,
Michael
Previous Topic:getSingleClickFeature of DefaultTollBehaviorProvider not triggered
Next Topic:Please delete
Goto Forum:
  


Current Time: Thu Dec 26 17:47:55 GMT 2024

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

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

Back to the top