]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/PasteHandler.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / PasteHandler.java
diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/PasteHandler.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/PasteHandler.java
new file mode 100644 (file)
index 0000000..0aaaf4c
--- /dev/null
@@ -0,0 +1,53 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db.layer0.adapter;\r
+\r
+import java.util.Collection;\r
+\r
+import org.eclipse.core.runtime.IAdaptable;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.db.layer0.util.PasteEventHandler;\r
+import org.simantics.db.layer0.util.SimanticsClipboard;\r
+\r
+public interface PasteHandler extends IAdaptable {\r
+\r
+    /**\r
+     * Performs actions to paste data from the specified clipboard instance. The\r
+     * target of pasting generally has something to do with the graph database\r
+     * but not necessarily. The method must internally start transactions to\r
+     * either read from or write to the graph database.\r
+     * \r
+     * @param clipboard clipboard instance to paste data from\r
+     * @throws DatabaseException\r
+     */\r
+    Collection<Resource> pasteFromClipboard(SimanticsClipboard clipboard) throws DatabaseException;\r
+\r
+    /**\r
+     * Performs actions to paste data from the specified clipboard instance\r
+     * using the specified write transaction database handle. Just as in\r
+     * {@link #pasteFromClipboard(SimanticsClipboard)} this pasting generally\r
+     * does with the graph database. This method can be used for performing\r
+     * copy/paste operations as a part of a write transaction.\r
+     * \r
+     * @param graph the write transaction handle to use for writing the data\r
+     * @param clipboard clipboard instance to paste data from\r
+     * @throws DatabaseException\r
+     * @since 1.8\r
+     * \r
+     * @see Layer0Utils#copyTo(WriteGraph, org.simantics.db.Resource, org.simantics.db.Resource)\r
+     */\r
+    Collection<Resource> pasteFromClipboard(WriteGraph graph, SimanticsClipboard clipboard, PasteEventHandler handler) throws DatabaseException;\r
+\r
+}\r