From: lehtonen Date: Mon, 24 Aug 2015 12:54:49 +0000 (+0000) Subject: Merged /sysdyn/trunk/org.simantics.sysdyn.ui:r31610 to /sysdyn/branches/1.9 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=ee59465e0062d5da37773c8ac4038cacfad7245c;p=simantics%2Fsysdyn.git Merged /sysdyn/trunk/org.simantics.sysdyn.ui:r31610 to /sysdyn/branches/1.9 refs #6001 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/1.9@31631 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/PasteSpecialHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/PasteSpecialHandler.java index 9ed9bde5..9a5e87b5 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/PasteSpecialHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/PasteSpecialHandler.java @@ -10,6 +10,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.handlers.HandlerUtil; import org.simantics.Simantics; +import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.util.ClipboardUtils; import org.simantics.db.layer0.util.SimanticsClipboard.Representation; import org.simantics.diagram.handler.CopyPasteHandler; @@ -65,7 +66,11 @@ public class PasteSpecialHandler extends AbstractHandler { ICanvasContext ctx = (ICanvasContext) v; CopyPasteHandler handler = ctx.getAtMostOneItemOfClass(CopyPasteHandler.class); if(handler != null) { - handler.paste(Commands.PASTE, getClipboardDiagramSelection()); + try { + handler.paste(Commands.PASTE, getClipboardDiagramSelection()); + } catch (DatabaseException e) { + throw new ExecutionException("Failed to get diagram selection from clipboard", e); + } } } @@ -75,7 +80,7 @@ public class PasteSpecialHandler extends AbstractHandler { return null; } - public DiagramSelection getClipboardDiagramSelection() { + public DiagramSelection getClipboardDiagramSelection() throws DatabaseException { for (Set content : Simantics.getClipboard().getContents()) { DiagramSelection sel = ClipboardUtils.accept(content, DiagramSelectionRepresentation.KEY_DIAGRAM_SELECTION); if (sel != null)