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