]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/PasteHandler.java
Sync git svn branch with SVN repository r33389.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / PasteHandler.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.layer0.adapter;\r
13 \r
14 import java.util.Collection;\r
15 \r
16 import org.eclipse.core.runtime.IAdaptable;\r
17 import org.simantics.db.Resource;\r
18 import org.simantics.db.WriteGraph;\r
19 import org.simantics.db.exception.DatabaseException;\r
20 import org.simantics.db.layer0.util.Layer0Utils;\r
21 import org.simantics.db.layer0.util.PasteEventHandler;\r
22 import org.simantics.db.layer0.util.SimanticsClipboard;\r
23 \r
24 public interface PasteHandler extends IAdaptable {\r
25 \r
26     /**\r
27      * Performs actions to paste data from the specified clipboard instance. The\r
28      * target of pasting generally has something to do with the graph database\r
29      * but not necessarily. The method must internally start transactions to\r
30      * either read from or write to the graph database.\r
31      * \r
32      * @param clipboard clipboard instance to paste data from\r
33      * @throws DatabaseException\r
34      */\r
35     Collection<Resource> pasteFromClipboard(SimanticsClipboard clipboard) throws DatabaseException;\r
36 \r
37     /**\r
38      * Performs actions to paste data from the specified clipboard instance\r
39      * using the specified write transaction database handle. Just as in\r
40      * {@link #pasteFromClipboard(SimanticsClipboard)} this pasting generally\r
41      * does with the graph database. This method can be used for performing\r
42      * copy/paste operations as a part of a write transaction.\r
43      * \r
44      * @param graph the write transaction handle to use for writing the data\r
45      * @param clipboard clipboard instance to paste data from\r
46      * @throws DatabaseException\r
47      * @since 1.8\r
48      * \r
49      * @see Layer0Utils#copyTo(WriteGraph, org.simantics.db.Resource, org.simantics.db.Resource)\r
50      */\r
51     Collection<Resource> pasteFromClipboard(WriteGraph graph, SimanticsClipboard clipboard, PasteEventHandler handler) throws DatabaseException;\r
52 \r
53 }\r