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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db.layer0.adapter;
\r
14 import java.util.Collection;
\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
24 public interface PasteHandler extends IAdaptable {
\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
32 * @param clipboard clipboard instance to paste data from
\r
33 * @throws DatabaseException
\r
35 Collection<Resource> pasteFromClipboard(SimanticsClipboard clipboard) throws DatabaseException;
\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
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
49 * @see Layer0Utils#copyTo(WriteGraph, org.simantics.db.Resource, org.simantics.db.Resource)
\r
51 Collection<Resource> pasteFromClipboard(WriteGraph graph, SimanticsClipboard clipboard, PasteEventHandler handler) throws DatabaseException;
\r